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
358 stars 67 forks source link

Ruby: player auth failure #81

Closed txdv closed 13 years ago

txdv commented 13 years ago

server = GoldSrcServer.new("cs.six.lt") p server.players('rcon_password')

This results in a method missing exception

koraktor commented 13 years ago

Can't test this right now, is it about the split_player_status method?

txdv commented 13 years ago

Yeah, it really misses it.

koraktor commented 13 years ago

Ruby: Fixed wrong method call in RCON-powered player query

Closed by de593dd3dea8360535379a5d7fe1b0453b128ee9

txdv commented 13 years ago

This will still fail with goldsrc, since the goldsrc status format is like this: id name userid uniqueid frag time ping loss adr

and the one in source is like this: userid name uniqueid connected ping loss state adr

koraktor commented 13 years ago

I know, there are two implementations of split_player_status - one in GoldSrcServer and one in SourceServer. If you have a problem with the GoldSrc version, please give some further details.

txdv commented 13 years ago

The exception is thrown in lib/steam/steam_player.rb the array index is used badly in GoldSrcServer.split_player_status

koraktor commented 13 years ago

I have reopened this issue and will check this. This may also affect the other implementations. The real problem is that some GoldSrc servers (maybe old versions) use a different status output format.

txdv commented 13 years ago

I'm actually using a not up to date goldsrc server

txdv commented 13 years ago

if line =~ /# (\d+)\s+\"(.+)\"\s+(\d+)\s+((VALVE|STEAM)[0-9:]+)\s+(\d+)\s(\d+:\d+)\s+(\d+)\s+(\d+)\s+(.+):(\d+)/ id = $1 nick = $2 userid = $3 worldid = $4 frag = $6 onlinetime = $7 ping = $8 loss = $9 ip = $10 port = $11 end

This is the match string i came up with to handle the stuff.

txdv commented 13 years ago

if line =~ /# (\d+)\s+\"(.+)\"\s+(.+)/ arr = [$1, $2] + $3.split(" ") s = arr.last.split(":") arr.pop arr = arr + s end

In order to push to an array all values.

txdv commented 13 years ago
name userid uniqueid frag time ping loss adr

1 "blet" 1 STEAM_0:0:14722800 0 01:17 171 0 192.168.178.33:27005 1 users

 name userid uniqueid frag time ping loss adr

1 "blet" 1 STEAM_0:0:14722800 0 00:06 8 0 192.168.178.33:27005 1 users

Once with the newer and with the older engine. There is no difference ... this is a bug. (i removed # since they would introduce shit)

koraktor commented 13 years ago

I just checked my current code with the status line you provided. That's the result:

["1", "blet", "STEAM_0:0:14722800", "0", "171", "0", "192.168.178.33:27005"]

Seems totally fine for me. So there must be another problem. I'll have a look at it.

txdv commented 13 years ago

Hm, I'll run the test again when someone is in my server, maybe the bug is between my monitor and my chair =]

koraktor commented 13 years ago

Anything new on this issue?

koraktor commented 13 years ago

This should now work with the latest changes in master.

Please test again.

koraktor commented 13 years ago

Like said before, this should be fixed. Closing.