private function newMatch($match_id, $ip, $rcon, $authkey) { if (@$this->busyServers[$ip]) { if (time() > $this->busyServers[$ip]) { unset($this->busyServers[$ip]); } } if (!@$this->busyServers[$ip]) { if (!@$this->matchs[$ip]) { $this->matchs[$ip] = new Match($match_id, $ip, $rcon); $this->authkeys[$ip] = $authkey; } else { $socket = \eBot\Application\ApplicationClient::getInstance()->getSocket(); $socket->sendTo("removeMatch " . $match_id, \eBot\Config\Config::getInstance()->getBot_ip(), \eBot\Application\ApplicationClient::getInstance()->getPortMain()); throw new \Exception("MATCH_ALREADY_PLAY_ON_THIS_SERVER"); } } else { $socket = \eBot\Application\ApplicationClient::getInstance()->getSocket(); $socket->sendTo("removeMatch " . $match_id, \eBot\Config\Config::getInstance()->getBot_ip(), \eBot\Application\ApplicationClient::getInstance()->getPortMain()); throw new \Exception("SERVER_BUSY"); } }
exit; } // better checking if timezone is set if (!ini_get('date.timezone')) { $timezone = @date_default_timezone_get(); echo '| Timezone is not set in php.ini. Please edit it and change/set "date.timezone" appropriately. ' . 'Setting to default: \'' . $timezone . '\'' . PHP_EOL; echo '-----------------------------------------------------' . PHP_EOL; date_default_timezone_set($timezone); } // enable error reporting ini_set('display_errors', 1); error_reporting(E_ALL); gc_enable(); function handleShutdown() { global $webSocketProcess; if (PHP_OS == "Linux") { proc_terminate($webSocketProcess, 9); } $error = error_get_last(); if (!empty($error)) { $info = "[SHUTDOWN] date: " . date("d.m.y H:m", time()) . " file: " . $error['file'] . " | ln: " . $error['line'] . " | msg: " . $error['message'] . PHP_EOL; file_put_contents(APP_ROOT . 'logs' . DIRECTORY_SEPARATOR . 'error.log', $info, FILE_APPEND); } } echo "| Registerung Shutdown function !" . PHP_EOL; register_shutdown_function('handleShutdown'); echo '-----------------------------------------------------' . PHP_EOL; error_reporting(E_ERROR); \eBot\Application\ApplicationClient::getInstance()->run();