I am making a website and required to obtain Rust server's information like server name, players online, and so on.
However I had a very bad headache from trying to figure out the library at first as I know a server's IP:Port, however when using SourceServer or GoldSrcServer to obtain it's information if I use the port that is used to connect to the server then the request will time out. Ended up having a typo entering +1 to the server port of a server and the data was retrieved.
Tested this same thing with several servers and it seems that to obtain the information, the port is different than what a player let's say would give others to connect to his/her server.
Now, I just wanted to confirm this. Is it always IP:(PORT+1)? Can that be changed or more like, is there a way to obtain the information from the original connection port?
I have listed all the servers available for rust with the following script:
$master = new MasterServer(MasterServer::GOLDSRC_MASTER_SERVER);
$servers = $master->getServers(MasterServer::REGION_ALL,"\\gamedir\\rust",false);
echo '<pre>';
print_r(($servers));
echo '</pre>';
That returns the ports with +1 from what we use to connect to the game, which is funny because the port to connect is never mentioned on this list.
The next, is an example of getting a server's information:
$server = new SourceServer('192.99.7.170:28076');
$server->initialize();
print_r($server->getServerInfo());
That IP and port are listed on the MasterServers, however what the user would type as his server to connect to it would be 192.99.7.170:28075
Is there any way to obtain the information from the port 28075? Or simply should stick to 28075+1?
Thank you!
Sebastian
Sunday, January 19, 2014 5:33 PM
--
You received this message because you are subscribed to the Google Groups "Steam Condenser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condens...@googlegroups.com.
To post to this group, send email to steam-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/7ecc9f07-5ec7-4810-af1a-5a5bc492c103%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Saturday, January 18, 2014 1:21 PM