C
C
Cucumber2016-08-23 20:19:06
PHP
Cucumber, 2016-08-23 20:19:06

How to get a list of players on the RUST game server?

I want my site to display a list of players on several servers (2-3 mine and several partner servers).
I monitor servers like this:

$socket = @fsockopen("udp://".$ip, $queryport , $errno, $errstr, 1);

stream_set_timeout($socket, 1);
stream_set_blocking($socket, TRUE);
fwrite($socket, "\xFF\xFF\xFF\xFF\x54Source Engine Query\x00");
$response = fread($socket, 4096);
@fclose($socket);

$packet = explode("\x00", substr($response, 6), 5);
$server = array();

echo "<pre>";
var_dump($packet);
echo "</pre>";

$server['name'] = $packet[0];
$server['map'] = $packet[1];
$server['game'] = $packet[2];
$server['description'] = $packet[3];
$inner = $packet[4];
$server['players']     = ord(substr($inner, 2, 1));
$server['playersmax']  = ord(substr($inner, 3, 1));
$server['password']    = ord(substr($inner, 7, 1));
$server['vac']         = ord(substr($inner, 8, 1));

It works flawlessly, but the trouble is that the server does not give more information.
1) Is it possible to contact him somehow differently?
fwrite($socket, "тут другое");
2) Or is there another way to get the list of players? (necessarily without rcon)
I did not find ANY documentation. I searched for a long time before posting here.
So if anyone knows, please tell me.
PS YES! You can get a list of players! 100% infa. I have seen it on websites more than once. For example, on monitoring (not advertising) ( tab "players on the server" gamemonitoring.net/server/109.95.212.40:28015 )
PSS RUST - I mean the game and not the programming language

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question