public function getGameTypes() { gameservers_include_library('lgsl_protocol.php', 'lgsl'); $lgsl_types = lgsl_type_list(); unset($lgsl_types['test']); return $lgsl_types; }
function admin_server() { global $db; $tpl = new smarty(); ob_start(); $tpl->assign('games', lgsl_type_list()); $tpl->display(DESIGN . '/tpl/admin/server.html'); $content = ob_get_contents(); ob_end_clean(); main_content(SERVER, $content, '', 1); get_server(); }
/*----------------------------------------------------------------------------------------------------------\ | | | [ LIVE GAME SERVER LIST ] [ © RICHARD PERRY FROM GREYCUBE.COM ] | | | | Released under the terms and conditions of the GNU General Public License Version 3 (http://gnu.org) | | | \-----------------------------------------------------------------------------------------------------------*/ //------------------------------------------------------------------------------------------------------------+ require "lgsl_class.php"; //-----------------------------------------------------------------------------------------------------------+ if (!$lgsl_config['public_add']) { $output .= "\n <div style='text-align:center;" . lgsl_bg() . "'>\n <br />\n {$lgsl_config['text']['asd']}\n <br />\n <br />\n </div>"; return; } //-----------------------------------------------------------------------------------------------------------+ $lgsl_type_list = lgsl_type_list(); unset($lgsl_type_list['test']); asort($lgsl_type_list); $type = empty($_POST['form_type']) ? "source" : trim($_POST['form_type']); $ip = empty($_POST['form_ip']) ? "" : trim($_POST['form_ip']); $c_port = empty($_POST['form_c_port']) ? 0 : intval(trim($_POST['form_c_port'])); $q_port = empty($_POST['form_q_port']) ? 0 : intval(trim($_POST['form_q_port'])); $s_port = 0; if (preg_match("/(\\[[0-9a-z\\:]+\\])/iU", $ip, $match)) { $ip = $match[1]; } elseif (preg_match("/([0-9a-z\\.\\-]+)/i", $ip, $match)) { $ip = $match[1]; } else { $ip = ""; } if ($c_port > 99999 || $q_port < 1024) {
<label><?php echo T_('Start Command'); ?> </label> <textarea name="startLine" class="textarea span5"><?php echo htmlspecialchars($rows['startline'], ENT_QUOTES); ?> </textarea> <label><?php echo T_('Query Type'); ?> </label> <select name="queryType"> <?php //---------------------------------------------------------+ $gamequery = lgsl_type_list(); foreach ($gamequery as $key => $value) { if ($key == $rows['querytype']) { $output = "\t\t\t\t\t\t<option value=\"" . $key . "\" selected=\"selected\">" . $value . " -- " . $key . "</option>\r\n"; echo $output; } else { $output = "\t\t\t\t\t\t<option value=\"" . $key . "\">" . $value . " -- " . $key . "</option>\r\n"; echo $output; } } //---------------------------------------------------------+ ?> </select> <label><?php echo T_('Cache Directory'); ?>
} else { if (!is_numeric($maxSlots)) { $error .= T_('Max Slots is not a numeric value ! '); } } if (empty($defaultPort)) { $error .= T_('Default Server Port is not set ! '); } else { if (!is_numeric($defaultPort)) { $error .= T_('Default Server Port is not a numeric value ! '); } } if (empty($startLine)) { $error .= T_('Start Command is not set ! '); } if (!array_key_exists($queryType, lgsl_type_list())) { $error .= T_('Unknown Query Type ! '); } if (!empty($queryPort)) { if (!is_numeric($queryPort)) { $error .= T_('Query Port is not a numeric value ! '); } } else { $queryPort = $defaultPort; } /* if(!validatePath($cacheDir)) { $error .= T_('Invalid Cache Directory. '); } */
function GetGameList() { return lgsl_type_list(); }
function exec_ogp_module() { ?> <h2>XML Config Creator</h2> <table BORDER=1> <tr> <td> Query protocol </td> <form action="" method="POST"> <td> <select name="protocol" onchange="this.form.submit()"> <option value="">None</option> <option value="lgsl" <?php if (isset($_POST['protocol']) && $_POST['protocol'] == "lgsl") { echo 'selected="selected"'; } ?> >LGSL</option> <option value="gameq" <?php if (isset($_POST['protocol']) && $_POST['protocol'] == "gameq") { echo 'selected="selected"'; } ?> >GameQ</option> </select> </td> </form> </tr> <form action='home.php?m=config_games&p=cli-params&type=cleared' method='POST' name='xml_creator'> <?php if (isset($_POST['protocol'])) { echo "\n\t<tr>\n\t <td>\n\t <input type='hidden' name='protocol' value='" . $_POST['protocol'] . "'/>\n\t"; if ($_POST['protocol'] == "lgsl") { echo "LGSL Query Name</td><td><select name='query_name'>"; require 'protocol/lgsl/lgsl_protocol.php'; $lgsl_type_list = lgsl_type_list(); asort($lgsl_type_list); foreach ($lgsl_type_list as $type => $description) { echo "<option value='{$type}'>{$description}</option>"; } } elseif ($_POST['protocol'] == "gameq") { require 'protocol/GameQ/GameQ.php'; // Define the protocols path $protocols_path = "protocol/GameQ/gameq/protocols/"; // Grab the dir with all the classes available $dir = dir($protocols_path); $protocols = array(); // Now lets loop the directories while (false !== ($entry = $dir->read())) { if (!is_file($protocols_path . $entry)) { continue; } // Figure out the class name $class_name = 'GameQ_Protocols_' . ucfirst(pathinfo($entry, PATHINFO_FILENAME)); // Lets get some info on the class $reflection = new ReflectionClass($class_name); // Check to make sure we can actually load the class if (!$reflection->IsInstantiable()) { continue; } // Load up the class so we can get info $class = new $class_name(); // Add it to the list $protocols[$class->name()] = array('name' => $class->name_long(), 'port' => $class->port(), 'state' => $class->state()); // Unset the class unset($class); } // Close the directory unset($dir); ksort($protocols); echo "GameQ Query Name</td><td><select name='query_name'>"; foreach ($protocols as $gameq => $info) { echo "<option value='" . $gameq . "'>" . htmlentities($info['name']) . "</option>"; } } echo "\n\t </select>\n\t </td>\n\t</tr>"; } else { } ?> <tr> <td> OS: </td> <td> <select name="os"> <option value="linux">Linux</option> <option value="win">Windows</option> </select> </td> </tr> <tr> <td> Architecture </td> <td> <select name="arch"> <option value="32">32bit</option> <option value="64">64bit</option> </select> </td> </tr> <tr> <td> Installer </td> <td> <select name="installer"> <option value="">None</option> <option value="steam">HLDSUpdateTool</option> </select> </td> </tr> <tr> <td> <input name="main" type="submit"/> </form> </td> </tr> </table> <?php }