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}
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');
}
}
}
}