changed all client Exceptions from Exception to \Exception

This commit is contained in:
kremsy 2014-01-31 16:11:14 +01:00 committed by Steffen Schröder
parent 34db6ea31b
commit f825c0c111
12 changed files with 74 additions and 86 deletions

View File

@ -3,7 +3,6 @@
namespace ManiaControl\Callbacks; namespace ManiaControl\Callbacks;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
/** /**
* Class for managing Server and ManiaControl Callbacks * Class for managing Server and ManiaControl Callbacks
@ -193,7 +192,7 @@ class CallbackManager {
try { try {
$callbacks = $this->maniaControl->client->executeCallbacks(); $callbacks = $this->maniaControl->client->executeCallbacks();
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Error reading server callbacks. " . $e->getMessage()); trigger_error("Error reading server callbacks. " . $e->getMessage());
return; return;
} }

View File

@ -13,7 +13,6 @@ use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager; use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use ManiaControl\Players\Player; use ManiaControl\Players\Player;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
/** /**
* Class offering a Configurator for Script Settings * Class offering a Configurator for Script Settings
@ -126,7 +125,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
try { try {
$this->maniaControl->client->setModeScriptSettings($loadedSettings); $this->maniaControl->client->setModeScriptSettings($loadedSettings);
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error('Error occured: ' . $e->getMessage()); trigger_error('Error occured: ' . $e->getMessage());
return false; return false;
} }
@ -379,7 +378,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
try { try {
$success = $this->maniaControl->client->setModeScriptSettings($newSettings); $success = $this->maniaControl->client->setModeScriptSettings($newSettings);
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login);
return false; return false;
} }

View File

@ -13,7 +13,7 @@ use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager; use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use ManiaControl\Players\Player; use ManiaControl\Players\Player;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
/** /**
* Class offering a Configurator for Server Settings * Class offering a Configurator for Server Settings
@ -115,7 +115,7 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
try { try {
$this->maniaControl->client->setServerOptions($serverSettings); $this->maniaControl->client->setServerOptions($serverSettings);
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error('Error occured: ' . $e->getMessage()); trigger_error('Error occured: ' . $e->getMessage());
return false; return false;
} }
@ -332,7 +332,7 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
try { try {
$this->maniaControl->client->setServerOptions($newSettings); $this->maniaControl->client->setServerOptions($newSettings);
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error('Error occured: ' . $e->getMessage()); trigger_error('Error occured: ' . $e->getMessage());
return false; return false;
} }

View File

@ -19,7 +19,6 @@ use ManiaControl\Server\Server;
use ManiaControl\Settings\SettingManager; use ManiaControl\Settings\SettingManager;
use ManiaControl\Statistics\StatisticManager; use ManiaControl\Statistics\StatisticManager;
use Maniaplanet\DedicatedServer\Connection; use Maniaplanet\DedicatedServer\Connection;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
require_once __DIR__ . '/Maniaplanet/DedicatedServer/Connection.php'; require_once __DIR__ . '/Maniaplanet/DedicatedServer/Connection.php';
require_once __DIR__ . '/GbxDataFetcher/gbxdatafetcher.inc.php'; require_once __DIR__ . '/GbxDataFetcher/gbxdatafetcher.inc.php';
@ -322,14 +321,14 @@ class ManiaControl implements CommandListener {
try { try {
$this->client = Connection::factory($host, $port, self::CONNECT_TIMEOUT, $login, $pass); $this->client = Connection::factory($host, $port, self::CONNECT_TIMEOUT, $login, $pass);
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't authenticate on server with user '{$login}'! " . $e->getMessage(), E_USER_ERROR); trigger_error("Couldn't authenticate on server with user '{$login}'! " . $e->getMessage(), E_USER_ERROR);
} }
// Enable callback system // Enable callback system
try { try {
$this->client->enableCallbacks(true); $this->client->enableCallbacks(true);
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't enable callbacks! " . $e->getMessage(), E_USER_ERROR); trigger_error("Couldn't enable callbacks! " . $e->getMessage(), E_USER_ERROR);
} }
@ -357,7 +356,7 @@ class ManiaControl implements CommandListener {
try { try {
$scriptSettings = $this->client->getModeScriptSettings(); $scriptSettings = $this->client->getModeScriptSettings();
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't get mode script settings. " . $e->getMessage()); trigger_error("Couldn't get mode script settings. " . $e->getMessage());
return; return;
} }
@ -369,7 +368,7 @@ class ManiaControl implements CommandListener {
$scriptSettings['S_UseScriptCallbacks'] = true; $scriptSettings['S_UseScriptCallbacks'] = true;
try { try {
$this->client->setModeScriptSettings($scriptSettings); $this->client->setModeScriptSettings($scriptSettings);
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't set mode script settings to enable script callbacks. " . $e->getMessage()); trigger_error("Couldn't set mode script settings to enable script callbacks. " . $e->getMessage());
return; return;
} }

View File

@ -10,7 +10,6 @@ use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager; use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use ManiaControl\Players\Player; use ManiaControl\Players\Player;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
/** /**
* Manialink manager class * Manialink manager class
@ -149,7 +148,7 @@ class ManialinkManager implements ManialinkPageAnswerListener, CallbackListener
return $success; return $success;
} }
} catch(Exception $e) { } catch(\Exception $e) {
return false; return false;
} }

View File

@ -11,7 +11,6 @@ use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Formatter; use ManiaControl\Formatter;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkManager; use ManiaControl\Manialinks\ManialinkManager;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
/** /**
* PlayerActions Class * PlayerActions Class
@ -86,7 +85,7 @@ class PlayerActions {
try { try {
$this->maniaControl->client->forceSpectator($target->login, self::SPECTATOR_PLAYER); $this->maniaControl->client->forceSpectator($target->login, self::SPECTATOR_PLAYER);
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $admin->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $admin->login);
return; return;
} }
@ -94,7 +93,7 @@ class PlayerActions {
if($userIsAbleToSelect) { if($userIsAbleToSelect) {
try { try {
$this->maniaControl->client->forceSpectator($target->login, self::SPECTATOR_USER_SELECTABLE); $this->maniaControl->client->forceSpectator($target->login, self::SPECTATOR_USER_SELECTABLE);
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $admin->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $admin->login);
return; return;
} }
@ -131,7 +130,7 @@ class PlayerActions {
try { try {
$this->maniaControl->client->forcePlayerTeam($target->login, $teamId); $this->maniaControl->client->forcePlayerTeam($target->login, $teamId);
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $admin->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $admin->login);
return; return;
} }
@ -168,7 +167,7 @@ class PlayerActions {
try { try {
$this->maniaControl->client->forceSpectator($target->login, $spectatorState); $this->maniaControl->client->forceSpectator($target->login, $spectatorState);
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $admin->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $admin->login);
return; return;
} }
@ -182,7 +181,7 @@ class PlayerActions {
// Free player slot // Free player slot
try { try {
$this->maniaControl->client->spectatorReleasePlayerSlot($target->login); $this->maniaControl->client->spectatorReleasePlayerSlot($target->login);
} catch(Exception $e) { } catch(\Exception $e) {
//do nothing //do nothing
} }
} }
@ -206,7 +205,7 @@ class PlayerActions {
try { try {
$this->maniaControl->client->unIgnore($targetLogin); $this->maniaControl->client->unIgnore($targetLogin);
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $adminLogin); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $adminLogin);
return; return;
} }
@ -235,7 +234,7 @@ class PlayerActions {
try { try {
$this->maniaControl->client->ignore($targetLogin); $this->maniaControl->client->ignore($targetLogin);
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $admin->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $admin->login);
return; return;
} }
@ -350,7 +349,7 @@ class PlayerActions {
} else { } else {
$this->maniaControl->client->kick($target->login, $message); $this->maniaControl->client->kick($target->login, $message);
} }
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $admin->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $admin->login);
return; return;
} }
@ -387,7 +386,7 @@ class PlayerActions {
try { try {
$this->maniaControl->client->ban($target->login, $message); $this->maniaControl->client->ban($target->login, $message);
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $admin->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $admin->login);
return; return;
} }

View File

@ -8,7 +8,6 @@ use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Commands\CommandListener; use ManiaControl\Commands\CommandListener;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkPageAnswerListener; use ManiaControl\Manialinks\ManialinkPageAnswerListener;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
/** /**
* Class offering various Admin Commands related to Players * Class offering various Admin Commands related to Players
@ -86,7 +85,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener {
try { try {
$this->maniaControl->client->autoTeamBalance(); $this->maniaControl->client->autoTeamBalance();
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login);
return; return;
} }
@ -252,7 +251,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener {
for($i = 0; $i < $amount; $i++) { for($i = 0; $i < $amount; $i++) {
$this->maniaControl->client->connectFakePlayer(); $this->maniaControl->client->connectFakePlayer();
} }
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login);
return; return;
} }
@ -274,7 +273,7 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener {
try { try {
$this->maniaControl->client->disconnectFakePlayer('*'); $this->maniaControl->client->disconnectFakePlayer('*');
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login);
return; return;
} }

View File

@ -7,7 +7,6 @@ use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use ManiaControl\Players\Player; use ManiaControl\Players\Player;
use Maniaplanet\DedicatedServer\Structures\SystemInfos; use Maniaplanet\DedicatedServer\Structures\SystemInfos;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
/** /**
* Class providing Information about theconnected ManiaPlanet Server * Class providing Information about theconnected ManiaPlanet Server
@ -136,7 +135,7 @@ class Server implements CallbackListener {
if ($this->dataDirectory == '') { if ($this->dataDirectory == '') {
try { try {
$this->dataDirectory = $this->maniaControl->client->gameDataDirectory(); $this->dataDirectory = $this->maniaControl->client->gameDataDirectory();
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't get data directory. " . $e->getMessage()); trigger_error("Couldn't get data directory. " . $e->getMessage());
return null; return null;
} }
@ -181,7 +180,7 @@ class Server implements CallbackListener {
$login = $this->login; $login = $this->login;
try { try {
$info = $this->maniaControl->client->getDetailedPlayerInfo($login); $info = $this->maniaControl->client->getDetailedPlayerInfo($login);
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't fetch detailed server info. " . $e->getMessage()); trigger_error("Couldn't fetch detailed server info. " . $e->getMessage());
return null; return null;
} }
@ -189,7 +188,7 @@ class Server implements CallbackListener {
} }
try { try {
$info = $this->maniaControl->client->getMainServerPlayerInfo(); $info = $this->maniaControl->client->getMainServerPlayerInfo();
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't fetch server info. " . $e->getMessage()); trigger_error("Couldn't fetch server info. " . $e->getMessage());
return null; return null;
} }
@ -204,7 +203,7 @@ class Server implements CallbackListener {
public function getOptions() { public function getOptions() {
try { try {
$options = $this->maniaControl->client->getServerOptions(); $options = $this->maniaControl->client->getServerOptions();
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't fetch server options. " . $e->getMessage()); trigger_error("Couldn't fetch server options. " . $e->getMessage());
return null; return null;
} }
@ -220,7 +219,7 @@ class Server implements CallbackListener {
public function getName() { public function getName() {
try { try {
$name = $this->maniaControl->client->getServerName(); $name = $this->maniaControl->client->getServerName();
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't fetch server name. " . $e->getMessage()); trigger_error("Couldn't fetch server name. " . $e->getMessage());
return null; return null;
} }
@ -236,7 +235,7 @@ class Server implements CallbackListener {
public function getVersion() { public function getVersion() {
try { try {
$version = $this->maniaControl->client->getVersion(); $version = $this->maniaControl->client->getVersion();
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't fetch server version. " . $e->getMessage()); trigger_error("Couldn't fetch server version. " . $e->getMessage());
return null; return null;
} }
@ -251,7 +250,7 @@ class Server implements CallbackListener {
public function getSystemInfo() { public function getSystemInfo() {
try { try {
$systemInfo = $this->maniaControl->client->getSystemInfo(); $systemInfo = $this->maniaControl->client->getSystemInfo();
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't fetch server system info. " . $e->getMessage()); trigger_error("Couldn't fetch server system info. " . $e->getMessage());
return null; return null;
} }
@ -272,7 +271,7 @@ class Server implements CallbackListener {
} else { } else {
try { try {
$gameMode = $this->maniaControl->client->getGameMode(); $gameMode = $this->maniaControl->client->getGameMode();
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't fetch current game mode. " . $e->getMessage()); trigger_error("Couldn't fetch current game mode. " . $e->getMessage());
return null; return null;
} }
@ -309,7 +308,7 @@ class Server implements CallbackListener {
public function getValidationReplay(Player $player) { public function getValidationReplay(Player $player) {
try { try {
$replay = $this->maniaControl->client->getValidationReplay($player->login); $replay = $this->maniaControl->client->getValidationReplay($player->login);
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't get validation replay of '{$player->login}'. " . $e->getMessage()); trigger_error("Couldn't get validation replay of '{$player->login}'. " . $e->getMessage());
return null; return null;
} }
@ -337,7 +336,7 @@ class Server implements CallbackListener {
// Save ghost replay // Save ghost replay
try { try {
$this->maniaControl->client->saveBestGhostsReplay($player->login, $fileName); $this->maniaControl->client->saveBestGhostsReplay($player->login, $fileName);
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't save ghost replay. " . $e->getMessage()); trigger_error("Couldn't save ghost replay. " . $e->getMessage());
return null; return null;
} }

View File

@ -12,7 +12,6 @@ use ManiaControl\Commands\CommandListener;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkPageAnswerListener; use ManiaControl\Manialinks\ManialinkPageAnswerListener;
use ManiaControl\Players\Player; use ManiaControl\Players\Player;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
/** /**
* Class offering various commands related to the dedicated server * Class offering various commands related to the dedicated server
@ -220,7 +219,7 @@ class ServerCommands implements CallbackListener, CommandListener, ManialinkPage
$serverName = $params[1]; $serverName = $params[1];
try { try {
$this->maniaControl->client->setServerName($serverName); $this->maniaControl->client->setServerName($serverName);
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login);
return; return;
} }
@ -247,7 +246,7 @@ class ServerCommands implements CallbackListener, CommandListener, ManialinkPage
} }
try { try {
$this->maniaControl->client->setServerPassword($password); $this->maniaControl->client->setServerPassword($password);
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login);
return; return;
} }
@ -274,7 +273,7 @@ class ServerCommands implements CallbackListener, CommandListener, ManialinkPage
} }
try { try {
$this->maniaControl->client->setServerPasswordForSpectator($password); $this->maniaControl->client->setServerPasswordForSpectator($password);
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login);
return; return;
} }
@ -309,7 +308,7 @@ class ServerCommands implements CallbackListener, CommandListener, ManialinkPage
try { try {
$this->maniaControl->client->setMaxPlayers($amount); $this->maniaControl->client->setMaxPlayers($amount);
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login);
return; return;
} }
@ -345,7 +344,7 @@ class ServerCommands implements CallbackListener, CommandListener, ManialinkPage
try { try {
$this->maniaControl->client->setMaxSpectators($amount); $this->maniaControl->client->setMaxSpectators($amount);
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login);
return; return;
} }
@ -361,7 +360,7 @@ class ServerCommands implements CallbackListener, CommandListener, ManialinkPage
private function shutdownServer($login = '#') { private function shutdownServer($login = '#') {
try { try {
$this->maniaControl->client->stopServer(); $this->maniaControl->client->stopServer();
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Server shutdown command from '{login}' failed. " . $e->getMessage()); trigger_error("Server shutdown command from '{login}' failed. " . $e->getMessage());
return false; return false;
} }

View File

@ -4,7 +4,6 @@ use ManiaControl\Commands\CommandListener;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use ManiaControl\Players\Player; use ManiaControl\Players\Player;
use ManiaControl\Plugins\Plugin; use ManiaControl\Plugins\Plugin;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
/** /**
* ManiaControl Chat-Message Plugin * ManiaControl Chat-Message Plugin
@ -25,7 +24,6 @@ class ChatMessagePlugin implements CommandListener, Plugin {
* Private properties * Private properties
*/ */
/** /**
*
* @var maniaControl $maniaControl * @var maniaControl $maniaControl
*/ */
private $maniaControl = null; private $maniaControl = null;
@ -313,7 +311,7 @@ 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(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login);
return; return;
} }
@ -332,7 +330,7 @@ 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(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login);
return; return;
} }
@ -352,7 +350,7 @@ class ChatMessagePlugin implements CommandListener, Plugin {
// force into spec // force into spec
try { try {
$this->maniaControl->client->forceSpectator($player->login, 3); $this->maniaControl->client->forceSpectator($player->login, 3);
} catch(Exception $e) { } catch(\Exception $e) {
$this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login); $this->maniaControl->chat->sendError('Error occurred: ' . $e->getMessage(), $player->login);
return; return;
} }
@ -360,7 +358,7 @@ class ChatMessagePlugin implements CommandListener, Plugin {
// free player slot // free player slot
try { try {
$this->maniaControl->client->spectatorReleasePlayerSlot($player->login); $this->maniaControl->client->spectatorReleasePlayerSlot($player->login);
} catch(Exception $e) { } catch(\Exception $e) {
//to nothing //to nothing
} }
} }

