Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!

Author Topic: Bots not firing disconnect events  (Read 1965 times)

Offline zdanman

  • Full Member
  • ***
  • Posts: 68
Bots not firing disconnect events
« on: March 01, 2015, 11:45:33 PM »
Example:  In the following b3.log (line 871) you can see where andrew gets kicked but my EVT_CLIENT_DISCONNECT and EVT_CLIENT_KICK events do not get fired....

Code: [Select]
150301 16:41:39	DEBUG	'BotcontrolPlugin: BotControlEvent: KickBotAll command called'
150301 16:41:39 INFO u'RCON SEND: sm_psay #STEAM_1:0:11514781 "[CiD]: Kicking bot (Andrew)..."'
150301 16:41:39 INFO u'RCON RECEIVED: (Private to [CiD] DanBalls) Console: [CiD]: Kicking bot (Andrew)...\nL 03/01/2015 - 16:41:39: [basechat.smx] "Console<0><Console><Console>" triggered sm_psay to "[CiD] DanBalls<149><STEAM_1:0:11514781><>" (text [CiD]: Kicking bot (Andrew)...)\nL 03/01/2015 - 16:41:39: rcon from "23.81.154.166:54517": command "sm_psay #STEAM_1:0:11514781 "[CiD]: Kicking bot (Andrew)...""\n'
150301 16:41:39 INFO u'RCON SEND: kickid 177'
150301 16:41:39 INFO u'RCON RECEIVED: L 03/01/2015 - 16:41:39: "Andrew<177><BOT><#Team_Insurgent>" disconnected (reason "Kicked by Console")\nL 03/01/2015 - 16:41:39: rcon from "23.81.154.166:54517": command "kickid 177"\n'
150301 16:41:39 INFO 'RCON SEND: sm_say [CiD]: All registered bots were kicked...'
150301 16:41:39 INFO u'RCON RECEIVED: L 03/01/2015 - 16:41:39: [basechat.smx] "Console<0><Console><Console>" triggered sm_say (text [CiD]: All registered bots were kicked...)\nL 03/01/2015 - 16:41:39: rcon from "23.81.154.166:54517": command "sm_say [CiD]: All registered bots were kicked..."\n'
150301 16:41:39 VERBOS2 'Say event handled by AdminPlugin in 47.724 ms'
150301 16:41:39 VERBOSE 'Parsing event: Say: CensorPlugin'
150301 16:41:39 VERBOS2 'Say event handled by CensorPlugin in 0.743 ms'
150301 16:41:39 VERBOSE 'Parsing event: Say: SpamcontrolPlugin'
150301 16:41:39 VERBOS2 'Say event handled by SpamcontrolPlugin in 0.736 ms'
150301 16:41:54 CONSOLE 'L 03/01/2015 - 16:41:54: "Jono<184><BOT><#Team_Security>" killed "Mark<180><BOT><#Team_Insurgent>" with "m249<38>" at (560.567810, 406.272034, 76.361252)'
150301 16:41:54 VERBOS2 "calling on_kill{'a_team': u'#Team_Security', 'a_name': u'Jono', 'v_team': u'#Team_Insurgent', 'a_cid': u'184', 'weapon': u'm249<38>', 'v_guid': u'BOT', 'v_name': u'Mark', 'properties': u' at (560.567810, 406.272034, 76.361252)', 'v_cid': u'180', 'a_guid': u'BOT'}"
150301 16:41:54 DEBUG u'client connected: [BOT184] Jono - BOT184 ({})'
150301 16:41:54 VERBOSE u'Queueing event Client Connect : Client<@0:BOT184|:"Jono":BOT184>'
150301 16:41:54 VERBOSE 'Parsing event: Client Connect: BotcontrolPlugin'
etc....

b3 log found here:
http://www.acedev.net/files/insurgency/diag/bot_disc

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2610
Re: Bots not firing disconnect events
« Reply #1 on: March 02, 2015, 01:14:39 AM »
This is what I get in the 0.13 version:
Code: [Select]
150301 15:06:53	CONSOLE	'L 03/01/2015 - 15:06:53: "Cole<500><BOT><#Team_Insurgent>" disconnected (reason "Kicked by Console")'
150301 15:06:53 VERBOS2 "calling on_client_disconnected{'cid': u'500', 'reason': u'Kicked by Console', 'guid': u'BOT', 'name': u'Cole', 'team': u'#Team_Insurgent'}"
150301 15:06:53 VERBOS2 u'BOT guid is BOT500'
150301 15:06:53 VERBOSE u'Queueing event Client Disconnect : 500'

Not sure why the Kick event isn't firing as well, I'll take a look.

Offline zdanman

  • Full Member
  • ***
  • Posts: 68
Re: Bots not firing disconnect events
« Reply #2 on: March 02, 2015, 08:49:25 PM »
where do you get that version?  i have 1.10 build 334 i think.

Offline zdanman

  • Full Member
  • ***
  • Posts: 68
