koraktor / steam-condenser

A multi-language library for querying the Steam Community, Source, GoldSrc servers and Steam master servers
https://koraktor.de/steam-condenser
Other
356 stars 67 forks source link

Servers using wrong protocol format should not fail #11

Closed idev closed 15 years ago

idev commented 15 years ago

Hey,

i just tested some CS Servers, eg: 85.88.20.66:27492 85.88.20.66:27844 and i never get an respond, only CS Servers with default port 27015 works fine.

CSS Servers works on any port.

Could anybody confirm this behavior?

phx

idev commented 15 years ago

Some more Infos:

Sending data packet of type "A2A_PING_Packet".
Got reply of type "A2A_ACK_Packet".
Sending data packet of type "A2S_INFO_Packet".
/Users/phx/.gem/ruby/1.8/gems/steam-condenser-0.7.0/lib/byte_buffer.rb:74:in `get_byte': undefined method `[]' for nil:NilClass (NoMethodError)
from /Users/phx/.gem/ruby/1.8/gems/steam-condenser-0.7.0/lib/steam/packets/s2a_info_detailed_packet.rb:38:in `initialize'
from /Users/phx/.gem/ruby/1.8/gems/steam-condenser-0.7.0/lib/abstract_class.rb:29:in `new'
from /Users/phx/.gem/ruby/1.8/gems/steam-condenser-0.7.0/lib/abstract_class.rb:29:in `new'
from /Users/phx/.gem/ruby/1.8/gems/steam-condenser-0.7.0/lib/steam/packets/steam_packet_factory.rb:35:in `get_packet_from_data'
from /Users/phx/.gem/ruby/1.8/gems/steam-condenser-0.7.0/lib/steam/sockets/goldsrc_socket.rb:58:in `get_reply'
from /Users/phx/.gem/ruby/1.8/gems/steam-condenser-0.7.0/lib/steam/servers/game_server.rb:205:in `get_reply'
from /Users/phx/.gem/ruby/1.8/gems/steam-condenser-0.7.0/lib/steam/servers/game_server.rb:112:in `handle_response_for_request'
from /Users/phx/.gem/ruby/1.8/gems/steam-condenser-0.7.0/lib/steam/servers/game_server.rb:150:in `update_server_info'
from /Users/phx/.gem/ruby/1.8/gems/steam-condenser-0.7.0/lib/steam/servers/game_server.rb:137:in `init'
koraktor commented 15 years ago

I can reproduce this. I don't think this is related to the custom ports, but I'll check this problem. Stay tuned.

koraktor commented 15 years ago

Are these servers up-to-date? The responses look like those servers are horribly outdated. First of all they're still sending S2A_INFO_DETAILED responses (header 0x6d), these have been replaced with S2A_INFO2 responses for GoldSrc servers with one of the recent updates. Additionally the response seems to be missing a few bytes from the (latest) standard S2A_INFO_DETAILED packet.

See this wiki article for more information.

koraktor commented 15 years ago

Both servers respond with a different IP address: 169.254.96.72. This may hint at those servers being HTLV servers. HTLV seems to still use the old response format and also has some own data - but there's no documentation about this.

idev commented 15 years ago

Hey,

i randomly choosed the servers from game-monitor.com (filter: counter-strike, country: germany).. if you enter the ips in hlsw (hlsw.net) you get a different server name / server ip as displayed in game-monitor .. very mysterious... perhaps some redirecting ip? greetings

koraktor commented 15 years ago

Ok... usually I would mark a problem like this invalid, but Steam Condenser should gather as much information as possible, even from servers using the wrong protocol format. I'll try to change the behavior so it will graciously fail for servers like this.

idev commented 15 years ago

Hey,

do you have hlsw? (http://www.hlsw.org/) For Example use 85.88.20.66:27788, in hlsw you get a response. (ServerInfos, PlayerList ...) i dont really get why steam-condenser doesn't?

Thanks for your time!

koraktor commented 15 years ago

Like said before, Steam Condenser fails on non-standard responses from such servers. I'll make a quick change soon changing the behavior for responses like the ones I get from this server. This will skip a few informations from the response so it won't fail.

koraktor commented 15 years ago

This is now fixed in b5f678946158a449d571a80d96735e5ef0f639b8. This is more a workaround than a fix, but it will do its job.

idev commented 15 years ago

Hey, thanks the server are now responding, but i notice now some other side effect, i got always the same playerlist with randomly changing servernames.

85.88.20.66:27788 ( Underground [de_dust2 ONLY] TICK 100 AWP/FF OFF by www.u-gaming.org ) 85.88.20.66:27844 ( Bohramt Baerenhoehle - http://bohramt.de )

Show the same playerlist, and if you update the server 5 minutes laters you get different names but the same playerlist... but only with the custom ports... :)

idev commented 15 years ago

ok, seems to be a general issue.. my HLSW (version 1.3.1 shows the same funny behavior)

koraktor commented 15 years ago

Yes. The responses from this IP seem to be proxied to/from other servers and seem to change randomly.