ASECO 2.2.2 and stuff

This forum is dedicated to the Aseco/Rasp 2 server records and control script by Flo and Assembler Maniac. Announcements and issues can be discussed in this forum.

Moderators: Flo, f*ckfish, Assembler Maniac, TM-Patrol

Assembler Maniac
Pit Crew
Pit Crew
Posts: 1493
Joined: 03 Jun 2006 13:24
Owned TM-games: TMU
Contact:

Re: ASECO 2.2.2 and stuff

Post by Assembler Maniac » 15 Jun 2009 13:39

Xymph wrote:
Assembler Maniac wrote:As for the isAdmin function, I'm not sure you realize what you're asking. Say someone writes a new cmd/function that allows deletion of a player & their records, but doesn't have an assigned admin level. With your request in place, even the lowest admin level possible would have the ability to execute the command.

The whole point of the admin level assignment is to prevent people from doing things they're not supposed to be doing. What you're asking for is to assume "any admin" when the system is specifically designed for "assume the worst, allow only superadmin".
Obviously the isAnyAdmin function wouldn't replace the existing system, and has fairly limited use as in most cases you will want to test for sufficient authorization, like you say.

But here's a simple example from XAseco where it is useful: /players outputs a list of nicknames and logins, and normal logins are shown in blue while admin ones are green. The function simply saves you doing isAdmin || isAdmin || etc. tests for however many admin levels there may be.
I can see it being useful the way you describe it, but I don't think that's quite what nocturne had in mind. I do like your idea though, so I'll add an isAnyAdmin function that just returns true/false if a player is an admin (regardless of them having done the /admin unlock).

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: ASECO 2.2.2 and stuff

Post by nocturne » 15 Jun 2009 19:39

Assembler Maniac wrote:What parts of the player class aren't TMF relevant? (keep in mind I haven't been following the forum discussions unless it was a basic question to be answered)
Well, you must of caught a bit of the discussion, as you seemed to have fixed it already... :thumbsup:

Code: Select all

/**
* Structure of an Player.
* Can be instantiated with an rpc "GetDetailedPlayerInfo" response.
*
* Edits by Willa, Nocturne and Others
*/
Xymph wrote:Fufi didn't write that, it's a core XAseco function by yours truly...
Sorry Xymph, I knew that was an xaseco function -- I just mistook the autoqueue isAdmin function (for checking across Xaseco/Aseco/Fast) as what I was thinking of (just recall from glancing through while doing some edits months back).

