From a69d5d0f8430a9f2065e053af086abd685fc8692 Mon Sep 17 00:00:00 2001 From: kremsy Date: Fri, 17 Jan 2014 16:16:12 +0100 Subject: [PATCH] minor thingys --- application/core/Players/PlayerActions.php | 4 +--- application/core/Players/PlayerList.php | 3 +-- application/plugins/Donations.php | 4 ++++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/application/core/Players/PlayerActions.php b/application/core/Players/PlayerActions.php index 61b4c7d6..85d18379 100644 --- a/application/core/Players/PlayerActions.php +++ b/application/core/Players/PlayerActions.php @@ -11,7 +11,6 @@ use ManiaControl\Admin\AuthenticationManager; use ManiaControl\Formatter; use ManiaControl\ManiaControl; use ManiaControl\Manialinks\ManialinkManager; -use Maniaplanet\DedicatedServer\InvalidArgumentException; use Maniaplanet\DedicatedServer\Xmlrpc\Exception; /** @@ -185,9 +184,8 @@ class PlayerActions { // Free player slot try { $this->maniaControl->client->spectatorReleasePlayerSlot($target->login); - } catch(InvalidArgumentException $e) { + } catch(Exception $e) { //TODO error message from $e - $this->maniaControl->chat->sendError('Error occurred: ' . $this->maniaControl->getClientErrorText(), $admin->login); } } } diff --git a/application/core/Players/PlayerList.php b/application/core/Players/PlayerList.php index 421d9c93..232f8fd9 100644 --- a/application/core/Players/PlayerList.php +++ b/application/core/Players/PlayerList.php @@ -22,7 +22,6 @@ use ManiaControl\Formatter; use ManiaControl\ManiaControl; use ManiaControl\Manialinks\ManialinkManager; use ManiaControl\Manialinks\ManialinkPageAnswerListener; -use Maniaplanet\DedicatedServer\InvalidArgumentException; use Maniaplanet\DedicatedServer\Xmlrpc\Exception; /** @@ -596,7 +595,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener { case self::ACTION_SPECTATE_PLAYER: $this->maniaControl->client->forceSpectator($adminLogin, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE); try { - $this->maniaControl->client->forceSpectatorTarget($adminLogin, $targetLogin, 1); //TODO mc crash player is not a spectator + $this->maniaControl->client->forceSpectatorTarget($adminLogin, $targetLogin, 1); } catch(Exception $e) { //TODO error message from $e } diff --git a/application/plugins/Donations.php b/application/plugins/Donations.php index d71320fa..a019e984 100644 --- a/application/plugins/Donations.php +++ b/application/plugins/Donations.php @@ -89,6 +89,10 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin { * @see \ManiaControl\Plugins\Plugin::unload() */ public function unload() { + $emptyManialink = new ManiaLink(self::MLID_DONATE_WIDGET); + $manialinkText = $emptyManialink->render()->saveXML(); + $this->maniaControl->manialinkManager->sendManialink($manialinkText); + $this->maniaControl->callbackManager->unregisterCallbackListener($this); $this->maniaControl->commandManager->unregisterCommandListener($this); unset($this->maniaControl);