Page 3 of 32

Re: [Plugin]FreeZone Plugin

Posted: 31 Jan 2011, 17:23
by nocturne
Bug..

Code: Select all

 -> ManiaLive\DedicatedApi\Xmlrpc\Exception with code -1000
    SenderLogin unknown.
  - in /home/letsrock/ml_freezone/libraries/ManiaLive/DedicatedApi/Xmlrpc/Client_Gbx.php on line 269
  - Stack: #0 /home/letsrock/ml_freezone/libraries/ManiaLive/DedicatedApi/Xmlrpc/Client_Gbx.php(295): ManiaLive\DedicatedApi\Xmlrpc\Client_Gbx->getResult()
           #1 [internal function]: ManiaLive\DedicatedApi\Xmlrpc\Client_Gbx->query('ChatForwardToLo...', '', 'sgt.tank', '')
           #2 /home/letsrock/ml_freezone/libraries/ManiaLive/DedicatedApi/Connection.php(146): call_user_func_array(Array, Array)
           #3 /home/letsrock/ml_freezone/libraries/ManiaLive/DedicatedApi/Connection.php(838): ManiaLive\DedicatedApi\Connection->execute('ChatForwardToLo...', Array, false)
           #4 /home/letsrock/ml_freezone/libraries/ManiaLivePlugins/Freezone/Freezone/Plugin.php(581): ManiaLive\DedicatedApi\Connection->chatForwardToLogin('', Object(ManiaLive\DedicatedApi\Structures\Player))
           #5 /home/letsrock/ml_freezone/libraries/ManiaLivePlugins/Freezone/Freezone/Plugin.php(529): ManiaLivePlugins\Freezone\Freezone\Plugin->checkLanguage(132, 'sgt.tank', '', false)
           #6 [internal function]: ManiaLivePlugins\Freezone\Freezone\Plugin->onPlayerChat(132, 'sgt.tank', '', false)
           #7 /home/letsrock/ml_freezone/libraries/ManiaLive/DedicatedApi/Callback/Event.php(28): call_user_func_array(Array, Array)
           #8 /home/letsrock/ml_freezone/libraries/ManiaLive/Event/Dispatcher.php(52): ManiaLive\DedicatedApi\Callback\Event->fireDo(Object(ManiaLivePlugins\Freezone\Freezone\Plugin))
           #9 /home/letsrock/ml_freezone/libraries/ManiaLive/DedicatedApi/Connection.php(117): ManiaLive\Event\Dispatcher::dispatch(Object(ManiaLive\DedicatedApi\Callback\Event))
           #10 /home/letsrock/ml_freezone/libraries/ManiaLive/Application/AbstractApplication.php(114): ManiaLive\DedicatedApi\Connection->executeCallbacks()
           #11 /home/letsrock/ml_freezone/bootstrapper.php(20): ManiaLive\Application\AbstractApplication->run()
           #12 {main}
Seems like an error with the dedicated server... I didn't bother to check the server logs when exactly the player disconnected and if they actually sent a chat message -- think it's irrelevant.

Suppose this could be fixed easily enough in the plugin..

