Jump to content
Sign in to follow this  
firefly2442

PHP Interface to Query Arma2:OA Servers

Recommended Posts

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

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

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

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

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

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 by peppe

Share this post


Link to post
Share on other sites

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

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

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

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

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

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

Thanks to Austin for updating GameQ. Now it supports Arma 3 as well.

Share this post


Link to post
Share on other sites

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

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
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

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
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.

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

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

please fix arma 2 oa status info and dayzmod thank you in advance..

Share this post


Link to post
Share on other sites

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×