protected function __construct() { $this->identifier = 'ManiaLive ' . \ManiaLiveApplication\Version; $config = Config::getInstance(); $this->connection = Connection::factory($config->host, $config->port, $config->timeout, $config->user, $config->password); Dispatcher::register(Event::getClass(), $this, Event::ON_ECHO); }
protected function __construct() { Dispatcher::register(ServerEvent::getClass(), $this, ServerEvent::ON_PLAYER_CHAT); $command = new Command('help', 0); $command->addLoginAsFirstParameter = true; $command->log = false; $command->help = 'Display all visible commands to a player it takes no parameter'; $command->callback = array($this, 'help'); $this->register($command); $command = new Command('man', 1); $command->addLoginAsFirstParameter = true; $command->help = 'Display help for every commands you give as parameter' . "\n" . 'exemple of usage: /man man'; $command->isPublic = true; $command->log = false; $command->callback = array($this, 'man'); $this->register($command); $command = new Command('man', 2); $command->addLoginAsFirstParameter = true; $command->help = 'Display help for the command with the corresponding parameters' . "\n" . 'exemple of usage: /man man 2'; $command->isPublic = true; $command->log = false; $command->callback = array($this, 'man'); $this->register($command); $config = \ManiaLive\DedicatedApi\Config::getInstance(); $this->connection = Connection::factory($config->host, $config->port, $config->timeout, $config->user, $config->password); }
protected function __construct($lobbyLogin, $scriptName, $titleIdString) { $config = \ManiaLive\Database\Config::getInstance(); $this->db = Connection::getConnection($config->host, $config->username, $config->password, $config->database, $config->type, $config->port); Dispatcher::register(Event::getClass(), $this, Event::ON_PLAYER_ALLIES_CHANGED | Event::ON_PLAYER_CONNECT | Event::ON_PLAYER_DISCONNECT); $this->lobbyLogin = $lobbyLogin; $this->scriptName = $scriptName; $this->titleIdString = $titleIdString; $this->createTable(); }
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); }
protected function __construct() { Dispatcher::register(AppEvent::getClass(), $this, AppEvent::ON_INIT | AppEvent::ON_POST_LOOP); Dispatcher::register(ServerEvent::getClass(), $this, ServerEvent::ALL); }
protected function __construct() { Dispatcher::register(ServerEvent::getClass(), $this, ServerEvent::ON_PLAYER_MANIALINK_PAGE_ANSWER); }
protected function __construct() { Dispatcher::register(AppEvent::getClass(), $this, AppEvent::ON_INIT | AppEvent::ON_TERMINATE); Dispatcher::register(ServerEvent::getClass(), $this, ServerEvent::ON_SERVER_START | ServerEvent::ON_SERVER_STOP); }
/** * Stop listening for dedicated server events. */ protected final function disableDedicatedEvents($events = ServerEvent::ALL) { $this->restrictIfUnloaded(); Dispatcher::unregister(ServerEvent::getClass(), $this, $events & $this->eventsServer); $this->eventsServer &= ~$events; }