Example #1
0
 protected function updateMatchPlayerState($login, $state)
 {
     if ($state == Services\PlayerInfo::PLAYER_STATE_QUITTER || $state == Services\PlayerInfo::PLAYER_STATE_GIVE_UP) {
         $this->matchMakingService->increasePlayerPenalty($login, $this->config->penaltyForQuitter, $this->lobby->login, $this->scriptName, $this->titleIdString);
     }
     $this->players[$login] = $state;
     $this->matchMakingService->updatePlayerState($login, $this->matchId, $state);
 }
Example #2
0
 protected function cancelReplacement($login, Match $match)
 {
     //If trying to cancel replacement too late, not replacing
     if (array_key_exists($login, $this->replacerCountDown) && $this->replacerCountDown[$login] > 1) {
         \ManiaLive\Utilities\Logger::debug(sprintf('%s cancel replacement at countdown %d', $login, array_key_exists($login, $this->replacerCountDown) ? $this->replacerCountDown[$login] : '-1'));
         $this->matchMakingService->updatePlayerState($login, $match->id, Services\PlayerInfo::PLAYER_STATE_CANCEL);
         //FIXME: it could have been QUITTER or GIVEUP
         $this->matchMakingService->updatePlayerState($this->replacers[$login], $match->id, Services\PlayerInfo::PLAYER_STATE_QUITTER);
         unset($this->replacerCountDown[$login]);
         unset($this->replacers[$login]);
         $this->setPlayerReady($login);
     }
 }