Code: Select all

	protected function checkLanguage($playerUid, $login, $text, $isRegistredCmd)
	{
		if(!$isRegistredCmd && $text != '')
		{
			$warn = $this->getWarnLevel($login);

			if($warn && $warn->level == self::TMP_BAN && $warn->warnDate + self::$tmpBanDuration > time())
			{
				return;
			}

			$pattern = '/.*(?:^|\\s)('.implode('|', $this->slangWords).')(?:$|\\s).*/i';
			if(!preg_match($pattern, $text))
			{
				$player = $this->storage->getPlayerObject($login);
				if (!$player) return;
				$this->connection->chatForwardToLogin($text, $player);

				$this->logChat($login, $text);
			}
			else
			{
				$this->logSlang($login, $text);
				$player = $this->storage->getPlayerObject($login);

				if($warn)
				{
					$warn->warnCount += 1;
					switch ($warn->level)
					{
						case self::WARNING:
							if(time() < $warn->warnDate + self::$warnPrescription)
							{
								if($warn->warnCount > self::$warnCount)
								{
									$warn->level = self::TMP_BAN;
									$this->logChat($login, 'has been banned temporaly from the chat for the 1st time');
									$this->connection->chatSendServerMessageToLanguage(self::$tmpBanMessage, $player);
								}
								else
								{
									$this->connection->chatSendServerMessageToLanguage(self::$warnMessage, $player);
									$this->logChat($login, 'has been warned for the '.$warn->warnCount - self::$warnCount.'th time');
								}
							}
							else
							{
								$this->connection->chatSendServerMessageToLanguage(self::$warnMessage, $player);
								$this->logChat($login, 'has been warned');
								$warn->warnCount = 1;
							}
							break;
						case self::TMP_BAN:
							if(time() < $warn->warnDate + self::$tmpBanPrescription)
							{
								if($warn->warnCount > (self::$warnCount + self::$tmpBanCount))
								{
									$this->connection->ignore($this->storage->getPlayerObject($login));
									$this->logChat($login, 'has been banned definitly from the chat');
									$this->connection->chatSendServerMessageToLanguage(self::$banChatMessage, $player);

									$ban = array('playerLogin' => $login);
									$ban['reason'] = 'Bad language on server '.$this->storage->serverLogin;

									$this->wsInstance->execute('POST', '/freezone/ban/chat/', array($ban));
									return;
								}
								else
								{
									$this->connection->chatSendServerMessageToLanguage(self::$tmpBanMessage, $player);
									$this->logChat($login, 'has been banned temporaly for the '.$warn->warnCount - self::$warnCount.'th time');
								}
							}
							else
							{
								$warn->warnCount = 1;
								$warn->level = self::WARNING;
								$this->connection->chatSendServerMessageToLanguage(self::$warnMessage, $player);
								$this->logChat($login, 'has been warned');
							}
							break;
					}
					$this->setWarn($warn);
				}
				else
				{
					$warn = new Warn();
					$warn->login = $login;
					$warn->serverLogin = $this->storage->serverLogin;
					$warn->warnCount = 1;
					$warn->level = self::WARNING;
					$this->setWarn($warn);
					$this->connection->chatSendServerMessageToLanguage(self::$warnMessage, $player, true);
					$this->logChat($login, 'has been warn for the 1st time');
				}
			}
		}
	}

Re: [Plugin]FreeZone Plugin

Posted: 31 Jan 2011, 17:31
by nocturne
Now I'm getting one of these errors every few seconds..

Code: Select all

 -> ManiaLib\Rest\Exception with code 0
    API error
  - in /home/letsrock/ml_freezone/libraries/ManiaLib/Rest/Client.php on line 173
  - Stack: #0 /home/letsrock/ml_freezone/libraries/ManiaLivePlugins/Freezone/Freezone/Plugin.php(231): ManiaLib\Rest\Client->execute('POST', '/freezone/live/', Array)
           #1 /home/letsrock/ml_freezone/libraries/ManiaLive/Features/Tick/Event.php(26): ManiaLivePlugins\Freezone\Freezone\Plugin->onTick()
           #2 /home/letsrock/ml_freezone/libraries/ManiaLive/Event/Dispatcher.php(52): ManiaLive\Features\Tick\Event->fireDo(Object(ManiaLivePlugins\Freezone\Freezone\Plugin))
           #3 /home/letsrock/ml_freezone/libraries/ManiaLive/Features/Tick/Ticker.php(32): ManiaLive\Event\Dispatcher::dispatch(Object(ManiaLive\Features\Tick\Event))
           #4 /home/letsrock/ml_freezone/libraries/ManiaLive/Application/Event.php(36): ManiaLive\Features\Tick\Ticker->onPreLoop()
           #5 /home/letsrock/ml_freezone/libraries/ManiaLive/Event/Dispatcher.php(52): ManiaLive\Application\Event->fireDo(Object(ManiaLive\Features\Tick\Ticker))
           #6 /home/letsrock/ml_freezone/libraries/ManiaLive/Application/AbstractApplication.php(112): ManiaLive\Event\Dispatcher::dispatch(Object(ManiaLive\Application\Event))
           #7 /home/letsrock/ml_freezone/bootstrapper.php(20): ManiaLive\Application\AbstractApplication->run()
           #8 {main}
