fix crash when no spec slot available
This commit is contained in:
parent
ddc2ec7725
commit
1532b6e04a
@ -22,7 +22,7 @@ class OpenplanetDetector implements ManialinkPageAnswerListener, CallbackListene
|
|||||||
* Constants
|
* Constants
|
||||||
*/
|
*/
|
||||||
const PLUGIN_ID = 203;
|
const PLUGIN_ID = 203;
|
||||||
const PLUGIN_VERSION = 1.0;
|
const PLUGIN_VERSION = 1.1;
|
||||||
const PLUGIN_NAME = 'Openplanet Detector';
|
const PLUGIN_NAME = 'Openplanet Detector';
|
||||||
const PLUGIN_AUTHOR = 'Beu';
|
const PLUGIN_AUTHOR = 'Beu';
|
||||||
|
|
||||||
@ -136,14 +136,19 @@ class OpenplanetDetector implements ManialinkPageAnswerListener, CallbackListene
|
|||||||
$this->maniaControl->getChat()->sendInformationToAdmins("Player ". $player->nickname ." has the wrong Openplanet Signature: " . $signature);
|
$this->maniaControl->getChat()->sendInformationToAdmins("Player ". $player->nickname ." has the wrong Openplanet Signature: " . $signature);
|
||||||
Logger::log("Player ". $player->nickname ." has the wrong Openplanet Signature: " . $signature);
|
Logger::log("Player ". $player->nickname ." has the wrong Openplanet Signature: " . $signature);
|
||||||
|
|
||||||
switch ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_ACTION)) {
|
try {
|
||||||
case self::ACTION_FORCE_AS_SPEC:
|
switch ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_ACTION)) {
|
||||||
$this->maniaControl->getClient()->forceSpectator($player->login, 1);
|
case self::ACTION_FORCE_AS_SPEC:
|
||||||
$this->maniaControl->getChat()->sendInformation("Your Openplanet signature is not allowed. Change it and try to re-join the server", $player->login);
|
$this->maniaControl->getClient()->forceSpectator($player->login, 1);
|
||||||
break;
|
$this->maniaControl->getChat()->sendInformation("Your Openplanet signature is not allowed. Change it and try to re-join the server", $player->login);
|
||||||
case self::ACTION_KICK:
|
break;
|
||||||
$this->maniaControl->getClient()->kick($player->login, "Your Openplanet signature is not allowed. Change it and try to re-join the server");
|
case self::ACTION_KICK:
|
||||||
break;
|
$this->maniaControl->getClient()->kick($player->login, "Your Openplanet signature is not allowed. Change it and try to re-join the server");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
$this->maniaControl->getChat()->sendErrorToAdmins("Can't apply action on ". $player->nickname .": " . $th->getMessage());
|
||||||
|
Logger::logError("Can't apply action on ". $player->nickname .": " . $th->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user