protected function __construct() { $this->modalBg = new Bgs1(340, 200); $this->modalBg->setSubStyle(Bgs1::BgDialogBlur); $this->modalBg->setAlign('center', 'center'); $this->modalBg->setPosZ(Window::Z_MODAL); $this->modalBg->setScriptEvents(); $this->nextLoop = microtime(true); Dispatcher::register(AppEvent::getClass(), $this, AppEvent::ALL & ~AppEvent::ON_POST_LOOP); Dispatcher::register(PlayerEvent::getClass(), $this, PlayerEvent::ON_PLAYER_CHANGE_SIDE); Dispatcher::register(ServerEvent::getClass(), $this, ServerEvent::ON_PLAYER_CONNECT | ServerEvent::ON_PLAYER_DISCONNECT); $config = \ManiaLive\DedicatedApi\Config::getInstance(); $this->connection = Connection::factory($config->host, $config->port, $config->timeout, $config->user, $config->password); }
/** * Stop listening for Storage Events. */ protected final function disableStorageEvents($events = PlayerEvent::ALL) { $this->restrictIfUnloaded(); Dispatcher::unregister(PlayerEvent::getClass(), $this, $events & $this->eventsStorage); $this->eventsStorage &= ~$events; }