diff --git a/application/core/Configurators/ServerSettings.php b/application/core/Configurators/ServerSettings.php index a4663f33..c73bea04 100644 --- a/application/core/Configurators/ServerSettings.php +++ b/application/core/Configurators/ServerSettings.php @@ -15,7 +15,7 @@ use ManiaControl\Callbacks\CallbackListener; use ManiaControl\Callbacks\CallbackManager; use ManiaControl\ManiaControl; use ManiaControl\Players\Player; -use Maniaplanet\DedicatedServer\Xmlrpc\LadderModeUnknownException; +use Maniaplanet\DedicatedServer\Xmlrpc\ServerOptionsException; /** * Class offering a Configurator for Server Settings @@ -330,8 +330,8 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener { try { $this->maniaControl->client->setServerOptions($newSettings); - } catch (LadderModeUnknownException $e) { - $this->maniaControl->chat->sendError("Unknown Ladder-Mode"); + } catch (ServerOptionsException $e) { + $this->maniaControl->chat->sendError($e->getMessage()); return false; } diff --git a/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php b/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php index f151ad91..4264819c 100644 --- a/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php +++ b/application/core/Libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php @@ -13,6 +13,7 @@ class FaultException extends Exception { switch($faultString) { + case 'Login or Uid unknown.': case 'Login unknown.': return new LoginUnknownException($faultString, $faultCode); case 'Unable to write the playlist file.': @@ -38,7 +39,10 @@ class FaultException extends Exception case 'Map not complete.': return new MapNotCompatibleOrCompleteException($faultString, $faultCode); case 'Ladder mode unknown.': - return new LadderModeUnknownException($faultString, $faultCode); + case 'You cannot change the max players count: AllowSpectatorRelays is activated.': + return new ServerOptionsException($faultString, $faultCode); + case 'the next map must be different from the current one.': + return new NextMapException($faultString, $faultCode); } return new self($faultString, $faultCode); @@ -54,6 +58,7 @@ class PlayerIsNotSpectatorException extends FaultException {} class NotInTeamModeException extends FaultException {} class MapNotInCurrentSelectionException extends FaultException{} class MapNotCompatibleOrCompleteException extends FaultException{} -class LadderModeUnknownException extends FaultException{} class PlayerAlreadyIgnoredException extends FaultException{} class PlayerNotIgnoredException extends FaultException{} +class ServerOptionsException extends FaultException{} +class NextMapException extends FaultException{} \ No newline at end of file diff --git a/application/core/Maps/MapList.php b/application/core/Maps/MapList.php index 03f23837..ffa76b70 100644 --- a/application/core/Maps/MapList.php +++ b/application/core/Maps/MapList.php @@ -25,6 +25,7 @@ use ManiaControl\Manialinks\ManialinkManager; use ManiaControl\Manialinks\ManialinkPageAnswerListener; use ManiaControl\Players\Player; use Maniaplanet\DedicatedServer\Xmlrpc\Exception; +use Maniaplanet\DedicatedServer\Xmlrpc\NextMapException; use MCTeam\CustomVotesPlugin; use MCTeam\KarmaPlugin; @@ -633,11 +634,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { try { $index = $self->maniaControl->mapManager->getMapIndex($map); $self->maniaControl->client->jumpToMapIndex($index); - } catch (Exception $e) { - // TODO temp added 19.04.2014 - $self->maniaControl->errorHandler->triggerDebugNotice("Exception line 557 MapList.php" . $e->getMessage()); - - $self->maniaControl->chat->sendError("Error while Switching Map"); + } catch (NextMapException $e) { } }); break; diff --git a/application/core/Players/PlayerActions.php b/application/core/Players/PlayerActions.php index 2d9a7327..9ad76e2e 100644 --- a/application/core/Players/PlayerActions.php +++ b/application/core/Players/PlayerActions.php @@ -13,6 +13,7 @@ use ManiaControl\ManiaControl; use ManiaControl\Manialinks\ManialinkManager; use Maniaplanet\DedicatedServer\Xmlrpc\Exception; use Maniaplanet\DedicatedServer\Xmlrpc\FaultException; +use Maniaplanet\DedicatedServer\Xmlrpc\LoginUnknownException; use Maniaplanet\DedicatedServer\Xmlrpc\NotInTeamModeException; use Maniaplanet\DedicatedServer\Xmlrpc\PlayerAlreadyIgnoredException; use Maniaplanet\DedicatedServer\Xmlrpc\PlayerIsNotSpectatorException; @@ -368,7 +369,7 @@ class PlayerActions { } else { $this->maniaControl->client->kick($target->login, $message); } - } catch (Exception $e) { + } catch (LoginUnknownException $e) { $this->maniaControl->chat->sendException($e, $admin->login); return; } diff --git a/application/plugins/ChatMessagePlugin.php b/application/plugins/ChatMessagePlugin.php deleted file mode 100644 index d1afbc93..00000000 --- a/application/plugins/ChatMessagePlugin.php +++ /dev/null @@ -1 +0,0 @@ -