Austinb / GameQ

A PHP Gameserver Status Query Library
https://austinb.github.io/GameQ/
GNU Lesser General Public License v3.0
404 stars 136 forks source link

Connection issues #73

Closed zeagon closed 11 years ago

zeagon commented 11 years ago

Not sure what the issue is, but it seems i cant connect to anything anymore beside a few bf3 servers ( very few ) Server ips are used from gametracker.com for testing. http://www.gametracker.com/search/bf1942/?searchipp=25#search

Setup is from your examples page, nothing changed there, just replaced type and host $servers = array( array( 'id' => 'test', 'type' => 'bf1942', 'host' => '188.165.220.115:14567', ) );

Odd thing is if i try to open a fsockopen directly through that host it works ( though only through udp:// , but i believe that it can give false positives often.

Not sure whats up here. Server runs on php 5.2.17 stream_timeout is also set to 800k, even tried higher setting with no effect.

Php settings are unlikely, as a very few numbers of servers work

Any idea what the problem could be? debug option doesnt display anything as well ( just nothing, as if debug is off )

EDIT:: Enabled error reporting gameQ.php and this is what i see, caused by line 641 where we write packets to the sockets. Does this mean the packet was 8 bytes to long?

fwrite() [function.fwrite]: send of 8 bytes failed with errno=1 Operation not permitted

Not sure if popular gameports are beeing blocked by the firewall ( 1and1 hosting ) but a normal fsockopen does work on a subfolder ( for simply online/offline displaying )

Could it be that this is a permissions issue with the Apache/Nobody user accessing a remote file that it doesn't have permission to modify/read/write/execute?

Austinb commented 11 years ago

Your port is incorrect. Default game client port means the query port should be 23000. Most of the time the query port is different than the client connect port (the port you see listed on GameTracker's site).

For a server at 188.165.220.115:14567 the ip:port string would be 188.165.220.115:23000. 14567 is the default bf1942 connection port.

Check the wiki as I have a list of supported servers along with the default query ports for each game. Also you can check the classes in the protocols/ directory and they have default ports defined. Note that some game servers have the ability to specify the query port so just keep that in mind if you cant connect to a server on what should be the proper port..

Austinb commented 11 years ago

One last note, may server companies have put up firewalls around their servers to prevent against DOS attacks against their game servers. I've seen some companies run 20+ game servers on a single physical server so DOSing one game server could bring the entire physical server to a crawl or complete halt. Obviously companies can't have this occurring because some 15 year old got banned from a server they were playing on. So many companies have blocked all the ports except the necessary ones required to actually connect to the game server.