I think it will be most useful. By the way, please note that you need not enter the server port and the port for requests.Code:<?php$ip = '88.150.159.136'; $queryport = 29416;$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();$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));var_dump( $server );?>
[PHP] Simple server query
Discussion in 'Rust Discussion' started by s1lk, Mar 10, 2014.
-
For PHP I would use this class. I have had success with it, but haven't tested it with Rust.
https://github.com/xPaw/PHP-Source-Query-Class
With node.js I would use this.
https://github.com/randunel/node-srcds-rcon -
-
is this what I would use to get the chat data to populate on web page somewhere?
here is the mod that exports http://oxidemod.org/resources/chat-exporter.312/
I dont really understand how to get the php data right :/ any help would be appreciated -
excuse me but why this:
Code:array(8) { ["name"]=> string(0) "" ["map"]=> NULL ["game"]=> NULL ["description"]=> NULL ["players"]=> int(0) ["playersmax"]=> int(0) ["password"]=> int(0) ["vac"]=> int(0) }
query port is default: 28016 ip is ofc mine (not domain)
and RUSTY works with the same query port so its nothing with port forwarding.
I got my own dedicated server, do i need any specific libraries?
edit: if i edit ip to another server, its working fine but not for mine;(
got tcp/udp in iptables for my gameport+query portLast edited by a moderator: Apr 11, 2014 -
-
excuse me but what?
not using cracked server.
its Steam mate
p.s if ure talking about the sentence i wrote "i got dedicated server".
So yes, friend of mine is ceo of one of GSPs which from i got the files.
Ofc noone has to know of which one , right?
Guess how i got oxide as well... i cant download it from that site oO -
-
This should still work
-
https://github.com/xPaw/PHP-Source-Query-Class ??Last edited by a moderator: Jan 25, 2015 -
Code:
<?php$ip = '88.150.159.136'; $queryport = 29416;$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();$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));var_dump( $server );?>
-
How I can return the seed and worldsize values? Tkx.
-
-
Wulf Community Admin
-
there is a way.
But blocking querries will result in a facepunch ban so your server won't be listed in the list anymore. -
Wulf Community Admin
-
how to make monitoring for legacy rust
-
$server['players'] = ord(substr($inner, 2, 1));
$server['playersmax'] = ord(substr($inner, 3, 1));
It shows players online and max slots. But how show sleepers?