Jump to content
php.lv forumi

CS server monitor


sandis_m

Recommended Posts

Un kā ko izdarīt, lai nelādētos nezcik ilgi? Kā kešot?

 

Piemēram, kaut vai šim te:

 

<?php
$ip = "zm.heal.lv";
$ports = "27015";
$socket = fsockopen("udp://".$ip, $ports);
$cmd = "\xFF\xFF\xFF\xFF\x54Source Engine Query\x00";
$lenght = strlen($cmd);
fwrite($socket, $cmd, $lenght);
$response = fread($socket, 1);

if (empty($response))
{
   echo "<center>$ip:$ports: <b>-</b></center>\n";
} else
{
   echo "<center>$ip:$ports: <b>+</b></center>\n";
}
?>

Edited by who_i_am
Link to comment
Share on other sites

Izveido temporaly failu uz lokālā servera un pieliec klāt tādu fīču kā šī faila update reizi X stundās/minūtēs. Tad arī vienmēr visu informāciju par serveri lasi no lokālā faila.

Edited by m8t
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...