updated dedicated-server-api exception usages
This commit is contained in:
@ -8,16 +8,16 @@ use FML\Controls\Quad;
|
||||
use FML\Controls\Quads\Quad_Icons64x64_1;
|
||||
use FML\ManiaLink;
|
||||
use ManiaControl\Admin\AuthenticationManager;
|
||||
use ManiaControl\Utils\Formatter;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Manialinks\ManialinkManager;
|
||||
use ManiaControl\Utils\Formatter;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\AlreadyInListException;
|
||||
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;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\PlayerNotIgnoredException;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\NotInListException;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\PlayerStateException;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\UnknownPlayerException;
|
||||
|
||||
/**
|
||||
* Player Actions Class
|
||||
@ -95,7 +95,7 @@ class PlayerActions {
|
||||
|
||||
try {
|
||||
$this->maniaControl->client->forcePlayerTeam($target->login, $teamId);
|
||||
} catch (NotInTeamModeException $e) {
|
||||
} catch (GameModeException $e) {
|
||||
$this->forcePlayerToPlay($adminLogin, $targetLogin);
|
||||
return;
|
||||
}
|
||||
@ -194,7 +194,7 @@ class PlayerActions {
|
||||
// Free player slot
|
||||
try {
|
||||
$this->maniaControl->client->spectatorReleasePlayerSlot($target->login);
|
||||
} catch (PlayerIsNotSpectatorException $e) {
|
||||
} catch (PlayerStateException $e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -220,7 +220,7 @@ class PlayerActions {
|
||||
|
||||
try {
|
||||
$this->maniaControl->client->unIgnore($targetLogin);
|
||||
} catch (PlayerNotIgnoredException $e) {
|
||||
} catch (NotInListException $e) {
|
||||
$this->maniaControl->chat->sendError("Player is not ignored!");
|
||||
return;
|
||||
}
|
||||
@ -252,7 +252,7 @@ class PlayerActions {
|
||||
|
||||
try {
|
||||
$this->maniaControl->client->ignore($targetLogin);
|
||||
} catch (PlayerAlreadyIgnoredException $e) {
|
||||
} catch (AlreadyInListException $e) {
|
||||
$this->maniaControl->chat->sendError("Player already ignored!");
|
||||
return;
|
||||
}
|
||||
@ -369,7 +369,7 @@ class PlayerActions {
|
||||
} else {
|
||||
$this->maniaControl->client->kick($target->login, $message);
|
||||
}
|
||||
} catch (LoginUnknownException $e) {
|
||||
} catch (UnknownPlayerException $e) {
|
||||
$this->maniaControl->chat->sendException($e, $admin->login);
|
||||
return;
|
||||
}
|
||||
|
@ -10,10 +10,10 @@ use FML\Controls\Quad;
|
||||
use FML\Controls\Quads\Quad_BgsPlayerCard;
|
||||
use FML\ManiaLink;
|
||||
use FML\Script\Script;
|
||||
use ManiaControl\Utils\Formatter;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Manialinks\ManialinkManager;
|
||||
use ManiaControl\Statistics\StatisticManager;
|
||||
use ManiaControl\Utils\Formatter;
|
||||
|
||||
/**
|
||||
* Player Detailed Page
|
||||
@ -34,7 +34,7 @@ class PlayerDetailed {
|
||||
private $maniaControl = null;
|
||||
|
||||
/**
|
||||
* Create a new Player Detailed instance
|
||||
* Create a new Player Detailed Instance
|
||||
*
|
||||
* @param ManiaControl $maniaControl
|
||||
*/
|
||||
|
@ -18,12 +18,12 @@ use ManiaControl\Admin\AuthenticationManager;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\TimerListener;
|
||||
use ManiaControl\Utils\Formatter;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Manialinks\ManialinkManager;
|
||||
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\LoginUnknownException;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\PlayerIsNotSpectatorException;
|
||||
use ManiaControl\Utils\Formatter;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\PlayerStateException;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\UnknownPlayerException;
|
||||
use MCTeam\CustomVotesPlugin;
|
||||
|
||||
/**
|
||||
@ -641,7 +641,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
||||
try {
|
||||
$this->maniaControl->client->forceSpectator($adminLogin, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE);
|
||||
$this->maniaControl->client->forceSpectatorTarget($adminLogin, $targetLogin, 1);
|
||||
} catch (PlayerIsNotSpectatorException $e) {
|
||||
} catch (PlayerStateException $e) {
|
||||
}
|
||||
break;
|
||||
case self::ACTION_OPEN_PLAYER_DETAILED:
|
||||
@ -713,7 +713,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
||||
try {
|
||||
$self->maniaControl->client->forceSpectator($target->login, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE);
|
||||
$self->maniaControl->client->spectatorReleasePlayerSlot($target->login);
|
||||
} catch (PlayerIsNotSpectatorException $e) {
|
||||
} catch (PlayerStateException $e) {
|
||||
}
|
||||
});
|
||||
break;
|
||||
@ -737,7 +737,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
||||
$message = '$39F You got kicked due a Public vote!$z ';
|
||||
try {
|
||||
$self->maniaControl->client->kick($target->login, $message);
|
||||
} catch (LoginUnknownException $e) {
|
||||
} catch (UnknownPlayerException $e) {
|
||||
}
|
||||
});
|
||||
break;
|
||||
@ -745,10 +745,10 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the Advanced Player Window
|
||||
* Display the Advanced Player Window
|
||||
*
|
||||
* @param Player $caller
|
||||
* @param $login
|
||||
* @param string $login
|
||||
*/
|
||||
public function advancedPlayerWidget(Player $caller, $login) {
|
||||
// Set status to target player login
|
||||
|
@ -6,10 +6,10 @@ use ManiaControl\Admin\AdminLists;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Callbacks\TimerListener;
|
||||
use ManiaControl\Utils\Formatter;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Statistics\StatisticManager;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\LoginUnknownException;
|
||||
use ManiaControl\Utils\Formatter;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\UnknownPlayerException;
|
||||
|
||||
/**
|
||||
* Class managing Players
|
||||
@ -216,7 +216,7 @@ class PlayerManager implements CallbackListener, TimerListener {
|
||||
$player->setDetailedInfo($playerInfo);
|
||||
|
||||
$this->addPlayer($player);
|
||||
} catch (LoginUnknownException $e) {
|
||||
} catch (UnknownPlayerException $e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user