What I meant by a generic-check on the isAdmin function was that if no authitem is given as a parameter, then pass as long as the player is on any of the admin lists (or has any authitem's verified -- which ever is easier to code). It has it's uses, the not idlekicking with autoqueue, displaying admin commands in the help plugin, using '/msg admin', and using '/players' as an admin (myself, put in a generic authitem, ADMIN, and used it to display the admin parts to all admins, and put a check with new authitems for each action in the relevant functions). Much of the usage of isAdmin without an authitem seems to be meant for checking just if the player is an admin, so the AdminSuper authitem seems to be a little overstretched. An isAnyAdmin function would be preferable, but would require changes in several plugins that try to use isAdmin in such a way.
Assembler Maniac wrote:And for everyone: I'm going to be posting an announcement with some guidelines for authoring plugins for ASECO 2.x. I've seen some not so great coding in the plugins I've been working on, and it bugs me a little that it could be better.
Not talking about mine, are ya..? :lol:

Sounds like it'd be a good idea, but maybe instead of a witch hunt, it could be more of an informative post, outlining things such as proper formatting, lists of common built-in aseco functions, plugin interoperability, etc... For that matter, would be nice to bring back the nicely formatted pdf readme. Sure, kind of expect server ops to be able to handle it without a problem -- but there's plenty of noobies that could use the hints (hell, that readme got me going years back, hehe).

Assembler Maniac
Pit Crew
Pit Crew
Posts: 1493
Joined: 03 Jun 2006 13:24
Owned TM-games: TMU
Contact:

Re: ASECO 2.2.2 and stuff

Post by Assembler Maniac » 15 Jun 2009 20:27

nocturne wrote:What I meant by a generic-check on the isAdmin function was that if no authitem is given as a parameter, then pass as long as the player is on any of the admin lists (or has any authitem's verified -- which ever is easier to code). It has it's uses, the not idlekicking with autoqueue, displaying admin commands in the help plugin, using '/msg admin', and using '/players' as an admin (myself, put in a generic authitem, ADMIN, and used it to display the admin parts to all admins, and put a check with new authitems for each action in the relevant functions). Much of the usage of isAdmin without an authitem seems to be meant for checking just if the player is an admin, so the AdminSuper authitem seems to be a little overstretched. An isAnyAdmin function would be preferable, but would require changes in several plugins that try to use isAdmin in such a way.
I'm going to have to go with safety on this one. I've created isAnyAdmin to be used as asked, but I'm not going to change the existing one. I'm too worried that it'll open up holes someplace and cause trouble.
Assembler Maniac wrote:And for everyone: I'm going to be posting an announcement with some guidelines for authoring plugins for ASECO 2.x. I've seen some not so great coding in the plugins I've been working on, and it bugs me a little that it could be better.
Not talking about mine, are ya..? :lol:
nocturne wrote:Sounds like it'd be a good idea, but maybe instead of a witch hunt, it could be more of an informative post, outlining things such as proper formatting, lists of common built-in aseco functions, plugin interoperability, etc... For that matter, would be nice to bring back the nicely formatted pdf readme. Sure, kind of expect server ops to be able to handle it without a problem -- but there's plenty of noobies that could use the hints (hell, that readme got me going years back, hehe).
Not talking about anyone's specifically, just a general bunch of things I've run into.

User avatar
oliverde8
solid chaser
solid chaser
Posts: 1135
Joined: 07 Oct 2006 07:03
Owned TM-games: TMU
Manialink(s): oliverde8
Location: Turkey
Contact:

Re: ASECO 2.2.2 and stuff

Post by oliverde8 » 15 Jun 2009 20:45

I will clean TMX info thats seems the only one of my plugins that I can clean easily :grmblz:
ImageImage
Manialink : oliverde8color>
Servers : STATS <> United | VeryShort | Made In Turkey

User avatar
oliverde8
solid chaser
solid chaser
Posts: 1135
Joined: 07 Oct 2006 07:03
Owned TM-games: TMU
Manialink(s): oliverde8
Location: Turkey
Contact:

Re: ASECO 2.2.2 and stuff

Post by oliverde8 » 16 Jun 2009 08:23

Can we have a saveblacklist?

will need to add a setting blacklist file name, but thats all. It would be nice t have it in the official realese and not to have to add it
ImageImage
Manialink : oliverde8color>
Servers : STATS <> United | VeryShort | Made In Turkey

Assembler Maniac
Pit Crew
Pit Crew
Posts: 1493
Joined: 03 Jun 2006 13:24
Owned TM-games: TMU
Contact:

Re: ASECO 2.2.2 and stuff

Post by Assembler Maniac » 16 Jun 2009 12:18

oliverde8 wrote:Can we have a saveblacklist?

will need to add a setting blacklist file name, but thats all. It would be nice t have it in the official realese and not to have to add it
Yes. With setting in main aseco config to set it.

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: ASECO 2.2.2 and stuff

Post by w1lla » 16 Jun 2009 18:08

Code: Select all

		// release the internal shutdown event ...
		$this->releaseEvent('onServerCrash');
shouldnt that be:

Code: Select all

StopServer
method?

in aseco.php

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: ASECO 2.2.2 and stuff

Post by nocturne » 16 Jun 2009 20:00

Another request... the option to save a player's last IP to the players table and use it to check if a connecting admin's ip has changed, and if not go ahead and validate their admin commands. Or even just the option not to require the unlock password. Besides, Nadeo claimed they fixed it, and I'm just not all that worried about it...

Assembler Maniac
Pit Crew
Pit Crew
Posts: 1493
Joined: 03 Jun 2006 13:24
Owned TM-games: TMU
Contact:

Re: ASECO 2.2.2 and stuff

Post by Assembler Maniac » 16 Jun 2009 20:37

nocturne wrote:Another request... the option to save a player's last IP to the players table and use it to check if a connecting admin's ip has changed, and if not go ahead and validate their admin commands. Or even just the option not to require the unlock password. Besides, Nadeo claimed they fixed it, and I'm just not all that worried about it...
You can easily default the value in the player class to true if you're not too worried about it. (types/player.class.php, approx line 90) Unless they're in the admin list, it won't let them do anything even if it's unlocked.

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: ASECO 2.2.2 and stuff

Post by nocturne » 16 Jun 2009 21:04

w1lla wrote:

Code: Select all

		// release the internal shutdown event ...
		$this->releaseEvent('onServerCrash');
shouldnt that be:

Code: Select all

StopServer
method?

in aseco.php
That function insn't meant to shutdown the server, but meant to create the crash event so that certain actions can be executed in the event of Aseco shutting down due to an error; such as saving the current round's new records and restoring callvote setting in the case of my vote script.
Assembler Maniac wrote:You can easily default the value in the player class to true if you're not too worried about it. (types/player.class.php, approx line 90) Unless they're in the admin list, it won't let them do anything even if it's unlocked.
Well, that's simple enough... but a config option would be nice. Would be nice not to have to spend a week digging through code before an aseco update, hehe.. :roflol:

alnitak
pedestrian
pedestrian
Posts: 6
Joined: 06 Jul 2008 00:02
Owned TM-games: TMUF

Re: ASECO 2.2.2 and stuff

Post by alnitak » 18 Jun 2009 19:26

Is there any chance of XAseco and official RASP/ASECO getting aligned?

I've recently "downgraded" all of BCS's servers to XAseco 1.0.x from Aseco 2.2.0c because our users were demanding plugin features that simply aren't available or compatible with the official ASECO.

No disrespect intended, Xymph, but the reason I call this a "downgrade" is because that code still relies on the old plugin model that was present when you forked your branch, and the official ASECO's new plugin model is very much cleaner.

If it were possible to merge the two I'd be happy to help, and we've another professional PHP coder in our team too.

Al.

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: ASECO 2.2.2 and stuff

Post by nocturne » 18 Jun 2009 19:50

Two more little things...

The ability to send a callvote without a voteratio (or set as -1), and have the vote pass/fail at the end of the time limit by simple majority.

Also, since the RASP Players plugin uses a generic isAdmin check for the admin version of the popup, it defaults to the 'AdminSuper' authitem, preventing those admins without the authitem from using it. Perhaps just an isAnyAdmin check first, then individual authitem checks in each resulting function.

This is what I'm using... (to others, this is not functional code in Aseco 2.2.0/2.2.1)

Code: Select all

<?php
/*
 Original version by Mistral (wrong attribution removed)
 hack/slash/general mayhem for aseco 1.0x by AssemblerManiac
 */

class RaspPlayerAdmin extends Plugin
	{
	function chatPlayers(&$command)
		{
		$player = $command['author'];
		$command['params'] = explode(' ', $command['params']);
		$wildcard = $command['params'][0];

		if ( isset($player->data['w_players']) )
			{
			$player->data['w_players']->maximize();
			return;
			}

		if ($this->Aseco->isAnyAdmin($command['author']))
			$this->playerAdmin($command, $wildcard);
		else
			$this->playerList($command, $wildcard);
		}

	function onCloseWin($clickvalue, &$window, &$player)
		{
		unset($player->data['w_players']);
		}  //  onCloseWin

	// show a short list of players, no admin functions
	function playerList(&$command, &$wildcard)
		{
		$content = array();
		$header = "<line height='.02'><cell width='0.94'></cell></line>
					<line height='0.04'>
					<cell width='0.47' bgcolor='888E'><text halign='right'>Login</text></cell>
					<cell width='0.47' bgcolor='888E'><text>  NickName</text></cell></line>";

		$detail = "<line height='0.04'>
					<cell width='0.47'><text textcolor='EEEE' halign='right'>{LOGIN}</text></cell>
					<cell width='0.47'><text textcolor='EEEE'>  {NICKNAME}</text></cell></line>";
		$msg = '';
		$player = $command['author'];
		$ctr1 = 0;
		foreach($this->Aseco->server->players->player_list as $pl)
			{
			if ( strlen($command['params'][0]) == 0 ||
				 stripos(stripFormatting($pl->nickname), $wildcard) > 0 ||
				 stripos($pl->login, $wildcard) > 0)
				{
				$s = $detail;
				$s = str_replace('{LOGIN}', $pl->login, $s);
				$s = str_replace('{NICKNAME}', htmlspecialchars($pl->nickname), $s);
				$ctr1++;
				$msg .= $s;
				if ( $ctr1 > 20 )
					{
					$ctr1 = 0;
					$content[] = $header . $msg;
					$msg = '';
					}
				}
			}

		if ( strlen($msg) > 0 )
			{
			$ctr1 = 0;
			$content[] = $header . $msg;
			}

		if ( sizeof($content) == 0 )
			{
			$this->Aseco->client->query('ChatSendServerMessageToLogin', 'No matches found', $command['author']->login);
			return;
			}

    	$window = $this->createWindowToPlayerFramework('Player List', .94, 1.15, $player);
//		if ($player->data['PA']['bg_light'])
//			$bg='BBBE';
//		else
//			$bg='222E';

		//$window->setBackground('0000');
		$window->setContent($content);
		$window->addCallback('close', 'onCloseWin');
		$player->data['w_players'] = $window;
		}

	function playerAdmin(&$command, $wildcard)
		{
		$player = $command['author'];
		$content = $this->buildPages($command, $wildcard);
		if ( sizeof($content) == 0 )
			{
			$this->Aseco->client->query('ChatSendServerMessageToLogin', 'No matches found', $command['author']->login);
			return;
			}

    	$window = $this->createWindowToPlayerFramework('Player Admin', 1.1, 1.15, $player);
//		if ($player->data['PA']['bg_light'])
//			$bg='BBBE';
//		else
//			$bg='222E';

		//$window->setBackground('0000');
		$window->setContent($content);
		$window->addCallback('ignore', 'playerIgnore');
		$window->addCallback('nick', 'showNick');
		$window->addCallback('color', 'bgColor');
		$window->addCallback('guest', 'playerGuest');
		$window->addCallback('warn', 'playerWarn');
		$window->addCallback('kick', 'playerKick');
		$window->addCallback('ban', 'playerBan');
		$window->addCallback('black', 'playerBlackList');
		$window->addCallback('close', 'onCloseWin');
		$command['author']->data['w_players'] = $window;

		}  //  playerAdmin

	function buildPages(&$command, $wildcard)			// returns a $contents array for sending to a new, or changed, window
		{
		$admin = $command['author'];

		if ( !isset($admin->data['PA']) )
			{
			$admin->data['PA'] = array();
			$admin->data['PA']['bg_light'] = true;
			$admin->data['PA']['show_nick'] = true;
			}

		$admin->data['PA']['wildcard'] = $wildcard;
		$header = "<line height='.02'><cell></cell></line>
				<line height='.04'>";

		if ($admin->data['PA']['bg_light'])
			$nickbg = 'BBBE';
		else
			$nickbg = '222E';

		if ($admin->data['PA']['show_nick'])
			$header .= 	"<cell width='0.3' bgcolor='444F'><text halign='center' action='{name:nick,param:0}'>\$0F0Nickname\$z\$s/Login</text></cell>";
		else
			$header .= 	"<cell width='0.3' bgcolor='444F'><text halign='center' action='{name:nick,param:1}'>Nickname/\$0F0Login\$z\$s</text></cell>";
		$header .= "<cell width='0.1' bgcolor='888E'></cell>";
		$header .= "<cell width='0.2' bgcolor='888E'><text halign='center'>Guest</text></cell>
					<cell width='0.3' bgcolor='888E'></cell>";
		if ($admin->data['PA']['bg_light'])
			$header .= "<cell width='0.2' bgcolor='222E'><text halign='center' action='{name:color,param:0}' textcolor='BBB'>DARK</text></cell></line>";
		else
			$header .= "<cell width='0.2' bgcolor='BBBE'><text halign='center' action='{name:color,param:1}' textcolor='222'>LIGHT</text></cell></line>";
		$header.="<line height='.02'><cell></cell></line>";

		$header .= "<line height='0.003'><cell width='1.1' bgcolor='0000'></cell></line>";

		$this->Aseco->client->query('GetGuestList', 100, 0);
		$guests = $this->Aseco->client->getResponse();

		$this->Aseco->client->query('GetIgnoreList', 100, 0);
		$ignored = $this->Aseco->client->getResponse();

		$pl_list = array();
		$ctr = 1;
		$i = 0;

		$pages = array();

		foreach($this->Aseco->server->players->player_list as $pl)
			{
			if ( ! (strlen($command['params'][0]) == 0 ||
				 stripos(stripFormatting($pl->nickname), $wildcard) > 0 ||
				 stripos($pl->login, $wildcard) > 0) )
				continue;

			$isguest = false;
			foreach ($guests as $guest)
				{
				if ($pl->login == $guest['Login'])
					{
					$isguest = true;
					break;
					}
				}

			$isignored = false;
			foreach ($ignored as $ignore)
				{
				if ($pl->login == $ignore['Login'])
					{
					$isignored = true;
					break;
					}
				}

			$pl_list[$ctr] = array('login'=>$pl->login, 'guest'=>$isguest, 'ignore'=>$isignored, 'nickname'=>$pl->nickname);

			if ($admin->data['PA']['show_nick'])
				$showname = htmlspecialchars($pl->nickname);
			else
				$showname = $pl->login;

			$content.="<line height='0.04'>";
			$content.="<cell bgcolor='{$nickbg}' width='0.4'><text halign='left'> " . $showname . '$z$s</text></cell>';
			$gt='$F00Add';
			if ($isguest)
				$gt='$0F0Remove';
			$content.="<cell width='0.1'><text halign='center' action='{name:guest,param:" . $ctr . "}'>" . $gt . '</text></cell>';
			$content.="<cell width='0.12'><text halign='center' action='{name:warn,param:" . $ctr . "}' textcolor='FF0'>Warn</text></cell>";
			$ig="F80'>Ignore";
			if ($isignored)
				$ig="0F0'>Unignore";
			$content.="<cell width='0.12'><text halign='center' action='{name:ignore,param:" . $ctr . "}' textcolor='".$ig.'</text></cell>';
			$content.="<cell width='0.12'><text halign='center' action='{name:kick,param:" . $ctr . "}' textcolor='88f'>Kick</text></cell>";
			$content.="<cell width='0.12'><text halign='center' action='{name:ban,param:" . $ctr . "}' textcolor='44f'>Ban</text></cell>";
			$content.="<cell width='0.12'><text halign='center' action='{name:black,param:" . $ctr . "}' textcolor='00F'>Black</text></cell>";
			$content.="</line>";
			$content.="<line height='0.003'><cell width='1.1' bgcolor='0000'></cell></line>";

			$i++;
			if ( $i > 20 )
				{
				$i = 0;
				$pages[] = $header . $content;
				$content = '';
				}
			$ctr++;
			}
		if ( strlen($content) > 0 )
			{
			$pages[] = $header . $content;
			}

		$admin->data['PA']['list'] = $pl_list;

		return $pages;
		}

	function reDisplay(&$window, &$player)
		{
		$cmd['author'] = $player;
		$cmd['params'] = $player->data['PA']['wildcard'];
		$content = $this->buildPages($cmd, $wildcard);
		if ( sizeof($content) == 0 )
			{
			$window->close();
			}
		else
			{
			$window->setContent($content);
			$window->show();
			}
		}  //  redisplay

	function showNick($clickvalue, &$window, &$player)
		{
		$player->data['PA']['show_nick'] = $clickvalue;
		$this->reDisplay($window, $player);
		}  //  showNick

	function bgColor($clickvalue, &$window, &$player)
		{
		$player->data['PA']['bg_light'] = $clickvalue;

//		if ($player->data['PA']['bg_light'])
//			$bg='BBBE';
//		else
//			$bg='222E';

//		$window	->setBackground($bg);
		$this->reDisplay($window, $player);
		}  //  bgColor


	function playerWarn($clickvalue, &$window, &$player)
		{
		
		if (!$this->Aseco->isAdmin($player, 'ADMINWARN'))
			{
			$this->Aseco->client->query('ChatSendServerMessageToLogin', '$i$f44You don\'t have permission to do that!!!', $player->login);
			return;
			}
	
		$who = $player->data['PA']['list'][$clickvalue];
		$login = $who['login'];

		$cr = "\n";
		$message =	'$s$F00This is an administrative warning.' . $cr . $cr .
						'$z$sYou have done something against our server\'s policy. Not respecting other players,' . $cr . 'or using offensive language might result in a $F00kick, or ban $z$88F$sthe next time.' . $cr . $cr .
						'$z$sThe server administrators.';
		$this->sendPopupWindowToPlayer($login, $message, "WARNING");

		$message = formatText('{#server}>> Admin warned {1}', $who['nickname']);
		$message = $this->Aseco->formatColors($message);
		$this->Aseco->client->query('ChatSendServerMessage', $message);

		$window->show();
		}  //  playerWarn


	function playerGuest($clickvalue, &$window, &$player)
		{
		
		if (!$this->Aseco->isAdmin($player, 'ADMINGUEST'))
			{
			$this->Aseco->client->query('ChatSendServerMessageToLogin', '$i$f44You don\'t have permission to do that!!!', $player->login);
			return;
			}
		
		$who = $player->data['PA']['list'][$clickvalue];
		$login = $who['login'];
		$nickname = $who['nickname'];
		if ($who['guest'])
			{
			$this->Aseco->client->query('RemoveGuest', $login);
			$message = formatText('{#server}>> Admin removed {1} {#server}from guestlist!', $nickname);
			}
		else
			{
			$this->Aseco->client->query('AddGuest', $login);
			$message = formatText('{#server}>> Admin added {1} {#server}to guestlist!', $nickname);
			}

		$message = $this->Aseco->formatColors($message);
		$this->Aseco->client->query('ChatSendServerMessage', $message);

		$this->reDisplay($window, $player);
		}

	function playerIgnore($clickvalue, &$window, &$player)
		{

		if (!$this->Aseco->isAdmin($player, 'ADMINIGNORE'))
			{
			$this->Aseco->client->query('ChatSendServerMessageToLogin', '$i$f44You don\'t have permission to do that!!!', $player->login);
			return;
			}
		
		$who = $player->data['PA']['list'][$clickvalue];
		$login = $who['login'];
		$nickname = $who['nickname'];
		if ($who['ignore'])
			{
			$this->Aseco->client->query('UnIgnore', $login);
			$message = formatText('{#server}>> Admin removed {1} {#server}from the ignore list!', $nickname);
			}
		else
			{
			$this->Aseco->client->query('Ignore', $login);
			$message = formatText('{#server}>> Admin added {1} {#server}to the ignore list!', $nickname);
			}

		$message = $this->Aseco->formatColors($message);
		$this->Aseco->client->query('ChatSendServerMessage', $message);

		$this->reDisplay($window, $player);
		}

	// Kick
	function playerKick($clickvalue, &$window, &$player)
		{

		if (!$this->Aseco->isAdmin($player, 'ADMINKICK'))
			{
			$this->Aseco->client->query('ChatSendServerMessageToLogin', '$i$f44You don\'t have permission to do that!!!', $player->login);
			return;
			}
		
		$who = $player->data['PA']['list'][$clickvalue];
		$login = $who['login'];
		$nickname = $who['nickname'];
		$this->Aseco->client->query('Kick', $login);
		$message = formatText('{#server}>> Admin kicked {1}{#server}!', $nickname);
		$message = $this->Aseco->formatColors($message);
		$this->Aseco->client->query('ChatSendServerMessage', $message);

		$this->reDisplay($window, $player);
		}

	// Ban
	function playerBan($clickvalue, &$window, &$player)
		{

		if (!$this->Aseco->isAdmin($player, 'ADMINBAN'))
			{
			$this->Aseco->client->query('ChatSendServerMessageToLogin', '$i$f44You don\'t have permission to do that!!!', $player->login);
			return;
			}
		
		$who = $player->data['PA']['list'][$clickvalue];
		$login = $who['login'];
		$nickname = $who['nickname'];
		$this->Aseco->client->query('Ban', $login);
		$this->Aseco->client->query('Kick', $login);
		$message = formatText('{#server}>> Admin banned {1}{#server}!', $nickname);
		$message = $this->Aseco->formatColors($message);
		$this->Aseco->client->query('ChatSendServerMessage', $message);

		$this->reDisplay($window, $player);
		}

	// Blacklist
	function playerBlackList($clickvalue, &$window, &$player)
		{

		if (!$this->Aseco->isAdmin($player, 'ADMINBLACKLIST'))
			{
			$this->Aseco->client->query('ChatSendServerMessageToLogin', '$i$f44You don\'t have permission to do that!!!', $player->login);
			return;
			}
		
		$who = $player->data['PA']['list'][$clickvalue];
		$login = $who['login'];
		$nickname = $who['nickname'];
		$this->Aseco->client->query('BlackList', $login);
		$this->Aseco->client->query('Kick', $login);
		$message = formatText('{#server}>> Admin blacklisted {1}{#server}!', $nickname);
		$message = $this->Aseco->formatColors($message);
		$this->Aseco->client->query('ChatSendServerMessage', $message);

		$this->reDisplay($window, $player);
		}

	}

$_PLUGIN = new RaspPlayerAdmin();
$_PLUGIN->setAuthor('Assembler Maniac');
$_PLUGIN->setVersion(1.01);
$_PLUGIN->addChatCommand('players', 'chatPlayers', 'Shows list of players on server');
?>
One problem though is the addition of the the warn, blacklist, ignore, and guest authitems; which wouldn't be automatically to the admingroups file without being attached to a chat command first (at least that's how I think it works, hehe). One solution though, would be to add the equivalent commands to the Aseco admin plugin, but they wouldn't be too useful without the addition of popups for the ignore/ban/black/guest lists...

Assembler Maniac
Pit Crew
Pit Crew
Posts: 1493
Joined: 03 Jun 2006 13:24
Owned TM-games: TMU
Contact:

Re: ASECO 2.2.2 and stuff

Post by Assembler Maniac » 19 Jun 2009 00:11

alnitak wrote:Is there any chance of XAseco and official RASP/ASECO getting aligned?

I've recently "downgraded" all of BCS's servers to XAseco 1.0.x from Aseco 2.2.0c because our users were demanding plugin features that simply aren't available or compatible with the official ASECO.

No disrespect intended, Xymph, but the reason I call this a "downgrade" is because that code still relies on the old plugin model that was present when you forked your branch, and the official ASECO's new plugin model is very much cleaner.

If it were possible to merge the two I'd be happy to help, and we've another professional PHP coder in our team too.

Al.
This isn't likely to ever happen. ASECO 2.x has a full windowing framework that XAseco would have to work with, and the nature of the "new" plugin structure isn't at all compatible with the old way of doing things. It took Flo and I quite a while to get it all working well, and converting the original plugins & RASP wasn't exactly easy.

There are ways to write a plugin that can be called from either ASECO 2.x or XAseco, Fufi widgets does it, but it is not a simple task.

Assembler Maniac
Pit Crew
Pit Crew
Posts: 1493
Joined: 03 Jun 2006 13:24
Owned TM-games: TMU
Contact:

Re: ASECO 2.2.2 and stuff

Post by Assembler Maniac » 19 Jun 2009 00:17

nocturne wrote:Two more little things...

The ability to send a callvote without a voteratio (or set as -1), and have the vote pass/fail at the end of the time limit by simple majority.

Also, since the RASP Players plugin uses a generic isAdmin check for the admin version of the popup, it defaults to the 'AdminSuper' authitem, preventing those admins without the authitem from using it. Perhaps just an isAnyAdmin check first, then individual authitem checks in each resulting function.

< code snipped >

One problem though is the addition of the the warn, blacklist, ignore, and guest authitems; which wouldn't be automatically to the admingroups file without being attached to a chat command first (at least that's how I think it works, hehe). One solution though, would be to add the equivalent commands to the Aseco admin plugin, but they wouldn't be too useful without the addition of popups for the ignore/ban/black/guest lists...
You're right about rasp players plugin, I totally missed that one.

