From 9d507e3e3568f7844df7bb9f2a937be00e2831cf Mon Sep 17 00:00:00 2001 From: kremsy Date: Thu, 6 Mar 2014 06:36:40 +0100 Subject: [PATCH] playerkick on dc after specforce --- application/core/Players/PlayerActions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/core/Players/PlayerActions.php b/application/core/Players/PlayerActions.php index 0eb3ae96..3652c355 100644 --- a/application/core/Players/PlayerActions.php +++ b/application/core/Players/PlayerActions.php @@ -180,6 +180,10 @@ class PlayerActions { try { $this->maniaControl->client->spectatorReleasePlayerSlot($target->login); } catch(Exception $e) { + if ($e->getMessage() == 'The player is not a spectator') { + $this->kickPlayer($adminLogin, $targetLogin, 'Disconnect'); + $this->maniaControl->errorHandler->triggerDebugNotice("inaktiv spec player kicked " . $e->getMessage()); + } $this->maniaControl->errorHandler->triggerDebugNotice("PlayerActions Debug Line 183: " . $e->getMessage()); // TODO: only possible valid exception should be "wrong login" - throw others (like connection error) //do nothing