Donate to the B3 fund!

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

Author Topic: Getting winning team?  (Read 1053 times)

Offline zdanman

  • Full Member
  • ***
  • Posts: 68
Getting winning team?
« on: February 13, 2015, 02:52:07 AM »
I found the following in the console.log of the Insurgency Game Server.

Code: [Select]
L 02/02/2015 - 11:19:29: "Bruce<48><BOT><#Team_Insurgent>" killed "[cid]BigDuke6<29><STEAM_1:1:36614076><#Team_Security>" with "aks74u<12>" at (-4033.311279, 5194.455566, -785.683167)
L 02/02/2015 - 11:19:30: Team "#Team_Insurgent" triggered "Round_Win"
Gamerules: entering state 'GR_STATE_POSTROUND'
Gamerules: entering state 'GR_STATE_PREROUND'
Direct precache of WeaponCache.Explode
Direct precache of WeaponCache.Explode
Direct precache of WeaponCache.Explode

My question is since the text #Team_Insurgent" triggered "Round_Win" is given in the console.log, how do we detect it via b3?.... what namespace/class contains this information?  I'm writing a plugin to track this.

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2508
Re: Getting winning team?
« Reply #1 on: February 13, 2015, 05:11:30 AM »
That event is responded to  by raising the EVT_GAME_ROUND_WIN event since the last update, with Round_Win as the event_name.

B3 gets most of it's info from reading the console.log file.

Offline zdanman

  • Full Member
  • ***
  • Posts: 68
Re: Getting winning team?
« Reply #2 on: February 13, 2015, 04:05:07 PM »
where can i find a doc of all these available events and their parameters?  or do i just have to search the parser code?

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 981
    • GitHub
Re: Getting winning team?
« Reply #3 on: February 13, 2015, 05:41:52 PM »
There is no documentation yet. We will probably provide one when B3 1.10 will be released as stable (but I do not guarantee :) ).
Meantime yes, you can look inside the insurgency parser and inside b3/events.py (standard events)
« Last Edit: February 13, 2015, 05:52:58 PM by Fenix »

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4882
    • Github repository
Re: Getting winning team?
« Reply #4 on: February 13, 2015, 05:45:31 PM »
There is no EVT_GAME_ROUND_WIN event, but the event you can catch in your plugin is EVT_GAME_ROUND_END which has as data a dictionary as follow:
Code: [Select]
{
"team": b3.TEAM_BLUE,
"event_name": "Round_Win",
"properties": None
}


if triggered from
Code: [Select]
L 02/02/2015 - 11:19:30: Team "#Team_Insurgent" triggered "Round_Win"

Relevant code in the parser is: https://github.com/BigBrotherBot/big-brother-bot/blob/release-1.10/b3/parsers/insurgency.py#L485
« Last Edit: February 13, 2015, 05:47:30 PM by Courgette »

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 981
    • GitHub
Re: Getting winning team?
« Reply #5 on: February 13, 2015, 05:54:32 PM »
Maybe we could provide separate events so plugin developers do not have to filter stuff inside plugins

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4882
    • Github repository
Re: Getting winning team?
« Reply #6 on: February 13, 2015, 08:33:19 PM »
the project is opened to contributions ;)

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 981
    • GitHub
Re: Getting winning team?
« Reply #7 on: February 14, 2015, 01:56:27 AM »
the project is opened to contributions ;)
Sneaky ;) ;D ;D ;D

Offline MordyT

  • Support Hero
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: Getting winning team?
« Reply #8 on: February 15, 2015, 02:27:11 AM »
Sneaky ;) ;D ;D ;D
* MordyT looks at Fenix's title and doesn't think it is so sneaky :)
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

 


Rate this page +1 at Google Search