markweirath / big-brother-bot

Big Brother Bot B3 is a complete and total server administration package for online games. B3 is designed primarily to keep your server free from the derelicts of online gaming, but offers more, much more.
http://www.bigbrotherbot.net
44 stars 32 forks source link

iourt41: missing ip on client auth crashes the bot #87

Open thomasleveil opened 12 years ago

thomasleveil commented 12 years ago

As reported on the forums it exists a case where B3 fails to get the IP of some players.

In such case B3 1.8.2dev4 and below crashes with the error message:

120430 03:14:41 ERROR "STDERR 'IndexError: bclient has no key ip' [('/home/b3/cores/JUMP_1/b3/parser.py', 1002, 'handleEvents', 'hfunc.parseEvent(event)'), ('/home/b3/cores/JUMP_1/b3/parsers/iourt41.py', 714, 'OnClientuserinfo', 'self.onEvent(event)')]"

do not care about line numbers in the extract above. There are from a custom parser

context

status

map: ut4_uberjumps_beta3
num score ping name            lastmsg address               qport rate
--- ----- ---- --------------- ------- --------------------- ----- -----
  0     0  334 Ha[D]e$^7               0 20.30.40.50:27962  39615 25000
  1     0  999 {OMG}^2OjOs^6Aguila^7   4400 30.40.50.60:27960   30244 25000
  2    -2   53 [PoliSh TeAm] Haxxer^7      0 80.50.0.60:27960      31734 25000

players

Map: ut4_uberjumps_beta3
Players: 4
Scores: R:0 B:0
0: Ha[D]e$ RED k:0 d:0 ping:336 20.30.40.50:27962
1: {OMG}OjOsAguila RED k:0 d:0 ping:303  30.40.50.60:27960
2: [PoliShTeAm]Haxxer RED k:-2 d:0 ping:69

dumpuser 2

userinfo
--------
gear                FLAATWA
cl_packetdup        2
rate                25000
name                [PoliSh TeAm] Haxxer
racered             2
raceblue            2
ut_timenudge        0
cg_rgb              255 255 0
funred              patch,ninja,phat
funblue             Diablo
cg_predictitems     0
cg_physics          1
cl_anonymous        0
sex                 male
handicap            100
color2              5
color1              4
team_headmodel      *james
team_model          james
headmodel           sarge
model               sarge
snaps               20
teamtask            0
cl_guid             4128583FD6F924B081D7E10F39712FBB
weapmodes           00000110220000020002

Analysis

Compare to normal rcon responses, the dumpuser and players commands fails to provide the player ip. Only the status command succeed in providing the player ip.

Fix

Consider calling status to get the players' ip

thomasleveil commented 12 years ago

unittest able to reproduce the issue and now passes. Waiting for live test result before closing.

thomasleveil commented 12 years ago

from latest log, the missing IP does not seems to be related to any hack. Still waiting to see the new code in action in a log.

120506 02:21:24 DEBUG '0: Bartman RED k:0 d:0 ping:46 10.33.108.185:27960' 120506 02:21:24 DEBUG '1: asdasdT_Player SPECTATOR k:0 d:0 ping:50' 120506 02:21:24 DEBUG '2: CandyShop RED k:-5 d:4 ping:25 10.23.42.66:51664' 120506 02:21:24 DEBUG '3: BaBy RED k:-1 d:1 ping:196 10.90.74.20:27960' 120506 02:21:24 DEBUG '4: ThiagoBR SPECTATOR k:-2 d:3 ping:267 10.115.62.107:60289' 120506 02:21:24 DEBUG '3: SaRang SPECTATOR k:0 d:0 ping:196 10.90.74.20:27960' 120506 02:21:24 DEBUG '6: Loul|LockDownSP SPECTATOR k:-2 d:2 ping:50' 120506 02:21:24 DEBUG '7: LOSGold SPECTATOR k:0 d:0 ping:62' ... 120506 02:08:24 DEBUG '0: Bartman RED k:0 d:0 ping:50 10.33.108.185:27960' 120506 02:08:24 DEBUG '4: Kratos SPECTATOR k:0 d:0 ping:259 10.115.62.107:60289' 120506 02:08:24 DEBUG '2: CandyShop RED k:-4 d:3 ping:28 10.23.42.66:51664' 120506 02:08:24 DEBUG '3: BaBy RED k:-1 d:1 ping:198 10.90.74.20:27960' 120506 02:08:24 DEBUG '4: ThiagoBR RED k:-2 d:3 ping:266 10.115.62.107:60289' 120506 02:08:24 DEBUG '5: SaRang RED k:0 d:0 ping:50 91.10.250.107:27960' 120506 02:08:24 DEBUG '6: Loul|LockDownSP RED k:0 d:0 ping:50 10.92.73.226:27960' 120506 02:08:24 DEBUG '7: LOSGold RED k:0 d:0 ping:62 85.246.10.69:64581' 120506 02:08:24 DEBUG '0: [Gore]Fenix SPECTATOR k:-2 d:2 ping:50 10.33.108.185:27960' 120506 02:08:24 DEBUG '9: pilantra SPECTATOR k:0 d:0 ping:70'