Raised This Month: $81 Target: $400
 20% 

Website Server Status


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
YankeeDeuce
Member
Join Date: Dec 2004
Old 12-16-2004 , 23:23   Website Server Status
Reply With Quote #1

I forgot about this. I got it working - here is the code. Check http://www.wdgamers.com/server.php to see what it looks like. I also have another version that works that you can see here http://www.forgottenones.net/index.p...8.100.60:27015

Code:
<?php
function fragsort ($a, $b) {   
    if ($a["frags"] == $b["frags"]) return 0;
    if ($a["frags"] > $b["frags"]) {
        return -1;
    } else {
        return 1;
    }
}    


Class CounterStrike {
    var $m_playerinfo ="";        // Info about players
    var $m_servervars ="";        // Info about the server current map, players etc
    var $m_serverrules  ="";        // Serverrules
    
    //
    // Get exact time, used for timeout counting
    //
    function timenow() {
        return doubleval(ereg_replace('^0\.([0-9]*) ([0-9]*)$','\\2.\\1',microtime()));
    }
    
    //
    // Read raw data from server
    //
    function getServerData($command,$serveraddress,$portnumber,$waittime) {
        $serverdata        ="";
        $serverdatalen=0;
        
        if ($waittime< 500) $waittime= 500;
        if ($waittime>2000) $waittime=2000;
        $waittime=doubleval($waittime/1000.0);

            
        if (!$cssocket=fsockopen("udp://".$serveraddress,$portnumber,$errnr)) {
            $this->errmsg="No connection";
            return "";
        }
        
        socket_set_blocking($cssocket,true);
        @socket_set_timeout($cssocket,0,500000);
        fwrite($cssocket,$command,strlen($command));    
        // Mark
        $starttime=$this->timenow();
        do {
            $serverdata.=fgetc($cssocket);
            $serverdatalen++;
            $socketstatus=socket_get_status($cssocket);
            if ($this->timenow()>($starttime+$waittime)) {
                $this->errmsg="Connection timed out";
                fclose($cssocket);
                return "";
            }
        } while ($socketstatus["unread_bytes"] );
        fclose($cssocket);
        return $serverdata;        
    }
    
    function getnextstring(&$data) {
        $temp="";
        $counter=0;
        while (ord($data[$counter++])!=0) $temp.=$data[$counter-1];
        $data=substr($data,strlen($temp)+1);
        return $temp;
    }

    function getnextbytevalue(&$data) {
        $temp=ord($data[0]);
      $data=substr($data,1);
      return $temp;
    }

    function getnextfragvalue(&$data) {
        $frags=ord($data[0])+(ord($data[1])<<8)+(ord($data[2])<<16)+(ord($data[3])<<24);
        if ($frags>=4294967294) $frags-=4294967296;
        $data=substr($data,4);
        return $frags;
    }

    function getnextplaytime(&$data) {
        $decnumber=ord($data[0])+(ord($data[1])<<8)+(ord($data[2])<<16)+(ord($data[3])<<24);
        $binnumber=base_convert($decnumber,10,2);
        while (strlen($binnumber) < 32) $binnumber="0".$binnumber;
        $exp=abs(base_convert(substr($binnumber,1,8),2,10))-127;
        if (substr($binnumber,0,1)=="1") $exp=0-$exp;
        $man=1;$manadd=0.5;
        for ($counter=9;$counter<32;$counter++) {
            if (substr($binnumber,$counter,1)=="1") $man+=$manadd;
            $manadd=$manadd/2;
        }
        $time=round(pow(2,$exp)*$man);
        $playtime="";
        if ($time>3600) {
            $playtime=sprintf("%02d:",$time/3600); //heures
        } 
        $time%=3600;
        $playtime=$playtime.sprintf("%02d:",$time/60); //minutes    
        $time%=60;
        $playtime=$playtime.sprintf("%02d",$time); //secondes
        $data=substr($data,5);
		if(strlen($playtime)==5) $playtime="00:".$playtime;
		if(strlen($playtime)==2) $playtime="00:00:".$playtime;
        return $playtime;
    }

    // **********************************************************************
    // getServerRules
    // Read rules/setup from the gameserver into m_serverrules
    // Return true if successful
    // **********************************************************************
    function getServerRules($serveraddress,$portnumber,$waittime) {
        $cmd="\xFF\xFF\xFF\xFF\x56";        
        $serverdata=$this->getServerData($cmd,$serveraddress,$portnumber,$waittime)    ;
        // Check length of returned data, if < 5 something went wrong
        if (strlen($serverdata)<5) return false;            
        // Figure out how many rules there are
        $rules=(ord($serverdata[5]))+(ord($serverdata[6])*256);
        if ($rules!=0) {
            // Strip OOB data                
            $serverdata=substr($serverdata,7);
            for ($i=1;$i<=$rules;$i++) {
                $rulename        =$this->getnextstring($serverdata);
                $rulevalue    =$this->getnextstring($serverdata);
                $this->m_serverrules[$rulename]=$rulevalue;
            }
            return true;
        } else {
            return false;
        }
    }    

    
    // **********************************************************************
    // getServerinfo
    // Read information about the gameserver into m_servervars
    // Serveraddress,servername,current map etc etc
    // Return true if successful
    // **********************************************************************
    function getServerInfo($serveraddress,$portnumber,$waittime) {
        $cmd="\xFF\xFF\xFF\xFF\x54";        
        $serverdata=$this->getServerData($cmd,$serveraddress,$portnumber,$waittime)    ;
        // Check length of returned data, if < 5 something went wrong
        if (strlen($serverdata)<5) return false;        
        // Strip OOB data                
        $serverdata=substr($serverdata,5);
        $this->m_servervars["servername"]    =$this->getnextstring($serverdata);
        $this->m_servervars["mapname"]            =$this->getnextstring($serverdata);
        $this->m_servervars["mapname1"]                =$this->getnextstring($serverdata);
        $this->m_servervars["game"]                        =$this->getnextstring($serverdata);
        $this->m_servervars["currentplayers1"]                =$this->getnextstring($serverdata);
        $this->m_servervars["currentplayers2"]    =$this->getnextbytevalue($serverdata);
        $this->m_servervars["currentplayers"]            =$this->getnextbytevalue($serverdata);    
        return true;
}    


    // **********************************************************************
    // Get Playerinfo
    // Read information about the players into m_playerinfo
    // Name,frags,playtime
    // Return true if successful
    // **********************************************************************
    function getServerPlayers($serveraddress,$portnumber,$waittime) {
        // Servercommand
        $cmd="\xFF\xFF\xFF\xFF\x55";
        $serverdata=$this->getServerData($cmd,$serveraddress,$portnumber,$waittime);
        
        // Check length of returned data, if < 5 something went wrong
        if (strlen($serverdata)<5) return false;
        
        // Check number of players to read data for
        $players=ord($serverdata[5]);
        
         // Strip OOB data and other stuff
        $serverdata=substr($serverdata,7);
        for ($i=1;$i<=$players;$i++) {
            $playername                            =htmlspecialchars($this->getnextstring($serverdata));
            $frags                                    =$this->getnextfragvalue($serverdata);
            $playtime                                =$this->getnextplaytime($serverdata);
            $this->m_playerinfo[$i] =array("name"=>$playername,"frags"=>$frags,"time"=>$playtime);
        }
        // Sort players in fragorder
        if ($players>1) usort($this->m_playerinfo,"fragsort");
        return true;
    }
}
$ip = "64.156.56.83";
$port= "27015";
if(!$HTTP_POST_VARS["serveradr"] AND !$HTTP_POST_VARS["serverport"]){
	$serveradr = $ip;
	$serverport= $port;
}
else {
	$serveradr = str_replace(".","",$HTTP_POST_VARS["serveradr"]);
	if(is_numeric($serveradr) AND is_numeric($HTTP_POST_VARS["serverport"])){
    	$serveradr = trim($HTTP_POST_VARS["serveradr"]);
    	$serverport= trim($HTTP_POST_VARS["serverport"]);
	}
	else {
    	$serveradr = $ip;
    	$serverport= $port;
	}
}
$csinfo = new CounterStrike;
$status = $csinfo->getServerInfo($serveradr,$serverport,1000);
if ($status) {
    $status = $csinfo->getServerPlayers($serveradr,$serverport,1000);
    $status = $csinfo->getServerRules($serveradr,$serverport,1000);
    $rules = $csinfo->m_serverrules;
?>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="tblg">
    <TR>
      <TD COLSPAN="3"><DIV CLASS="titreblocg">Live Server View</DIV></TD>
    </TR>
    <TR>
      <TD CLASS="map">Map in progress</TD>
      <TD ROWSPAN="4">[img]images/gfx_sep.jpg[/img]</TD>
      <TD CLASS="data">Server Info</TD>
    </TR>
    <TR>
      <TD ALIGN="center" ROWSPAN="3">[img]images/mappics/<?php if (@filesize([/img]m_servervars["mapname"].".jpg")!="") echo $csinfo->m_servervars["mapname"]; else echo "nomap"; ?>.jpg" BORDER="0" WIDTH="160" HEIGHT="120" ALT="<?php echo $csinfo->m_servervars["mapname"]?>" TITLE="<?php echo $csinfo->m_servervars["mapname"]?>"></TD>
      <TD><U>IP</U>: <?php echo $serveradr ?> <U>Port</U>: <?php echo $serverport ?>
<U>Players</U>: <?php echo $csinfo->m_servervars["currentplayers"]?>
<U>Map in progress</U>: <?php echo $csinfo->m_servervars["mapname"]?>
<U>Friendly Fire</U>: <?php if($rules["mp_friendlyfire"]==0) echo "Off"; else echo "On"; ?>
<U>Server access</U>: <?php if($rules["sv_password"]==0) echo "Public"; else echo "Private"; ?>

<SELECT NAME="server_rules">
      <OPTION VALUE="Configuration du serveur">Server configuration</OPTION>
<?php
reset ($rules);
ksort ($rules);
while (list($name,$value) = each ($rules)) { 
?>
      <OPTION VALUE="<?php echo $name ?>"><?php echo $name." = ".$value ?></OPTION>
<?php
}
?>
</SELECT></TD>
    </TR>
    <TR>
      <TD CLASS="data">Monitor an other server</TD>
    </TR>
    <TR>
      <TD><FORM ACTION="" METHOD="post"><INPUT TYPE="text" NAME="serveradr" SIZE="14" MAXLENGTH="40" VALUE=" Enter the IP and"> <INPUT TYPE="text" NAME="serverport" SIZE="6" MAXLENGTH="40" VALUE=" the port"> <INPUT TYPE="submit" VALUE="Go !"></FORM></TD>
    </TR>
</TABLE>
<DIV CLASS="titreblocg">Players online</DIV>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="tblg">
<?php
if (is_array($csinfo->m_playerinfo)) {
?>
    <TR>
      <TH>Name</TH>
      <TH ALIGN="center">Frags</TH>
      <TH ALIGN="center">Time</TH>
    </TR>
<?php
	while (list(,$player) = each ($csinfo->m_playerinfo)) {
?>
    <TR>
      <TD><?=$player["name"]?></TD>
      <TD ALIGN="center"><?=$player["frags"]?></TD>
      <TD ALIGN="center"><?=$player["time"]?></TD>
    </TR>
<?php
	}
}
else {
?>
    <TR>
      <TD ALIGN="center">

The server is empty

</TD>
    </TR>
<?php
}
?>
</TABLE>
<?php
	} 
	else {
	echo "Communication error with the server\n";
} 
?>
__________________
www.strafeRight.com
#strafeRight @ irc.gamesurge.net
YankeeDeuce is offline
Tim
Senior Member
Join Date: Dec 2004
Location: the Netherlands
Old 12-17-2004 , 10:31  
Reply With Quote #2

