Пример #1
0
 /**
  * @param TournamentScheduler $event
  */
 public function onTournamentNew(TournamentScheduler $event)
 {
     $this->container->get("logger")->error(__METHOD__);
     try {
         $tournament = $this->container->get("core.handler.tournament")->getRepository()->find($event->getTournamentId());
     } catch (TournamentNotFoundException $e) {
         return;
     }
     if (!in_array($tournament->getGameParams()->getTimeBase(), [180000, 300000])) {
         return;
     }
     $this->container->get('immortalchessnet.service.event.new_tournament_notifier')->notifyAboutNewTournament($tournament);
 }
Пример #2
0
 /**
  * @param TournamentScheduler $event
  */
 public function onTournamentNew(TournamentScheduler $event)
 {
     $this->container->get("logger")->error(__METHOD__);
     $this->container->get("ws.playzone.client.sender")->sendMessageToWebsocketServer((new PlayzoneMessage())->setScope(PlayzoneClientMessageScope::SEND_TO_USERS)->setMethod(PlayzoneClientMessageMethod::NEW_TOURNAMENT)->setData(["tournament_id" => $event->getTournamentId()]));
 }
 public function testOnNewTournament()
 {
     $event = new TournamentScheduler();
     $event->setTournamentId(2151);
     $this->service->onTournamentNew($event);
 }