Closed txdv closed 13 years ago
Can't test this right now, is it about the split_player_status
method?
Yeah, it really misses it.
Ruby: Fixed wrong method call in RCON-powered player query
Closed by de593dd3dea8360535379a5d7fe1b0453b128ee9
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
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.
The exception is thrown in lib/steam/steam_player.rb the array index is used badly in GoldSrcServer.split_player_status
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.
I'm actually using a not up to date goldsrc server
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.
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.
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)
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.
Hm, I'll run the test again when someone is in my server, maybe the bug is between my monitor and my chair =]
Anything new on this issue?
This should now work with the latest changes in master
.
Please test again.
Like said before, this should be fixed. Closing.
server = GoldSrcServer.new("cs.six.lt") p server.players('rcon_password')
This results in a method missing exception