Seems like the verification service is down..

Re: [Plugin]FreeZone Plugin

Posted: 31 Jan 2011, 17:49
by farfa
I can assure you that the verification server is up.
So the bug should be on your side. Do you have more details ?

Re: [Plugin]FreeZone Plugin

Posted: 31 Jan 2011, 18:28
by nocturne
Seems it stopped throwing the error after 5 minutes or so... Suppose a period of timing out on either end is certainly possible.

Re: [Plugin]FreeZone Plugin

Posted: 01 Feb 2011, 12:16
by Knutselmaaster
please take "kunt" out of the bad words list.
It means "can" in Dutch and it gets me banned from the chat.
Thank you.

Re: [Plugin]FreeZone Plugin

Posted: 01 Feb 2011, 21:20
by nocturne
Simple math... most swear words are 4 letter words, right? In English at least, this makes 456,976 possible letter combinations, of which only 2746 combinations aren't an actual word (barely 0.6%); and keep in mind that the average word length is 4 letters. This proves the simple fact that you can't try to code in exceptions for players who intentionally misspell curse words.

It also reminds me of years back when first considering what words to add to our server's 'swear list'... Having a group of admins that spoke more languages than I could name, I obviously consulted them. After gathering a list a dozen or so incredibly hateful inflammatory words (far beyond the realms of a normal curse word), I instituted it. Almost instantly, I had dozens of players getting booted for crossing the language filter. Simple words in one language translated into hateful racial slurs in another. Finally, I settled on only two words worth punishing a player over -- one referring to a person of African race, the other referring to a specific part of female anatomy (should be obvious enough). These two words were in no way misunderstood as anything but insulting and inflammatory, not valuable in terms of normal exclamation as with the majority of the provided list with this plugin.

Even then though, with only two words (each with 4 additional 'misspellings' included), players still insist on pushing the limits. If you tell a player they can't say one word, they'll simply figure out one of a thousand different ways to type it out of which you can't predict. Even sitting here keeping a lax eye on my FZ server in RCP, there's always at least one player at every glance that uttered an obvious obscenity which was uncaught by the language filter.

The point I'm trying to make is that it's purely impossible to implement a working language filter. I'd much like to see it simply as an option for non-Nadeo FZ servers, though I'd recommend that Nadeo abandon it for their own servers for their own sake, or at least take an entirely new approach. The simple fact is that moderation cannot be automated, there needs to be an informed human judgement behind any lasting decision. Otherwise you're just punishing players who offended your judgements unwillingly, while encouraging the worst of sorts to find ways to circumvent your efforts.

Re: [Plugin]FreeZone Plugin

Posted: 03 Feb 2011, 13:16
by farfa
A new release of the plugin is available, please update yours.
To download the plugin, it's the same address. We remove the manual chat routing, and by consequences the chat moderation. So now, you have to survey your chat.
We also have try something to fix the customUi conflict between XAseco and ManiaLive, but there is no guaranty it works.
Have fun in the FreeZone

Re: [Plugin]FreeZone Plugin

Posted: 03 Feb 2011, 14:29
by Knutselmaaster
Thanks a lot, that was very welcome.
/me is downloading and installing

Re: [Plugin]FreeZone Plugin

Posted: 03 Feb 2011, 17:03
by aseco
Btw: As nocturne has requested, you can now move the FreeZone button within a specific range on the screen to make it fit to your layout.
Use these configuration values:

Code: Select all

plugins.Freezone\Freezone.buttonAlign = 'left' | 'right'
plugins.Freezone\Freezone.buttonY = 0.7 - 76

Re: [Plugin]FreeZone Plugin

Posted: 05 Feb 2011, 06:16
by nocturne
Totally awesome! :D