public function onManiaplanetGameBeginMap(DedicatedEvent $event)
    {
        $serverOptions = $this->factory->getConnection()->getServerOptions();
        $this->gameDataStorage->setScriptOptions($this->factory->getConnection()->getModeScriptSettings());
        $this->gameDataStorage->setServerOptions($serverOptions);
        $this->gameDataStorage->setSystemInfo($this->factory->getConnection()->getSystemInfo());

        $newGameInfos = $this->factory->getConnection()->getCurrentGameInfo();
        $prevousGameInfos = $this->gameDataStorage->getGameInfos();

        // TODO move this logic somewhere else.
        $this->dispatcher->reset($this->mapStorage->getMap($event->getParameters()[0]['UId']));

        if ($prevousGameInfos->gameMode != $newGameInfos->gameMode || $prevousGameInfos->scriptName != $newGameInfos->scriptName) {
            $this->gameDataStorage->setGameInfos(clone $newGameInfos);
            // TODO dispatch custom event to let it know?
        }
    }
public function onManiaplanetGameBeginMap(DedicatedEvent $event)
    {
        $serverOptions = $this->factory->getConnection()->getServerOptions();
        $this->gameDataStorage->setScriptOptions($this->factory->getConnection()->getModeScriptSettings());
        $this->gameDataStorage->setServerOptions($serverOptions);
        $this->gameDataStorage->setSystemInfo($this->factory->getConnection()->getSystemInfo());

        $newGameInfos = $this->factory->getConnection()->getCurrentGameInfo();
        $prevousGameInfos = $this->gameDataStorage->getGameInfos();

        // TODO move this logic somewhere else.
        $this->dispatcher->reset($this->mapStorage->getMap($event->getParameters()[0]['UId']));

        if ($prevousGameInfos->gameMode != $newGameInfos->gameMode || $prevousGameInfos->scriptName != $newGameInfos->scriptName) {
            $this->gameDataStorage->setGameInfos(clone $newGameInfos);
            // TODO dispatch custom event to let it know?
        }
    }
public function onManiaplanetGameBeginMap ( DedicatedEvent $ event ) { $ serverOptions = $ this -> factory -> getConnection ( ) -> getServerOptions ( ) ; $ this -> gameDataStorage -> setScriptOptions ( $ this -> factory -> getConnection ( ) -> getModeScriptSettings ( ) ) ; $ this -> gameDataStorage -> setServerOptions ( $ serverOptions ) ; $ this -> gameDataStorage -> setSystemInfo ( $ this -> factory -> getConnection ( ) -> getSystemInfo ( ) ) ; $ newGameInfos = $ this -> factory -> getConnection ( ) -> getCurrentGameInfo ( ) ; $ prevousGameInfos = $ this -> gameDataStorage -> getGameInfos ( ) ; // TODO move this logic somewhere else. $ this -> dispatcher -> reset ( $ this -> mapStorage -> getMap ( $ event -> getParameters ( ) [ 0 ] [ 'UId' ] ) ) ; if ( $ prevousGameInfos -> gameMode != $ newGameInfos -> gameMode || $ prevousGameInfos -> scriptName != $ newGameInfos -> scriptName ) { $ this -> gameDataStorage -> setGameInfos ( clone $ newGameInfos ) ; // TODO dispatch custom event to let it know? } }
Called on the begining of a new map.

@param DedicatedEvent $event
Called on the begining of a new map .