View File

@ -16,7 +16,6 @@ use ManiaControl\ManiaControl;
use ManiaControl\Players\Player; use ManiaControl\Players\Player;
use ManiaControl\Players\PlayerManager; use ManiaControl\Players\PlayerManager;
use ManiaControl\Plugins\Plugin; use ManiaControl\Plugins\Plugin;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
/** /**
* Donation plugin * Donation plugin
@ -336,7 +335,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
$message = 'Donate ' . $amount . ' Planets to $<' . $receiverName . '$>?'; $message = 'Donate ' . $amount . ' Planets to $<' . $receiverName . '$>?';
try { try {
$bill = $this->maniaControl->client->sendBill($player->login, $amount, $message, $receiver); $bill = $this->maniaControl->client->sendBill($player->login, $amount, $message, $receiver);
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't create donation of {$amount} planets from '{$player->login}' for '{$receiver}'. " . $e->getMessage()); trigger_error("Couldn't create donation of {$amount} planets from '{$player->login}' for '{$receiver}'. " . $e->getMessage());
$this->maniaControl->chat->sendError("Creating donation failed.", $player->login); $this->maniaControl->chat->sendError("Creating donation failed.", $player->login);
return false; return false;
@ -379,7 +378,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
try { try {
$bill = $this->maniaControl->client->pay($receiver, $amount, $message); $bill = $this->maniaControl->client->pay($receiver, $amount, $message);
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't retrieve server planets. " . $e->getMessage()); trigger_error("Couldn't retrieve server planets. " . $e->getMessage());
trigger_error("Couldn't create payout of {$amount} planets by '{$player->login}' for '{$receiver}'. " . $e->getMessage()); trigger_error("Couldn't create payout of {$amount} planets by '{$player->login}' for '{$receiver}'. " . $e->getMessage());
$this->maniaControl->chat->sendError("Creating payout failed.", $player->login); $this->maniaControl->chat->sendError("Creating payout failed.", $player->login);
@ -404,7 +403,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
} }
try { try {
$planets = $this->maniaControl->client->getServerPlanets(); $planets = $this->maniaControl->client->getServerPlanets();
} catch(Exception $e) { } catch(\Exception $e) {
trigger_error("Couldn't retrieve server planets. " . $e->getMessage()); trigger_error("Couldn't retrieve server planets. " . $e->getMessage());
return false; return false;
} }

View File

@ -15,7 +15,6 @@ use ManiaControl\Manialinks\ManialinkPageAnswerListener;
use ManiaControl\Players\Player; use ManiaControl\Players\Player;
use ManiaControl\Players\PlayerManager; use ManiaControl\Players\PlayerManager;
use ManiaControl\Plugins\Plugin; use ManiaControl\Plugins\Plugin;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
class SlotMachinePlugin implements Plugin, CallbackListener, ManialinkPageAnswerListener, TimerListener { class SlotMachinePlugin implements Plugin, CallbackListener, ManialinkPageAnswerListener, TimerListener {
/** /**
@ -468,7 +467,7 @@ class SlotMachinePlugin implements Plugin, CallbackListener, ManialinkPageAnswer
try { try {
$billId = $this->maniaControl->client->pay($player->login, (int)$balance, $message); $billId = $this->maniaControl->client->pay($player->login, (int)$balance, $message);
} catch(Exception $e) { } catch(\Exception $e) {
return; return;
} }