New function for adding auth items to the main group? $_PLUGIN->addAuthItem('NAME', TRUE/FALSE (default));

After all the plugins are loaded it can go find out if any new auth items were added and put them in the main AUTHITEM group.

Assembler Maniac
Pit Crew
Pit Crew
Posts: 1493
Joined: 03 Jun 2006 13:24
Owned TM-games: TMU
Contact:

Re: ASECO 2.2.2 and stuff

Post by Assembler Maniac » 23 Jun 2009 21:19

Attn: Nocturne & W1lla (and anyone else interested in testing v2.2.2)

Downloads are as follows:
ASECO TMF 2.2.2
DediMania for ASECO v2.2.2
FuFi Widgets for ASECO v2.2.2

ASECO/RASP Changes include:
  • config.xml - adminunlocked setting, true means the admin commands are unlocked by default
  • Aseco->isAnyAdmin function - reports true if player is any type of admin
  • AdminGroups - named groups for use wherever
  • TMFServer test - will give warning & forum post link if server is older than current version (2009-05-25)
  • addAuthItem - plugins can now add auth items that they use, this will add them to the auth item list in admingroups.xml (see bottom of plugin.rasp_players.php for how this works)
  • Rasp Players plugin - will only list clickable items when player has rights to those functions
  • BeginChallenge/EndChallenge callbacks added along with appropriate events
  • BeginRace/EndRace callbacks now do onBeginRace/onEndRace events
  • /admin endwarmup command added - see rasp.xml for new messsages
  • new basic function isTrue to compare settings against 1, '1', or 'true' (no matter what case it's in), returns true/false boolean
  • admins with PASSCANCELVOTE authitem now have 2 additional buttons when a vote comes up, Pass and Cancel
  • Rasp - Rec/Pb info moved to lower right, just above the speed indicator
  • Admin level of 'AnyAdmin' can be assigned to an admin chat command. Any admin level will be allowed to use that command (it's like doing isAnyAdmin within a function)
Dedimania and FuFi plugins have been adjusted to use the onNewChallenge/onEndChallenge events, I've also set them so the onMainLoop event handlers only process once per second. It should help minimize CPU usage if they're not getting called constantly.
Dedimania has also been adjusted to use getPlugin function once, and as few re-assignments as possible (using $this-> over $var = $this->, then use var later)

I'm hoping everything works ok.

If anyone has suggestions/bugs, let me know.

Post Reply