queue fixes
This commit is contained in:
parent
d9ba67947a
commit
1d8c9e60e3
@ -3,9 +3,9 @@ use FML\Controls\Frame;
|
||||
use FML\Controls\Labels\Label_Button;
|
||||
use FML\Controls\Labels\Label_Text;
|
||||
use FML\Controls\Quad;
|
||||
|
||||
use FML\Controls\Quads\Quad_Icons64x64_1;
|
||||
use FML\ManiaLink;
|
||||
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Commands\CommandListener;
|
||||
@ -157,9 +157,12 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
|
||||
}
|
||||
|
||||
public function handlePlayerDisconnect(array $callback) {
|
||||
$login = $callback[1]->login;
|
||||
if(isset($this->spectators[$login])) unset($this->spectators[$login]);
|
||||
$this->removePlayerFromQueue($login);
|
||||
/** @var Player $player */
|
||||
$player = $callback[1];
|
||||
if(isset($this->spectators[$player->login])) {
|
||||
unset($this->spectators[$player->login]);
|
||||
}
|
||||
$this->removePlayerFromQueue($player->login);
|
||||
$this->moveFirstPlayerToPlay();
|
||||
}
|
||||
|
||||
@ -201,7 +204,7 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
|
||||
}
|
||||
|
||||
public function handleManiaLinkAnswerRemove(array $chatCallback, Player $player) {
|
||||
$this->removePlayerFromQueue($player);
|
||||
$this->removePlayerFromQueue($player->login);
|
||||
$this->showJoinQueueWidget($player);
|
||||
$this->maniaControl->chat->sendChat('$z$s$090[Queue] $<$fff' . $player->nickname . '$> has left the queue!');
|
||||
}
|
||||
@ -217,7 +220,9 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
|
||||
if($this->maniaControl->client->getMaxPlayers()['CurrentValue'] > count($this->maniaControl->playerManager->players)) {
|
||||
$this->maniaControl->client->forceSpectator($player->login, 2);
|
||||
$this->maniaControl->client->forceSpectator($player->login, 0);
|
||||
if(isset($this->spectators[$player->login])) unset($this->spectators[$player->login]);
|
||||
if(isset($this->spectators[$player->login])) {
|
||||
unset($this->spectators[$player->login]);
|
||||
}
|
||||
$this->removePlayerFromQueue($player->login);
|
||||
$this->showPlayWidget($player);
|
||||
$this->maniaControl->chat->sendChat('$z$s$090[Queue] $<$fff' . $player->nickname . '$> has a free spot and is now playing!');
|
||||
|
Loading…
x
Reference in New Issue
Block a user