コード例 #1
0
 public function onRun($currentTick)
 {
     $this->arena->setInUse(true);
     $playersOnline = true;
     foreach ($this->arena->players as $player) {
         if (!$this->arena->isOnline($player)) {
             $playersOnline = false;
         }
     }
     if ($playersOnline && $this->countdownVal >= 0) {
         $this->arena->broadcastTip("Match starts in: " . $this->countdownVal);
         $this->arena->inUse = false;
         $this->countdownVal--;
     } else {
         if (!$playersOnline) {
             $this->arena->abortMatch();
         }
     }
     if ($this->countdownVal <= 0) {
         $this->arena->inUse = true;
         $this->arena->onStartCountdownEnd();
         $this->arena->broadcastTip("GO!");
     }
 }