It's hard to see what's wrong with that script exactly,
but I've got a working one on another PC at home,
I'll send it to you when I get there...
Guess in a week I'll have my serverinfo script ready,
which I'll post here aswell.

Best regards,
Tim
Tim is offline
Tim
Senior Member
Join Date: Dec 2004
Location: the Netherlands
Old 12-21-2004 , 21:44   My scripts (mostly) done
Reply With Quote #3

My scripts's now mostly done, meaning it already does
everything it's supposed to do, but if I've got the time I'll
expand it some more with off-topic addons.
(the useless stuff most people won't even use that is...)

It needs PHP3+, MySQL + Database, udp:// Socket and
image streaming support to be able to fully function.

As for now it does in fact:
-Retrieve information from your server every 5 minutes (gather.php)
-Show the serverstatus from multiple servers on a webpage (index.php)
-Show a small recap all serverstati in a block for a mainpage (small.php)
-Let you add and remove servers from a admin-only-webpage (admin.php)
-Let you create a personal avatar telling others your playingdetails,
in which if there are no details a chosen picture is displayed (avatar.php)
-Stuff it does but I forgot for now... (enjoy)

The download link is available here:
http://www.un4given.nl/tim/serverstatus_sql.zip
[3 MB, mostly small pictures from maps]

A main page demonstration is available here:
http://www.un4given.nl/tim/index.php

A small recap demonstration is available here:
http://www.un4given.nl/tim/small.php

Two avatar demonstrations here:
http://www.un4given.nl/tim/avatar.htm

The addons I'll be working on allow you to add serverinfo
into your server's MOTD and letting you create a signature
banner telling forum users where you are currently playing.
I'll also be working on writing the serverinformation-recap on
the actual mappicture that's being played, which I found better.

The addons above could just be plugged in without changing
settings so those I'll post here seperately once they're done.


Feel free to download / alter / use / distribute these codes,
as well as to thank / praise / flame / curse me for making
this and posting it here.


Best regards,
Tim
Tim is offline
imported_YoMama
Senior Member
Join Date: Oct 2004
Location: Amsterdam (Netherlands)
Old 12-22-2004 , 03:44  
Reply With Quote #4

If anyone's interested, I can post some code here to display live server status. Instead of the actual webpage doing the querying (which can be a burden if you have lots of visitors), I use a perl-script which will query the server once a minute (can be once every x seconds, depending on the amount of servers to be queried), and insert the results into a MySQL (or whatever flavor) table.

The webpages then pull that info directly from the database.

For an example see: http://games.xs4all.nl

Currently I'm just displaying simple info. But rules, players scores and filtering can easily be applied. The nice part is that it supports loads of different games, so it's easily extend to other servers should you host any (like I do).

This method will also become available as an addon for SourceMod by the way.
imported_YoMama is offline
Send a message via ICQ to imported_YoMama Send a message via MSN to imported_YoMama
manorastroman
Senior Member
Join Date: Oct 2004
Old 12-22-2004 , 07:55  
Reply With Quote #5

the only problem with your script is that it keeps repeating 11 out of 20 players in the players section, any fixes?
__________________
manorastroman is offline
Send a message via AIM to manorastroman Send a message via MSN to manorastroman Send a message via Skype™ to manorastroman
Tim
Senior Member
Join Date: Dec 2004
Location: the Netherlands
Old 12-22-2004 , 09:00  
Reply With Quote #6

Quote:
Originally Posted by YoMama
Instead of the actual webpage doing the querying, I use a perl-script which will query the server once a minute, and insert the results into a MySQL table.
The webpages then pull that info directly from the database.
That's almost the same as my script pack is doing, only the information is retrieved once every 5 minutes (also adjustable), and only retrieved if it's actually requested, not every x minutes of a day (better fit for smaller server setups).

Quote:
Originally Posted by YoMama
The nice part is that it supports loads of different games, so it's easily extend to other servers should you host any (like I do).
My script should support all Half-Life 1 & Half-Life 2 mods out there, so I figured that would be enough for 90% of the people here...

Quote:
Originally Posted by YoMama
This method will also become available as an addon for SourceMod by the way.
Posted such a request in "Ideas/Suggestions" part some time ago, good to hear it's come through.
As soon as SourceMod supports these features my script will become obsolete.
(though I might write a different back-end to it to get the same output)

Quote:
Originally Posted by Man... or Astroman
the only problem with your script is that it keeps repeating 11 out of 20 players in the players section, any fixes?
That's only because there are... 11 out of 20 players on that particular server???
If I got you wrong please post a screenshot so I know what you're talking about...


Best regards,
Tim
Tim is offline
imported_Ard Choille
Member
Join Date: Dec 2004
Location: Wellington, NZ
Old 01-04-2005 , 12:38  
Reply With Quote #7

Try this

Code:
<?php

function fragsort ($a, $b) { 
   if ($a["frags"] == $b["frags"]) return 0;
   if ($a["frags"] > $b["frags"]) {
       return -1;
   } else {
       return 1;
   }
}   


Class CounterStrike {
   var $m_playerinfo ="";        // Info about players
   var $m_servervars ="";        // Info about the server current map, players etc
   var $m_serverrules  ="";        // Serverrules
   
   //
   // Get exact time, used for timeout counting
   //
   function timenow() {
       return doubleval(ereg_replace('^0\.([0-9]*) ([0-9]*)$','\\2.\\1',microtime()));
   }
   
   //
   // Read raw data from server
   //
   function getServerData($command,$serveraddress,$portnumber,$waittime) {
       $serverdata        ="";
       $serverdatalen=0;
       
       if ($waittime< 500) $waittime= 500;
       if ($waittime>2000) $waittime=2000;
       $waittime=doubleval($waittime/1000.0);

           
       if (!$cssocket=fsockopen("udp://".$serveraddress,$portnumber,$errnr)) {
           $this->errmsg="No connection";
           return "";
       }
       
       socket_set_blocking($cssocket,true);
       @socket_set_timeout($cssocket,0,500000);
       fwrite($cssocket,$command,strlen($command));   
       // Mark
       $starttime=$this->timenow();
       do {
           $serverdata.=fgetc($cssocket);
           $serverdatalen++;
           $socketstatus=socket_get_status($cssocket);
           if ($this->timenow()>($starttime+$waittime)) {
               $this->errmsg="Connection timed out";
               fclose($cssocket);
               return "";
           }
       } while ($socketstatus["unread_bytes"] );
       fclose($cssocket);
       return $serverdata;       
   }
   
   function getnextstring(&$data) {
       $temp="";
       $counter=0;
       while (ord($data[$counter++])!=0) $temp.=$data[$counter-1];
       $data=substr($data,strlen($temp)+1);
       return $temp;
   }

   function getnextbytevalue(&$data) {
       $temp=ord($data[0]);
     $data=substr($data,1);
     return $temp;
   }

   function getnextfragvalue(&$data) {
       $frags=ord($data[0])+(ord($data[1])<<8)+(ord($data[2])<<16)+(ord($data[3])<<24);
       if ($frags>=4294967294) $frags-=4294967296;
       $data=substr($data,4);
       return $frags;
   }

   function getnextplaytime(&$data) {
       $decnumber=ord($data[0])+(ord($data[1])<<8)+(ord($data[2])<<16)+(ord($data[3])<<24);
       $binnumber=base_convert($decnumber,10,2);
       while (strlen($binnumber) < 32) $binnumber="0".$binnumber;
       $exp=abs(base_convert(substr($binnumber,1,8),2,10))-127;
       if (substr($binnumber,0,1)=="1") $exp=0-$exp;
       $man=1;$manadd=0.5;
       for ($counter=9;$counter<32;$counter++) {
           if (substr($binnumber,$counter,1)=="1") $man+=$manadd;
           $manadd=$manadd/2;
       }
       $time=round(pow(2,$exp)*$man);
       $playtime="";
       if ($time>3600) {
           $playtime=sprintf("%02d:",$time/3600); //heures
       }
       $time%=3600;
       $playtime=$playtime.sprintf("%02d:",$time/60); //minutes   
       $time%=60;
       $playtime=$playtime.sprintf("%02d",$time); //secondes
       $data=substr($data,5);
 if(strlen($playtime)==5) $playtime="00:".$playtime;
 if(strlen($playtime)==2) $playtime="00:00:".$playtime;
       return $playtime;
   }

   //**********************************************************************
   // getServerRules
   // Read rules/setup from the gameserver into m_serverrules
   // Return true if successful
   //**********************************************************************
   function getServerRules($serveraddress,$portnumber,$waittime) {
       $cmd="\xFF\xFF\xFF\xFFV";       
       $serverdata=$this->getServerData($cmd,$serveraddress,$portnumber,$waittime)   ;
       // Check length of returned data, if < 5 something went wrong
       if (strlen($serverdata)<5) return false;           
       // Figure out how many rules there are
       $rules=(ord($serverdata[5]))+(ord($serverdata[6])*256);
       if ($rules!=0) {
           // Strip OOB data               
           $serverdata=substr($serverdata,7);
           for ($i=1;$i<=$rules;$i++) {
               $rulename        =$this->getnextstring($serverdata);
               $rulevalue    =$this->getnextstring($serverdata);
               $this->m_serverrules[$rulename]=$rulevalue;
           }
           return true;
       } else {
           return false;
       }
   }   

   
   //**********************************************************************
   // getServerinfo
   // Read information about the gameserver into m_servervars
   // Serveraddress,servername,current map etc etc
   // Return true if successful
   //**********************************************************************
   function getServerInfo($serveraddress,$portnumber,$waittime) {
       $cmd="\xFF\xFF\xFF\xFFT";       
       $serverdata=$this->getServerData($cmd,$serveraddress,$portnumber,$waittime)   ;
       // Check length of returned data, if < 5 something went wrong
       if (strlen($serverdata)<5) return false;       
       // Strip OOB data               
       $serverdata=substr($serverdata,5);
       $this->m_servervars["servername"]            =$this->getnextstring($serverdata);
       $this->m_servervars["mapname"]                =$this->getnextstring($serverdata);
       $this->m_servervars["game"]                        =$this->getnextstring($serverdata);
       $this->m_servervars["gamename"]                =$this->getnextstring($serverdata);
       $this->m_servervars["currentplayers"]    =$this->getnextbytevalue($serverdata);
       $this->m_servervars["maxplayers"]            =$this->getnextbytevalue($serverdata);   
       return true;
}   


   //**********************************************************************
   // Get Playerinfo
   // Read information about the players into m_playerinfo
   // Name,frags,playtime
   // Return true if successful
   //**********************************************************************
   function getServerPlayers($serveraddress,$portnumber,$waittime) {
       // Servercommand
       $cmd="\xFF\xFF\xFF\xFFU";
       $serverdata=$this->getServerData($cmd,$serveraddress,$portnumber,$waittime);
       
       // Check length of returned data, if < 5 something went wrong
       if (strlen($serverdata)<5) return false;
       
       // Check number of players to read data for
       $players=ord($serverdata[5]);
       
        // Strip OOB data and other stuff
       $serverdata=substr($serverdata,7);
       for ($i=1;$i<=$players;$i++) {
           $playername                            =htmlspecialchars($this->getnextstring($serverdata));
           $frags                                    =$this->getnextfragvalue($serverdata);
           $playtime                                =$this->getnextplaytime($serverdata);
           $this->m_playerinfo[$i] =array("name"=>$playername,"frags"=>$frags,"time"=>$playtime);
       }
       // Sort players in fragorder
       if ($players>1) usort($this->m_playerinfo,"fragsort");
       return true;
   }
}
$ip = "64.156.56.83";
$port= "27015";
if(!$HTTP_POST_VARS["serveradr"] AND !$HTTP_POST_VARS["serverport"]){
$serveradr = $ip;
$serverport= $port;
}
else {
$serveradr = str_replace(".","",$HTTP_POST_VARS["serveradr"]);
if(is_numeric($serveradr) AND is_numeric($HTTP_POST_VARS["serverport"])){
    $serveradr = trim($HTTP_POST_VARS["serveradr"]);
    $serverport= trim($HTTP_POST_VARS["serverport"]);
}
else {
    $serveradr = $ip;
    $serverport= $port;
}
}
$csinfo = new CounterStrike;
$status = $csinfo->getServerInfo($serveradr,$serverport,1000);
if ($status) {
   $status = $csinfo->getServerPlayers($serveradr,$serverport,1000);
   $status = $csinfo->getServerRules($serveradr,$serverport,1000);
   $rules = $csinfo->m_serverrules;
?>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="tblg">
   <TR>
     <TD COLSPAN="3" CLASS="serveur">[img]images/sub.gif[/img] <?php echo $csinfo->m_servervars["servername"] ?></TD>
   </TR>
   <TR>
     <TD CLASS="map">Map in progress</TD>
     <TD ROWSPAN="4">[img]images/gfx_sep.jpg[/img]</TD>
     <TD CLASS="data">Server Info</TD>
   </TR>
   <TR>
     <TD ALIGN="center" ROWSPAN="3">[img]images/mappics/<?php if (@filesize([/img]m_servervars["mapname"].".jpg")!="") echo $csinfo->m_servervars["mapname"]; else echo "nomap"; ?>.jpg" BORDER="0" WIDTH="160" HEIGHT="120" ALT="<?php echo $csinfo->m_servervars["mapname"]?>" TITLE="<?php echo $csinfo->m_servervars["mapname"]?>"></TD>
     <TD><U>IP</U>: <?php echo $serveradr ?> <U>Port</U>: <?php echo $serverport ?>
<U>Players</U>: <?php echo $csinfo->m_servervars["currentplayers"] ?> on <?php echo $csinfo->m_servervars["maxplayers"]?>
<U>Map in progress</U>: <?php echo $csinfo->m_servervars["mapname"]?>
<U>Friendly Fire</U>: <?php if($rules["mp_friendlyfire"]==0) echo "Off"; else echo "On"; ?>
<U>Server access</U>: <?php if($rules["sv_password"]==0) echo "Public"; else echo "Private"; ?>

<SELECT NAME="server_rules">
     <OPTION VALUE="Configuration du serveur">Server configuration</OPTION>
<?php
reset ($rules);
ksort ($rules);
while (list($name,$value) = each ($rules)) {
?>
     <OPTION VALUE="<?php echo $name ?>"><?php echo $name." = ".$value ?></OPTION>
<?php
}
?>
</SELECT></TD>
   </TR>
   <TR>
     <TD CLASS="data">Monitor an other server</TD>
   </TR>
   <TR>
     <TD><FORM ACTION="" METHOD="post"><INPUT TYPE="text" NAME="serveradr" SIZE="14" MAXLENGTH="40" VALUE=" Enter the IP and"> <INPUT TYPE="text" NAME="serverport" SIZE="6" MAXLENGTH="40" VALUE=" the port"> <INPUT TYPE="submit" VALUE="Go !"></FORM></TD>
   </TR>
</TABLE>
<DIV CLASS="titreblocg">Players online</DIV>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="tblg">
<?php
if (is_array($csinfo->m_playerinfo)) {
?>
   <TR>
     <TH>Name</TH>
     <TH ALIGN="center">Frags</TH>
     <TH ALIGN="center">Time</TH>
   </TR>
<?php
while (list(,$player) = each ($csinfo->m_playerinfo)) {
?>
   <TR>
     <TD><?=$player["name"]?></TD>
     <TD ALIGN="center"><?=$player["frags"]?></TD>
     <TD ALIGN="center"><?=$player["time"]?></TD>
   </TR>
<?php
}
}
else {
?>
   <TR>
     <TD ALIGN="center">

The server is empty

</TD>
   </TR>
<?php
}
?>
</TABLE>
<?php
}
else {
echo "Communication error with the server\n";
}
imported_Ard Choille is offline
DopeFish
Senior Member
Join Date: Feb 2004
Old 01-04-2005 , 14:32   Re: My scripts (mostly) done
Reply With Quote #8

Quote:
Originally Posted by Tim
Two avatar demonstrations here:
http://www.un4given.nl/tim/avatar.htm
ahh thanks, you just reminded me to do dynmic images for signatures. i almost forgot that ;)
DopeFish is offline
Send a message via ICQ to DopeFish
Tim
Senior Member
Join Date: Dec 2004
Location: the Netherlands
Old 01-04-2005 , 15:56   Re: My scripts (mostly) done
Reply With Quote #9

Quote:
Originally Posted by dopefish
Quote:
Originally Posted by Tim
Two avatar demonstrations here:
http://www.un4given.nl/tim/avatar.htm
ahh thanks, you just reminded me to do dynmic images for signatures. i almost forgot that ;)
Doing that myself as we speak, only problem is that I can't find any decent .gdf fonts to work with my PHP...
So untill I find a not too bad one I think I'll hold off using it...
Tim is offline
manorastroman
Senior Member
Join Date: Oct 2004
Old 01-04-2005 , 16:33  
Reply With Quote #10

heres a SS of the bug i was talking about, i think its showing way too many dynamic images or something, it just goes crazy on it

http://img33.exs.cx/img33/9809/bug3ax.jpg
__________________
manorastroman is offline
Send a message via AIM to manorastroman Send a message via MSN to manorastroman Send a message via Skype™ to manorastroman
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode