コード例 #1
0
 protected function waitBackups()
 {
     if ($this->config->waitingForBackups == 0) {
         $this->cancel();
         return;
     }
     if ($this->countConnectedPlayers(array_keys($this->players)) <= 1) {
         $this->cancel();
         return;
     }
     if ($this->match->team1 && $this->match->team2) {
         if ($this->countConnectedPlayers($this->match->team1) <= $this->config->minPlayersByTeam || $this->countConnectedPlayers($this->match->team2) <= $this->config->minPlayersByTeam) {
             \ManiaLive\Utilities\Logger::debug('Not enough players. Match cancel');
             $this->cancel();
             return;
         }
     }
     \ManiaLive\Utilities\Logger::debug('waitBackups()');
     $this->changeState(self::WAITING_BACKUPS);
     $this->matchMakingService->updateMatchState($this->matchId, Services\Match::WAITING_BACKUPS);
     $this->waitingBackupTime = 0;
 }