isAdmin( $_SESSION['user_id'] ); if( $isAdmin ) $server_home = $db->getGameHome($home_id); else $server_home = $db->getUserGameHome($_SESSION['user_id'],$home_id); if ( !$server_home ) return; $port = $_REQUEST['port']; $ip = $_REQUEST['ip']; $server_home['ip'] = $ip; $server_home['port'] = $port; $stats_players = 0; $stats_maxplayers = 0; $server_xml = read_server_config(SERVER_CONFIG_LOCATION."/".$server_home['home_cfg_file']); $xml_installer = $server_xml->installer; $mod_name = $server_home['mods'][$mod_id]['mod_name']; $mod_key = $server_home['mods'][$mod_id]['mod_key']; if (strtolower($mod_name) == "none") $mod = $mod_key; else $mod = $mod_name; if ($server_xml->protocol == "gameq") $query_name = $server_xml->gameq_query_name; elseif ($server_xml->protocol == "lgsl") $query_name = $server_xml->lgsl_query_name; else $query_name = $mod; // If query name does not exist use mod key instead. // Check if the screen running the server is running. if ($server_xml->protocol == "gameq") { require('protocol/GameQ/functions.php'); require_once('protocol/GameQ/GameQMonitor.php'); } else if ($server_xml->protocol == "lgsl") { require('protocol/lgsl/functions.php'); require_once('protocol/lgsl/LGSLMonitor.php'); } else if ($server_xml->protocol == "teamspeak3") { require_once('protocol/TeamSpeak3/TS3Monitor.php'); } else { // This is here because some servers are not supported by LGSL/GameQ or // because we do not have proper support for them yet. // With properly supported games this should not needed. // (In a perfect world no one would need an insurance.) $status = "online"; $map = $status; $maplocation = get_map_path($query_name,$mod,$map); @$notifications .= query_protocol_not_supported; } $map_image_upload = '
'; @$map_icon = ""; @$currentmap = $map; //Properties for Specific Status if($status == "half" || $status == "online") { if($status == "online") { $onlineT = "
"; $onlineT .= "$map_icon"; if($isAdmin) $onlineT .= "$map_image_upload"; $onlineT .= "
"; $onlineT .= "
"; @$onlineT .= hostname .": " . htmlentities($name) . "
"; @$onlineT .= current_map . ": " . ((isset($mapRaw) && !empty($mapRaw)) ? htmlentities($mapRaw) : $currentmap); $onlineT .= "
"; } else if($status == "half") { @$notifications .= failed_querying_server; } $remote_server_id = $server_home['remote_server_id']; $rserver = $db->getRemoteServerById($remote_server_id); $remote = new OGPRemoteLibrary($rserver['agent_ip'], $rserver['agent_port'], $rserver['encryption_key'], $rserver['timeout']); $startup_file_exists = $remote->rfile_exists( "startups/".$ip."-".$port ) === 1; $SrvCtrl = "
". restart_server ."
". restart_server . "
".
					stop_server ."
". stop_server . "
"; } //Echo them all echo "
".@$onlineT.@$halfT.@$offlineT."
"; if( $server_xml->protocol != "teamspeak3" OR ($startup_file_exists and $server_xml->protocol == "teamspeak3") ) echo "
".@$SrvCtrl."
"; if(isset($player_list)) echo "
".@$player_list."
"; if(isset($notifications)) echo "
".@$notifications."
"; } ?>