Пример #1
0
 protected function changeState($state)
 {
     if ($this->intervals[$state]) {
         if ($this->state != static::PLAYER_LEFT || $this->state != $state) {
             $this->nextTick = new \DateTime($this->intervals[$state]);
         }
         $this->enableTickerEvent();
     } else {
         $this->disableTickerEvent();
     }
     if ($this->state != self::SLEEPING || $this->tick - $this->lastRegisterTick > 12) {
         $this->matchMakingService->registerMatchServer($this->storage->serverLogin, $this->lobby->login, $this->state, $this->scriptName, $this->titleIdString, $this->storage->currentMap->name);
         $this->lastRegisterTick = $this->tick;
     }
     if ($this->state != $state) {
         \ManiaLive\Utilities\Logger::debug(sprintf('State: %d', $state));
     }
     $this->state = $state;
 }