Re: Bots not firing disconnect events
« Reply #3 on: March 02, 2015, 08:53:32 PM »
http://files.cucurb.net/b3/daily/

thats the only versions i see.  1.10 builds.  0.13 must be really old.

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: Bots not firing disconnect events
« Reply #4 on: March 02, 2015, 09:01:11 PM »
v0.13 of the insurgency parser (which is part of B3 1.10.dev339

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2610
Re: Bots not firing disconnect events
« Reply #5 on: March 03, 2015, 01:15:32 AM »
As far as I can tell the EVT_CLIENT_KICK event will not fire unless there is a plugin waiting for that event to act on it, so as far as I can tell the parser 0.13 is working correctly.

Offline zdanman

  • Full Member
  • ***
  • Posts: 68
Re: Bots not firing disconnect events
« Reply #6 on: March 04, 2015, 01:24:16 AM »
updated to latest build 340... parser is still not calling on_client_disconnected

Code: [Select]
150303 18:19:43	VERBOSE	u'BotcontrolPlugin: Searching for bot under name:paul;'
150303 18:19:43 VERBOSE u'BotcontrolPlugin: Bot found (Client<@0:BOT4|:"Paul":4>);  Kicking...'
150303 18:19:43 INFO u'RCON SEND: sm_psay #STEAM_1:0:11514781 "[CiD]: Kicking bot (Paul)..."'
150303 18:19:43 INFO u'RCON RECEIVED: (Private to [CiD] DanBalls) Console: [CiD]: Kicking bot (Paul)...\nL 03/03/2015 - 18:19:43: [basechat.smx] "Console<0><Console><Console>" triggered sm_psay to "[CiD] DanBalls<2><STEAM_1:0:11514781><>" (text [CiD]: Kicking bot (Paul)...)\nL 03/03/2015 - 18:19:43: rcon from "23.81.154.166:60286": command "sm_psay #STEAM_1:0:11514781 "[CiD]: Kicking bot (Paul)...""\n'
150303 18:19:43 INFO u'RCON SEND: kickid 4'
150303 18:19:43 INFO u'RCON RECEIVED: L 03/03/2015 - 18:19:43: "Paul<4><BOT><#Team_Security>" disconnected (reason "Kicked by Console")\nL 03/03/2015 - 18:19:43: rcon from "23.81.154.166:60286": command "kickid 4"\n'
150303 18:19:43 VERBOS2 'Say event handled by AdminPlugin in 27.745 ms'
150303 18:19:43 VERBOSE 'Parsing event: Say: CensorPlugin'

Please help!

Offline zdanman

  • Full Member
  • ***
  • Posts: 68
Re: Bots not firing disconnect events
« Reply #7 on: March 04, 2015, 01:32:56 AM »
Figured it out.... its because the 'RCON RECEIVED:' text is throwing the parser off...

example:

when they are disconnected normally (without an rcon kick or the like)  it works fine...

so my question is... is it possible to add some sort of flag in the Insurgency Parser regular expressions to ignore text like 'RCON RECEIVED' and such?

Code: [Select]
150303 18:19:56	VERBOS2	'Client Disconnect event handled by CtimePlugin in 0.782 ms'
150303 18:19:56 CONSOLE 'L 03/03/2015 - 18:19:56: "Keith<8><BOT><#Team_Security>" disconnected (reason "Punting bot, server is hibernating")'
150303 18:19:56 VERBOS2 "calling on_client_disconnected{'cid': u'8', 'reason': u'Punting bot, server is hibernating', 'guid': u'BOT', 'name': u'Keith', 'team': u'#Team_Security'}"
150303 18:19:56 VERBOS2 u'BOT guid is BOT8'
150303 18:19:56 VERBOSE u'Queueing event Client Disconnect : 8'
150303 18:19:56 VERBOSE 'Parsing event: Client Disconnect: TkPlugin'
150303 18:19:56 VERBOS2 'Client Disconnect event handled by TkPlugin in 0.798 ms'
150303 18:19:56 VERBOSE 'Parsing event: Client Disconnect: BotcontrolPlugin'
150303 18:19:56 DEBUG 'BotcontrolPlugin: BotControlEvent: onDisconnect called'
150303 18:19:56 VERBOSE u'BotcontrolPlugin: bot noticed. searching for bot (guid = BOT8) in list...'
150303 18:19:56 VERBOSE 'BotcontrolPlugin: bot found - removing...'
150303 18:19:56 VERBOS2 'Client Disconnect event handled by BotcontrolPlugin in 0.760 ms'
150303 18:19:56 VERBOSE 'Parsing event: Client Disconnect: CtimePlugin'
150303 18:19:56 DEBUG u'CtimePlugin: CTIME LEFT:'


The subject b3.log can be found here:

http://www.acedev.net/files/insurgency/diag/340

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2610
Re: Bots not firing disconnect events
« Reply #8 on: March 04, 2015, 03:30:04 AM »
It looks like the issue is that the server doesn't output the kick  details to the console log when kickid is used on a bot (or possibly at all). The line that you are looking at is in the b3 log, rather than the console log, and it woul dneed a complete rewriting of the way the parser works to intercept the rcon reply.

The !kick command uses sm_kick which may or may not work on bots, you could try it and see if it does, and if it outputs to the consolr log. If it doesn't then you could try raising the disconnect and kick events yourself in your plugin once you have done the kickid command.

Offline zdanman

  • Full Member
  • ***
  • Posts: 68
Re: Bots not firing disconnect events
« Reply #9 on: March 07, 2015, 01:51:10 AM »
same effect... now it just outputs a "RCON RECEIVED: sm_kick" line

new code:

Code: [Select]
client.message('Kicking bot (%s)...' % b.name)
self.console.output.write('sm_kick #%s' % g)
  

new b3.log output:

Code: [Select]
150306 18:47:11	DEBUG	u'AdminPlugin: OnSay handle 5:"!kb min"'
150306 18:47:11 DEBUG u'AdminPlugin: handle command !kb min'
150306 18:47:11 DEBUG 'BotcontrolPlugin: BotControlEvent: KickBot command called'
150306 18:47:11 VERBOSE u'BotcontrolPlugin: Searching for bot under name:min;'
150306 18:47:11 VERBOSE u'BotcontrolPlugin: Bot found (Client<@0:BOT228|:"Minh":228>);  Kicking...'
150306 18:47:11 INFO u'RCON SEND: sm_psay #STEAM_1:0:11514781 "[CiD]: Kicking bot (Minh)..."'
150306 18:47:11 INFO u'RCON RECEIVED: (Private to [CiD] DanBalls) Console: [CiD]: Kicking bot (Minh)...\nL 03/06/2015 - 18:47:11: [basechat.smx] "Console<0><Console><Console>" triggered sm_psay to "[CiD] DanBalls<219><STEAM_1:0:11514781><>" (text [CiD]: Kicking bot (Minh)...)\nL 03/06/2015 - 18:47:11: rcon from "23.81.154.166:49905": command "sm_psay #STEAM_1:0:11514781 "[CiD]: Kicking bot (Minh)...""\n'
150306 18:47:11 INFO u'RCON SEND: sm_kick #228'
150306 18:47:11 INFO u'RCON RECEIVED: [SM] Kicked Minh\nL 03/06/2015 - 18:47:11: [basecommands.smx] "Console<0><Console><Console>" kicked "Minh<228><BOT><>" (reason "")\nL 03/06/2015 - 18:47:11: "Minh<228><BOT><#Team_Insurgent>" disconnected (reason "Kicked by Console : Kicked by administrator")\nL 03/06/2015 - 18:47:11: rcon from "23.81.154.166:49905": command "sm_kick #228"\n'
150306 18:47:11 VERBOS2 'Say event handled by AdminPlugin in 31.683 ms'
150306 18:47:11 VERBOSE 'Parsing event: Say: CensorPlugin'
150306 18:47:11 VERBOS2 'Say event handled by CensorPlugin in 0.639 ms'
150306 18:47:11 VERBOSE 'Parsing event: Say: SpamcontrolPlugin'
150306 18:47:11 VERBOS2 'Say event handled by SpamcontrolPlugin in 0.727 ms'
150306 18:47:30 VERBOSE 'Ping check started'
150306 18:47:30 VERBOSE 'Ping check enabled'
150306 18:47:30 INFO 'RCON SEND: status'
150306 18:47:30 INFO u'RCON RECEIVED: hostname: CiD Hardcore Objective - True All Maps Day/Night and more!\nversion : 1.6.6.9/1669 5953 secure  \nudp/ip  : 23.81.154.166:21453  (public ip: 23.81.154.166)\nos      :  Windows\ntype    :  community dedicated\nplayers : 1 humans, 10 bots (24/0 max) (not hibernating)\n\n# userid name uniqueid connected ping loss state rate adr\n# 219 1 "[CiD] DanBalls" STEAM_1:0:11514781 01:10 90 0 active 30000 184.2.69.114:27005\n#220 "Michiel" BOT active\n#221 "Tobias" BOT active\n#222 "Pablo" BOT active\n#223 "Spence" BOT active\n#224 "Chuck" BOT active\n#225 "Kedhrin" BOT active\n#226 "Cole" BOT active\n#227 "Paul" BOT active\n#229 "Charlie" BOT active\n#230 "Jeremy" BOT active\n#end\nL 03/06/2015 - 18:47:30: rcon from "23.81.154.166:49905": command "status"\n'
150306 18:47:30 VERBOS2 'Querying Server Status'

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: Bots not firing disconnect events
« Reply #10 on: March 07, 2015, 03:35:51 AM »
give a try to dev build 348. In this version B3 will disconnect the players right after sending the kick command

 


Rate this page +1 at Google Search