firefly2442 6 Posted September 3, 2012 (edited) I put together a small script in PHP to query Arma2, Arma3, and DayZ Standalone servers. It uses GameQ. https://github.com/firefly2442/phparma2serverstatus Enjoy. Edited June 1, 2015 by firefly2442 Share this post Link to post Share on other sites
Tom_48_97 523 Posted October 22, 2012 I've tried your solution on different web servers and with different game servers. It seems that the project gameQ, on which one you've based your work doesn't work. But, Maybe I miss something, I've made a really quick try. The only return of the script is: The server did not respond within the specified time. Share this post Link to post Share on other sites
firefly2442 6 Posted October 22, 2012 Hmm, do you have a firewall or something potentially blocking it? It makes a direct query to the server so if that gets blocked somewhere along the way with a software/hardware firewall, then it won't work. Also, I have tested and run this on my local development computer which is much more open than webhost providers online. It's possible they block connections or block certain PHP function calls that are necessary for this. Share this post Link to post Share on other sites
Tex Willer 1 Posted October 26, 2012 Really nice tool, firefly, thank you! Testing it on my local machine because (as you said too) web hosts are usually too restrictive on PHP functions :) Question: is it possible to fetch the player scores as well? That would be really nice if possible ;) Share this post Link to post Share on other sites
firefly2442 6 Posted October 27, 2012 Yeah, I think that may be possible. I didn't really dig much into GameQ or the Gamespy protocol. If you figure it out, send me a patch! Share this post Link to post Share on other sites
peppe 10 Posted February 16, 2013 Hi, nice tool. But I cant see players when I click on related link. All rest work perfect. Share this post Link to post Share on other sites
peppe 10 Posted February 19, 2013 (edited) Hi, now I can list players but on pair of queries it loose the player-score (but not the playername and deaths) .... :( Ex: with 1 3 5 7 .... players works fine not for 2 4 6 8 .. players ..confused P Edited February 19, 2013 by peppe Share this post Link to post Share on other sites
firefly2442 6 Posted February 19, 2013 Really? Interesting, I'll update the Github issue. This is when you click on the little + symbol to expand the listing? I'll look at it this weekend if I have some time. Share this post Link to post Share on other sites
peppe 10 Posted February 25, 2013 Hello, here again ... I have no + simbol but clickable PLAYER. If I click on it nothing happens. If I click on MODS it works. Well, the only (partially) results I have is using GameQ directly but with the problems I told you (problem on pair of players). Sorry for my bad english. Share this post Link to post Share on other sites
NeoArmageddon 958 Posted February 25, 2013 This script is what I need! I am working on a method to track a players statistics via squad.xml emulation but I was in need of a way to query arbitrary servers by there IP (other php based solutions I found were broken). I will report my feedback soon. Share this post Link to post Share on other sites
firefly2442 6 Posted March 16, 2013 Would you please try the updated version (see Github). I actually didn't change anything but pulled in changes from GameQ. You'll have to update the submodule by doing: git submodule --update I am now unable to reproduce this issue with the player listings. Thanks for testing. Share this post Link to post Share on other sites
peppe 10 Posted March 16, 2013 Hello Firefly, I solved the problem of pair. Was a wrong reading of multimensional array. Now I update your version from Git and I give you the info about test. I'm going to solve another point: obtain the IP, GUID, PING from player array. This without GameQ because I contact Austin and he told me that is not possible, this information are not present in the stream. :( So, for my needings I pull this infos by parsing the logs. In this way I can BAN too from the panel. Peppe Share this post Link to post Share on other sites
firefly2442 6 Posted March 16, 2013 Ahh great, glad you got it fixed. Send me a pull request on Github when you get everything working. Having that extra player information would be awesome. Cheers. Share this post Link to post Share on other sites
firefly2442 6 Posted May 5, 2013 Thanks to Austin for updating GameQ. Now it supports Arma 3 as well. Share this post Link to post Share on other sites
peppe 10 Posted May 8, 2013 Great! ... going to update tnx FF Share this post Link to post Share on other sites
Sappher 10 Posted December 2, 2014 Does this still work? I tried it with a DayZ OverPoch server (37.187.154.231:2402) with following: array( 'id' => 'CCG OverPoch EU 3', 'type' => 'armedassault2oa', 'host' => '37.187.154.231:2402' ) And it just says it's offline, eventhough the server is up and running. I've tried different types from 'source' to 'armedassault2' etc. Also tried other servers, disabled my firewall... Running this on Windows 7, with WAMP server. var_dump gives: array (size=17) 'gq_address' => string '37.187.154.231' (length=14) 'gq_dedicated' => boolean false 'gq_gametype' => boolean false 'gq_hostname' => boolean false 'gq_joinlink' => string 'steam://connect/37.187.154.231:2402/' (length=36) 'gq_mapname' => boolean false 'gq_maxplayers' => boolean false 'gq_mod' => boolean false 'gq_numplayers' => boolean false 'gq_online' => boolean false 'gq_password' => boolean false 'gq_port' => string '2402' (length=4) 'gq_protocol' => string 'source' (length=6) 'gq_transport' => string 'udp' (length=3) 'gq_type' => string 'armedassault2oa' (length=15) 'players' => array (size=0) empty 'teams' => array (size=0) empty Share this post Link to post Share on other sites
firefly2442 6 Posted December 2, 2014 Try changing the type to "source". I updated the example awhile back, see here for the commit: https://github.com/firefly2442/phparma2serverstatus/commit/ee861234ed5cf9cfe0504de97f6ab990fd9584f1 Just so you're aware, I haven't tried it with DayZ. But if it works or doesn't work, let me know. Does this still work? I tried it with a DayZ OverPoch server (37.187.154.231:2402) with following:array( 'id' => 'CCG OverPoch EU 3', 'type' => 'armedassault2oa', 'host' => '37.187.154.231:2402' ) And it just says it's offline, eventhough the server is up and running. I've tried different types from 'source' to 'armedassault2' etc. Also tried other servers, disabled my firewall... Running this on Windows 7, with WAMP server. var_dump gives: array (size=17) 'gq_address' => string '37.187.154.231' (length=14) 'gq_dedicated' => boolean false 'gq_gametype' => boolean false 'gq_hostname' => boolean false 'gq_joinlink' => string 'steam://connect/37.187.154.231:2402/' (length=36) 'gq_mapname' => boolean false 'gq_maxplayers' => boolean false 'gq_mod' => boolean false 'gq_numplayers' => boolean false 'gq_online' => boolean false 'gq_password' => boolean false 'gq_port' => string '2402' (length=4) 'gq_protocol' => string 'source' (length=6) 'gq_transport' => string 'udp' (length=3) 'gq_type' => string 'armedassault2oa' (length=15) 'players' => array (size=0) empty 'teams' => array (size=0) empty Share this post Link to post Share on other sites
Sappher 10 Posted December 2, 2014 Try changing the type to "source". I updated the example awhile back, see here for the commit: h-Just so you're aware, I haven't tried it with DayZ. But if it works or doesn't work, let me know. Thanks for the quick answer. But as I said in my post, I've tried with different types, including source: array( 'id' => 'CCG OverPoch EU 3', 'type' => 'source', 'host' => '37.187.154.231:2402' ) with no luck. Can you try if this server works for you? It's up and running at the moment. Share this post Link to post Share on other sites
firefly2442 6 Posted December 3, 2014 Ahh, sorry, I read it too quickly. I updated the upstream GameQ library and tried it and I get the same results. It looks like this is a known issue: https://github.com/Austinb/GameQ/issues/202 I don't have time to look at it right at the moment but maybe this weekend. If you're good with PHP, maybe you can glance at it? Cheers. Thanks for the quick answer. But as I said in my post, I've tried with different types, including source:array( 'id' => 'CCG OverPoch EU 3', 'type' => 'source', 'host' => '37.187.154.231:2402' ) with no luck. Can you try if this server works for you? It's up and running at the moment. Share this post Link to post Share on other sites
Sappher 10 Posted December 3, 2014 Ahh, sorry, I read it too quickly. I updated the upstream GameQ library and tried it and I get the same results. It looks like this is a known issue: https://github.com/Austinb/GameQ/issues/202I don't have time to look at it right at the moment but maybe this weekend. If you're good with PHP, maybe you can glance at it? Cheers. I don't know PHP well enough, and eventhough I'd be an interesting process to dig deeper into GameQ I don't really have time either right now.. I did some debugging and it seems that at GameQ::sockets_listen(), it never reaches any data: [.....] // We had error or no streams left, kill the loop if($streams === FALSE || ($streams <= 0)) { echo 'Ending loop...'; $loop_active = FALSE; break; } // Loop the sockets that received data back foreach($read AS $socket) { echo 'Got data... <br>'; // See if we have a response if(($response = stream_socket_recvfrom($socket, 8192)) === FALSE) { echo 'Waiting for response...'; continue; // No response yet so lets continue. } [.....] It never enters the foreach -loop, and the 'Ending loop...' echo I added gets printed. But as I said, this is probably nothing, as I don't have time to dig deeper into the GameQ class at the moment sadly. Hopefully you can check it out when you have time, this could be really helpful! Thank you in advance! Share this post Link to post Share on other sites
firefly2442 6 Posted December 9, 2014 Well, I can get DayZ standalone to work but I can't seem to get the DayZ mod querying properly. What are the ports that you have set in your server config? I don't know PHP well enough, and eventhough I'd be an interesting process to dig deeper into GameQ I don't really have time either right now.. I did some debugging and it seems that at GameQ::sockets_listen(), it never reaches any data:[.....]// We had error or no streams left, kill the loopif($streams === FALSE || ($streams <= 0)){echo 'Ending loop...';$loop_active = FALSE;break;}// Loop the sockets that received data backforeach($read AS $socket){echo 'Got data... <br>';// See if we have a responseif(($response = stream_socket_recvfrom($socket, 8192)) === FALSE){ echo 'Waiting for response...'; continue; // No response yet so lets continue.}[.....] It never enters the foreach -loop, and the 'Ending loop...' echo I added gets printed. But as I said, this is probably nothing, as I don't have time to dig deeper into the GameQ class at the moment sadly. Hopefully you can check it out when you have time, this could be really helpful! Thank you in advance! Share this post Link to post Share on other sites
firefly2442 6 Posted February 12, 2015 Some updates were made upstream in GameQ so I think DayZ is working now. Share this post Link to post Share on other sites
hekut146 10 Posted April 14, 2015 please fix arma 2 oa status info and dayzmod thank you in advance.. Share this post Link to post Share on other sites
firefly2442 6 Posted June 1, 2015 Looks like the upstream GameQ library has (mostly) switched over from v2 to v3 so I updated that and the example. Share this post Link to post Share on other sites
georgeashby123 1 Posted October 6, 2015 Nice, thanks for making this man! Share this post Link to post Share on other sites