예제 #1
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'));
     }
 }