exception fix
This commit is contained in:
parent
cf12c8af43
commit
2db2c88554
@ -192,8 +192,9 @@ class PlayerActions {
|
|||||||
try {
|
try {
|
||||||
$this->maniaControl->client->spectatorReleasePlayerSlot($target->login);
|
$this->maniaControl->client->spectatorReleasePlayerSlot($target->login);
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
$this->maniaControl->chat->sendException($e, $admin->login);
|
if($e->getMessage() != "The player is not a spectator"){
|
||||||
return;
|
throw $e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -651,7 +651,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
|||||||
$this->maniaControl->client->forceSpectator($adminLogin, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE);
|
$this->maniaControl->client->forceSpectator($adminLogin, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE);
|
||||||
$this->maniaControl->client->forceSpectatorTarget($adminLogin, $targetLogin, 1);
|
$this->maniaControl->client->forceSpectatorTarget($adminLogin, $targetLogin, 1);
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
if($e->getMessage() != "This player is not a spectator."){
|
if($e->getMessage() != "The player is not a spectator"){
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -725,7 +725,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
|
|||||||
$this->maniaControl->client->forceSpectator($target->login, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE);
|
$this->maniaControl->client->forceSpectator($target->login, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE);
|
||||||
$this->maniaControl->client->spectatorReleasePlayerSlot($target->login);
|
$this->maniaControl->client->spectatorReleasePlayerSlot($target->login);
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
if ($e->getMessage() != 'Login unknown.' && $e->getMessage() != 'The player is not a spectator.') {
|
if ($e->getMessage() != 'Login unknown.' && $e->getMessage() != 'The player is not a spectator') {
|
||||||
$this->maniaControl->chat->sendException($e);
|
$this->maniaControl->chat->sendException($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user