\n"; exit; } fputs($sock,"\\status\\\player_property\Health\\\game_property\ElapsedTime\\\game_property\RemainingTime\\"); $gotfinal = False; $data = ""; //Set starttime, for possible loop expiration, so the server doesn't get too much work. $starttime = Time(); //Loop until final packet has been received. while(!($gotfinal == True || feof($sock))) { //Get data if(($buf = fgetc($sock)) == FALSE) { usleep(100); // wait for additional data? :S whatever } //Add to databuffer $data .= $buf; //Check if final item (queryid) has been received if (strpos($data,"final\\") != False) { $gotfinal = True; } //Protect webserver against massive loop. if ((Time() - $starttime) > 5) { echo "Data receiving took too long. Cancelled.
"; $gotfinal = True; } } //Close socket fclose ($sock); //Split chunks by \ $chunks = split('[\]', $data); $mappic = strtolower("images/maps/".$map.".jpg"); if (file_exists($mappic)) { } else { $mappic = ("images/maps/blank.jpg"); } $mapname = getiteminfo("mapname",$chunks); $mappic = strtolower("images/maps/".$mapname.".jpg"); IF (file_exists($mappic)) { } else { $mappic = "images/maps/blank.jpg"; } $r_hostname = getiteminfo("hostname",$chunks); $r_gametype = getiteminfo("gametype",$chunks); $r_adminname = getiteminfo("adminname",$chunks); $r_adminemail = getiteminfo("adminemail",$chunks); $r_password = getiteminfo("password",$chunks); $r_timelimit = getiteminfo("timelimit",$chunks); $r_remainingtime = GetMinutes(getiteminfo("RemainingTime",$chunks)) . " mins"; $r_elapsedtime = GetMinutes(getiteminfo("ElapsedTime",$chunks)) . " mins"; $r_goalteamscore = getiteminfo("goalteamscore",$chunks); $r_numplayers = getiteminfo("numplayers",$chunks); $r_minplayers = getiteminfo("minplayers",$chunks); $r_maxplayers = getiteminfo("maxplayers",$chunks); $r_maxteams = getiteminfo("maxteams",$chunks); $r_balanceteams = getiteminfo("balanceteams",$chunks); $r_tournament = getiteminfo("tournament",$chunks); $r_friendlyfire = getiteminfo("friendlyfire",$chunks); $r_gamestyle = getiteminfo("gamestyle",$chunks); echo'
Server Status for '.$r_hostname.' | |||
Server IP | '.$serverip.':'.$serverport.' | ||
Map Name | '.$mapname.' | ||
Match Type | '.$r_gametype.' | ||
Server Info | Admin: '.$r_adminname.' Email: '.$r_adminemail.' |
||
Game Info |
Goal Team Score: '.$r_goalteamscore.' Min Players: '.$r_minplayers.' Max Players: '.$r_maxplayers.' Max Teams: '.$r_maxteams.' Balanced Teams: '.$r_balanceteams.' Tournament Mode: '.$r_tournament.' Friendly Fire: '.$r_friendlyfire.' Game Style: '.$r_gamestyle.' Time Limit: '.$r_timelimit.' Time Remaining: '.$r_remainingtime.' Time Elapsed: '.$r_elapsedtime.' Password Required: '.$r_password.' |
Player Information | ||||
Player | Frags | Team | Ping | Health |
'.$r_playername.' | '.$r_playerfrags.' | '.$r_playerteam.' | '.$r_playerping.' | '.$r_playerhealth.' |