minor thingys

This commit is contained in:
kremsy 2014-01-17 16:16:12 +01:00 committed by Steffen Schröder
parent 90124a4c9a
commit a69d5d0f84
3 changed files with 6 additions and 5 deletions

View File

@ -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);
}
}
}

View File

@ -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
}

View File

@ -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);