improved message texts

This commit is contained in:
Steffen Schröder 2014-05-09 13:00:04 +02:00
parent 350e82d32b
commit 1e93aafd63
3 changed files with 6 additions and 8 deletions

View File

@ -170,7 +170,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener, Ca
public function command_Warn(array $chatCallback, Player $player) { public function command_Warn(array $chatCallback, Player $player) {
$params = explode(' ', $chatCallback[1][2], 3); $params = explode(' ', $chatCallback[1][2], 3);
if (count($params) <= 1) { if (count($params) <= 1) {
$this->maniaControl->chat->sendUsageInfo("No Login given! Example: '//kick login'", $player->login); $this->maniaControl->chat->sendUsageInfo("No Login given! Example: '//warn login'", $player->login);
return; return;
} }
$targetLogin = $params[1]; $targetLogin = $params[1];

View File

@ -207,7 +207,7 @@ class PlayerDataManager {
if (is_array($param)) { if (is_array($param)) {
return self::TYPE_ARRAY; return self::TYPE_ARRAY;
} }
trigger_error('Unsupported setting type. ' . print_r($param, true)); trigger_error('Unsupported data type. ' . print_r($param, true));
return null; return null;
} }
@ -358,7 +358,7 @@ class PlayerDataManager {
if ($type === self::TYPE_ARRAY) { if ($type === self::TYPE_ARRAY) {
return explode($this->arrayDelimiter, $value); return explode($this->arrayDelimiter, $value);
} }
trigger_error('Unsupported setting type. ' . print_r($type, true)); trigger_error('Unsupported data type. ' . print_r($type, true));
return $value; return $value;
} }
} }

View File

@ -7,6 +7,7 @@ use ManiaControl\ManiaControl;
use ManiaControl\Players\Player; use ManiaControl\Players\Player;
use ManiaControl\Plugins\Plugin; use ManiaControl\Plugins\Plugin;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception; use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
use Maniaplanet\DedicatedServer\Xmlrpc\LoginUnknownException;
/** /**
* ManiaControl Chat-Message Plugin * ManiaControl Chat-Message Plugin
@ -383,11 +384,8 @@ class ChatMessagePlugin implements CommandListener, Plugin {
$message = '$39F Thanks for Playing, please come back soon!$z '; $message = '$39F Thanks for Playing, please come back soon!$z ';
try { try {
$this->maniaControl->client->kick($player->login, $message); $this->maniaControl->client->kick($player->login, $message);
} catch (Exception $e) { } catch (LoginUnknownException $e) {
$this->maniaControl->errorHandler->triggerDebugNotice("ChatMessagePlugin Debug Line " . $e->getLine() . ": " . $e->getMessage()); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player);
// TODO: only possible valid exception should be "wrong login" - throw others (like connection error)
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login);
return;
} }
} }