From ed250af5464092237f3d3790a4791563569b60e7 Mon Sep 17 00:00:00 2001 From: kremsy Date: Sat, 28 Mar 2020 18:08:05 +0100 Subject: [PATCH] added unkown command to gamemodeexception --- core/Server/Commands.php | 3 +-- libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php | 3 +++ plugins/MCTeam/CustomVotesPlugin.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/Server/Commands.php b/core/Server/Commands.php index 49fe572a..0608b7c8 100644 --- a/core/Server/Commands.php +++ b/core/Server/Commands.php @@ -226,7 +226,7 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer try { $this->maniaControl->getClient()->sendModeScriptCommands(array('Command_ForceWarmUp' => true)); $this->maniaControl->getChat()->sendInformation($player->getEscapedNickname() . ' paused the Game!'); - } catch (GameModeException | FaultException $e) { + } catch (GameModeException $e) { } try { @@ -242,7 +242,6 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer //TODO verify if not everything is replaced through the new pause $this->maniaControl->getModeScriptEventManager()->startPause(); $this->maniaControl->getChat()->sendInformation('$f8fVote to $fffpause the current Game$f8f has been successful!'); - } /** diff --git a/libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php b/libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php index b4fbfdf1..851443fa 100755 --- a/libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php +++ b/libs/Maniaplanet/DedicatedServer/Xmlrpc/FaultException.php @@ -96,6 +96,9 @@ class FaultException extends Exception { case 'No map to export in playlist.': return new FileException($faultString, $faultCode); } + if (preg_match('~^Unknown command \'.*\'\.$~iu', $faultString)) { + return new GameModeException($faultString, $faultCode); + } if (preg_match('~^Unknown setting \'.*\'\.$~iu', $faultString)) { return new GameModeException($faultString, $faultCode); } diff --git a/plugins/MCTeam/CustomVotesPlugin.php b/plugins/MCTeam/CustomVotesPlugin.php index 32af0d4a..ac950ce9 100644 --- a/plugins/MCTeam/CustomVotesPlugin.php +++ b/plugins/MCTeam/CustomVotesPlugin.php @@ -525,7 +525,7 @@ class CustomVotesPlugin implements SidebarMenuEntryListener, CommandListener, Ca //Gamemodes like Elite, Speedball $this->maniaControl->getClient()->sendModeScriptCommands(array('Command_ForceWarmUp' => true)); $this->maniaControl->getChat()->sendInformation('$f8fVote to $fffpause the current Game$f8f has been successful!'); - } catch (GameModeException | FaultException $ex) { + } catch (GameModeException $ex) { } //TODO verify if not everything is replaced through the new pause