Пример #1
0
 protected function cancel($updateState = true)
 {
     \ManiaLive\Utilities\Logger::debug('cancel()');
     if ($updateState) {
         $this->matchMakingService->updateMatchState($this->matchId, Services\Match::PLAYER_LEFT);
     }
     $this->gui->createLabel($this->gui->getMatchoverText(), null, null, false, false);
     $this->connection->chatSendServerMessageToLanguage($this->dictionary->getChat(array(array('textId' => 'matchAborted', 'params' => array(static::PREFIX)))));
     $this->over();
 }
Пример #2
0
 /**
  * @param string $login If null, set message for all ready players
  */
 protected function setReadyLabel($login = null)
 {
     $matchablePlayers = $this->getMatchablePlayers();
     $players = $login === null ? $matchablePlayers : array($login);
     if ($this->matchMakingService->countAvailableServer($this->storage->serverLogin, $this->scriptName, $this->titleIdString) <= 0) {
         $message = $this->gui->getNoServerAvailableText();
     } else {
         if (count($matchablePlayers) < $this->matchMaker->getPlayersPerMatch()) {
             $message = $this->gui->getNeedReadyPlayersText();
         } else {
             $message = $this->gui->getReadyText();
         }
     }
     foreach ($players as $login) {
         $this->gui->createLabel($message, $login);
         $this->setShortKey($login, array($this, 'onPlayerNotReady'));
     }
 }