Jump to content

get status of game server


gnize

Recommended Posts

Hello. Just wondering if someone could help me with this script.

 

What it does it get the status of a game server. Status shows players names score etc.

 

I'm running php version 5 (PHP version 5.2.6) and Apache version 1.3.41 (Unix)

 

<?PHP

 

    $open = fsockopen("udp://xz.sytes.net", 28960);

   

    socket_set_timeout($open, 1);

   

    fwrite($open, "\xFF\xFF\xFF\xFFgetstatus");

   

    $result = fread($open, 8192);

   

    echo $result;

   

    exit();

 

?>

 

Does my web host need to have that port open to recive the info?

 

When I run the php file from a web browser it shows a blank page.

 

Any help would be awesome. Please and thanks.

 

Gnize.d

 

Link to comment
Share on other sites

Your code looks a little haphazard. I don't exactly know which protocol or port for that matter you are using but try something more like this:

 

<?php

$open = @fsockopen( "xs.sytes.net", 28960, $no, $str, 5 ) or die( 'Connection Failed' );
fwrite( $open, "\xFF\xFF\xFF\xFFgetstatus\r\n" );
print fread( $open, 8192 );

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.