How I can get map size and seed in this PHP code?
Thanks!!
Code:$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 Name $server['map'] = $packet[1]; // Server Map (Procedural, Hapis, Craggy or Savas) $server['game'] = $packet[2]; // Game name $server['description'] = $packet[3]; // Description $inner = $packet[4]; $server['players'] = ord(substr($inner, 2, 1)); // Players online $server['playersmax'] = ord(substr($inner, 3, 1)); // Max Players $server['vac'] = ord(substr($inner, 8, 1)); // Server secure
Getting map size and seed in this PHP code?
Discussion in 'Rust Development' started by Arqueiro Verde, Jan 21, 2016.
-
Does the response even contain the seed and size?Code:
var_dump($response);
-
At the moment, you can't with query, but with rcon, you can. Just send "server.worldsize" to your rust server over RCON and the server will output something like "
Then you only need to use a regex to only keep "5000" (in my case)Code:[1/21/2016 10:30:41 PM] server.worldsize: "5000"
-
I feel like rust.io gets server seeds and map size without them running its plugin. And if that's the case there has to be a way outside of rcon.
