In our support boards we aim to provide support for the B3 core in its current state. Older releases of B3 are NOT supported. Check our front page for the latest version. You may post feature requests in our General Discussion board. Modifications and Hacks of the core B3 code are NOT supported.
Before you ask for support: [ Read the Support Instructions ] - More info: [ Full Support Disclaimer ]

You are here: Big Brother Bot ForumSupport ForumsGame specific SupportBattle Field Bad Company 2 (Moderator: MordyT)BFBC2 parser updates & new plugins
Pages: [1]   Go Down
  Print  
Author Topic: BFBC2 parser updates & new plugins  (Read 1114 times) Bookmark and Share
Former Dev. (senate)
*****
OS: Linux
Type: Home user
Gameservers: BFBC2
Posts: 37
Offline Offline
« on: July 29, 2010, 02:23:37 AM »

Hi All,

I am in the process of fixing bugs and adding new functionality to the bfbc2 parser as well as creating some new plugins.

If you would like to follow my work, please keep an eye on my github repo or download the latest revision.

All code is considered unstable but should work fine, I have done extensive testing on my own servers.

If you find any bugs please let me know

Weapon restriction plugin can be found here
« Last Edit: July 29, 2010, 04:52:46 AM by Durzo » Logged


Jr. Member
**
OS: Linux
Type: Home user
Posts: 16
Offline Offline
« Reply #1 on: August 01, 2010, 04:34:01 PM »

So far the parser works; it's collecting stats again.  Smiley Good work.

My game server provider has their own admin daemon tool and I want to use that instead since everyone is accustomed to it already. Is there a way to disable the B3 one and only have it collect stats? I tried to comment out plugin_admin but then B3 won't run.
Logged
Former Dev. (senate)
*****
OS: Linux
Type: Home user
Gameservers: BFBC2
Posts: 37
Offline Offline
« Reply #2 on: August 01, 2010, 08:10:11 PM »

You can try this, not sure if it will work.
Open plugins/admin.py and around line 96 should look like:

Code:
    def startup(self):
        self.registerEvent(b3.events.EVT_CLIENT_SAY)
        self.registerEvent(b3.events.EVT_CLIENT_PRIVATE_SAY)
        self.createEvent('EVT_ADMIN_COMMAND', 'Admin Command')

Comment out the last line, so it looks like:

Code:
    def startup(self):
        self.registerEvent(b3.events.EVT_CLIENT_SAY)
        self.registerEvent(b3.events.EVT_CLIENT_PRIVATE_SAY)
        #self.createEvent('EVT_ADMIN_COMMAND', 'Admin Command')
Logged

Jr. Member
**
OS: Linux
Type: Home user
Posts: 16
Offline Offline
« Reply #3 on: August 01, 2010, 10:10:54 PM »

Commented out that line but still no go. When in game for example:

Code:
Trecherous: !yell hey everyone
Server: (b3): [pm] Unrecognized command yell

The default server admin daemon sees the !yell fine and executes it, but B3 also tries too at the same time (which is what I'm trying to disable).  Huh
Logged
Former Dev. (senate)
*****
OS: Linux
Type: Home user
Gameservers: BFBC2
Posts: 37
Offline Offline
« Reply #4 on: August 01, 2010, 10:23:45 PM »

go through plugins/admin.py and comment out all the lines that have self.registerEvent(something) and self.createEvent(something), there may be a few more.

Also, you have to stop/start b3 after you make the changes.

Logged

Former Dev. (senate)
*****
OS: Linux
Type: Home user
Gameservers: BFBC2
Posts: 37
Offline Offline
« Reply #5 on: August 01, 2010, 10:28:10 PM »

The other thing you could do is edit the conf/admin.xml
- change all commands for level 0 to level 1: this will stop people from registering
- change command_prefix to something other than !, for example make it 'disabledxyz'

this is probably easier than editing the plugin directly and should do the trick in disabling B3 responding to commands
Logged

Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3478
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #6 on: August 01, 2010, 11:27:22 PM »

or in the admin plugin, just make the level required to use the command higher than 1
Logged

Jr. Member
**
OS: Linux
Type: Home user
Posts: 16
Offline Offline
« Reply #7 on: August 02, 2010, 01:50:38 AM »

Is this what I have to change to 1?

Code:
<set name="pm_global">1</set>

What if I change the command prefix to something else besides " ! " ? Then if I use a command such as !tban (temp ban), then BC2 won't read it?

Code:
<set name="command_prefix">!</set>

Here's my plugin_admin

Code:
<configuration plugin="admin">
<settings name="commands">
<set name="enable">100</set>
<set name="disable">100</set>
<set name="die">100</set>
<set name="reconfig">100</set>
<set name="restart">100</set>
<set name="mask">100</set>
<set name="unmask">100</set>
<set name="runas-su">100</set>

<set name="pause">90</set>
<set name="rebuild">90</set>
<set name="clientinfo">90</set>
<set name="putgroup">90</set>
<set name="ungroup">90</set>

<set name="permban-pb">80</set>
<set name="map">80</set>
<set name="maprotate">80</set>
<set name="warnclear-wc">80</set>
<set name="clear-kiss">80</set>
<set name="lookup-l">80</set>
<set name="makereg-mr">80</set>
<set name="spankall-sall">80</set>
<set name="banall-ball">80</set>
<set name="kickall-kall">80</set>
<set name="pbss">80</set>

<set name="ban-b">60</set>
<set name="unban">60</set>
<set name="spank-sp">60</set>

<set name="tempban-tb">40</set>
<set name="baninfo-bi">40</set>
<set name="kick-k">40</set>
<set name="admintest">40</set>
<set name="scream">40</set>
<set name="notice">40</set>

<set name="find">20</set>
<set name="aliases-alias">20</set>
<set name="warns">20</set>
<set name="warninfo-wi">20</set>
<set name="warnremove-wr">20</set>
<set name="warn-w">20</set>
<set name="warntest-wt">20</set>
<set name="spams">20</set>
<set name="spam-s">20</set>
<set name="list">20</set>
<set name="admins">20</set>
<set name="say">20</set>
<set name="status">20</set>
<set name="leveltest-lt">20</set>
<set name="poke">20</set>

<set name="b3">9</set>

<set name="seen">2</set>
<set name="maps">2</set>
<set name="nextmap">2</set>

<set name="regtest">1</set>
<set name="time">1</set>

<set name="help-h">0</set>
<set name="register">0</set>
<set name="rules-r">0</set>
</settings>
<settings name="settings">
<set name="noreason_level">100</set>
<set name="hidecmd_level">60</set>
<set name="long_tempban_level">80</set>
<set name="long_tempban_max_duration">3h</set>
<set name="command_prefix">!</set>
<set name="command_prefix_loud">@</set>
<set name="admins_level">20</set>
<set name="ban_duration">14d</set>
</settings>
<settings name="messages">
<set name="ban_denied">^7Hey %s^7, you're no Elvis, can't ban %s</set>
<set name="help_available">^7Available commands: %s</set>
<set name="temp_ban_self">^7%s ^7Can't ban yourself newb</set>
<set name="groups_in">^7%s^7 is in groups %s</set>
<set name="say">^7%s^7: %s</set>
<set name="player_id">^7[^2%s^7] %s^7</set>
<set name="seen">^7%s ^7was last seen on %s</set>
<set name="help_no_command">^7Command not found %s</set>
<set name="lookup_found">^7[^2@%s^7] %s^7 (^3%s^7)</set>
<set name="kick_self">^7%s ^7Can't kick yourself newb!</set>
<set name="groups_welcome">^7You are now a %s</set>
<set name="warn_denied">%s^7, %s^7 owns you, can't warn</set>
<set name="groups_already_in">^7%s^7 is already in group %s</set>
<set name="temp_ban_denied">^7Hey %s^7, you're no ^1Red ^7Elvis, can't temp ban %s</set>
<set name="players_matched">^7Players matching %s %s</set>
<set name="ban_self">^7%s ^7Can't ban yourself newb!</set>
<set name="regme_annouce">^7%s ^7put in group %s</set>
<set name="kick_denied">^7%s^7 gets 1 point, %s^7 gets none, %s^7 wins, can't kick</set>
<set name="no_players">^7No players found matching %s</set>
<set name="spanked_reason">%s ^7was ^1SPANKED^7 by %s ^7for %s</set>
<set name="groups_added">^7%s ^7added to group %s</set>
<set name="groups_put">^7%s ^7put in group %s</set>
<set name="groups_none">^7%s^7 is not in any groups</set>
<set name="help_command">^2%s%s ^7%s</set>
<set name="warn_self">^7%s ^7Can't warn yourself newb!</set>
<set name="regme_regged">^7You are now a %s</set>
<set name="help_none">^7You have no available commands</set>
<set name="spanked">%s ^7was ^1SPANKED^7 by %s</set>
<set name="admins">^7Admins online: %s</set>
<set name="time">At the sound of the beep it will be ^3%s^7...(beeeep)</set>
<set name="unknown_command">^7Unrecognized command %s</set>
<set name="leveltest">^7%s ^7(^3@%s^7) is a ^3%s ^7[^2%s^7] since %s</set>
<set name="leveltest_nogroups">^7%s ^7(^3@%s^7) is not in any groups</set>
<set name="aliases">^7%s^7 aliases: %s</set>
<set name="warn_kick_alert">^1ALERT^7: $name^7 auto-kick from warnings if not cleared (^3$warnings^7)</set>
<set name="warn_ban_alert">^1ALERT^7: $name^7 auto-ban from warnings if not cleared (^3$warnings^7)</set>
</settings>
<settings name="warn">
<!-- This setting determines whether the warning is sent to the the whole server, or just the player and admin, to reduce chatbox spam.
0 is whole server, 1 is private.
-->
<set name="pm_global">0</set>
<!-- THESE APPEAR TO BE OBSOLETE - DO NOT USE - mindriot - 10/20/2008
<set name="ban_reason">^7too many warnings ^1BANNED: $reason</set>
<set name="ban_num">5</set>
<set name="kick_num">3</set>
<set name="kick_duration">2</set>
<set name="ban_duration">1h</set>
<set name="kick_reason">^7too many warnings: $reason</set>
-->

<set name="alert_kick_num">3</set>
<set name="instant_kick_num">5</set>
<set name="tempban_num">6</set>
<set name="tempban_duration">1d</set>
<set name="max_duration">1d</set>
<set name="message">^1WARNING^7 (^3$warnings^7): $reason</set>
<set name="warn_delay">15</set>
<set name="reason">^7too many warnings: $reason</set>
<set name="duration_divider">30</set>
<set name="alert">^1ALERT^7: $name^7 auto-kick from warnings if not cleared (^3$warnings^7) $reason</set>
</settings>
<settings name="spamages">
<set name="vent">^3Ventrilo voice chat: ^269.93.232.106:3803 ^3password ^2nffoov^3, www.ventrilo.org</set>
<set name="join">^3Join Austin Server by signing up on the forums at www.austinserver.com</set>
<set name="forum">^3Visit the Austin Server forums at www.austinserver.com</set>
<set name="rtfm">^3RTFM! www.austinservers.com</set>
<set name="stack">^7No clan stacking, members must split evenly between the teams, go spectator and wait if you have to</set>

<set name="rule1">^3Rule #1: No racism of any kind</set>
<set name="rule2">^3Rule #2: No clan stacking, members must split evenly between the teams</set>
<set name="rule3">^3Rule #3: No arguing with admins (listen and learn or leave)</set>
<set name="rule4">^3Rule #4: No abusive language or behavior towards admins or other players</set>
<set name="rule5">^3Rule #5: No offensive or potentially offensive names, annoying names, or in-game (double caret (^)) color in names</set>
<set name="rule6">^3Rule #6: No recruiting for your clan, your server, or anything else</set>
<set name="rule7">^3Rule #7: No advertising or spamming of websites or servers</set>
<set name="rule8">^3Rule #8: No profanity or offensive language (in any language)</set>
<set name="rule9">^3Rule #9: Do ^1NOT ^3fire at teammates or within 10 seconds of spawning</set>
<set name="rule10">^3Rule #10: Offense players must play for the objective and support their team</set>
</settings>
<settings name="warn_reasons">
<set name="generic">1h, ^7</set>
<set name="default">1h, ^7behave yourself</set>

<set name="rule1">10d, /spam#rule1</set>
<set name="rule2">1d, /spam#rule2</set>
<set name="rule3">1d, /spam#rule3</set>
<set name="rule4">1d, /spam#rule4</set>
<set name="rule5">1h, /spam#rule5</set>
<set name="rule6">1d, /spam#rule6</set>
<set name="rule7">1d, /spam#rule7</set>
<set name="rule8">3d, /spam#rule8</set>
<set name="rule9">3h, /spam#rule9</set>
<set name="rule10">3d, /spam#rule10</set>

<set name="stack">1d, /spam#stack</set>

<set name="lang">/rule8</set>
<set name="language">/rule8</set>
<set name="cuss">/rule8</set>
<set name="profanity">/rule8</set>

<set name="name">/rule5</set>
<set name="color">1h, ^7No in-game (double caret (^)) color in names</set>
<set name="badname">1h, ^7No offensive, potentially offensive, or annoying names</set>
<set name="spec">/spectator</set>


<set name="adv">/rule7</set>
<set name="racism">/rule1</set>
<set name="stack">/rule2</set>
<set name="recruit">/rule6</set>
<set name="argue">/rule3</set>
<set name="sfire">/rule9</set>
<set name="spawnfire">/rule9</set>
<set name="jerk">/rule4</set>

<set name="afk">5m, ^7you appear to be away from your keyboard</set>
<set name="tk">1d, ^7stop team killing!</set>
<set name="obj">1h, ^7go for the objective!</set>
<set name="camp">1h, ^7stop camping or you will be kicked!</set>
<set name="fakecmd">1h, ^7do not use fake commands</set>
<set name="nocmd">1h, ^7do not use commands that you do not have access to, try using !help</set>
<set name="ci">5m, ^7connection interupted, reconnect</set>
<set name="spectator">5m, ^7spectator too long on full server</set>
<set name="spam">1h, ^7do not spam, shut-up!</set>
</settings>
</configuration>
Logged
Former Dev. (senate)
*****
OS: Linux
Type: Home user
Gameservers: BFBC2
Posts: 37
Offline Offline
« Reply #8 on: August 02, 2010, 05:57:30 AM »

if you change the command prefix, you just use the new one.

Change these to below settings:
Code:
<set name="help-h">1</set>
<set name="register">1</set>
<set name="rules-r">1</set>

and

Code:
<set name="command_prefix">!b3</set>

then if you want to temp ban someone use !b3tban
Logged

Jr. Member
**
OS: Linux
Type: Home user
Posts: 16
Offline Offline
« Reply #9 on: August 02, 2010, 11:38:42 AM »

Works by changing "!" to "!b3" or something else. Thanks!  Grin
Logged
B3 Contrib/Support
*
OS: --No B3 installed--
Type: --No B3 installed--
Posts: 1225
Offline Offline
Support Specialty: B3-Core, CoD/BFBC2 parsers, FTP-functionality, Plugin development
« Reply #10 on: August 02, 2010, 03:43:50 PM »

Alternatively, in admin.py you could change (on line 213)

Code: python
        elif len(event.data) >= 2 and (event.data[:1] == self.cmdPrefix or event.data[:1] == self.cmdPrefixLoud or event.data[:1] == self.cmdPrefixBig):
           self.debug('Handle command %s' % event.data)

to

Code: python
        elif len(event.data) >= 2 and (event.data[:1] == self.cmdPrefix or event.data[:1] == self.cmdPrefixLoud or event.data[:1] == self.cmdPrefixBig):
           self.debug('Handle command %s' % event.data)
           return

which would just ignore all uses of !commands. B3 would still collect stats, but you wouldn't be able to use !xlrstats or !xlrtopstats, just the webfront.

You could do more complicated things where it would only recognise !xlrstats and !xlrtopstats, so just ask if you need.
Logged

[ www.xlrstats.com ]
Project Lead
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD, CoD2, CoD5, UrT
Posts: 2022
Offline Offline
WWW
Support Specialty: B3-Core, CoD/UrT/WoP/ETPro parsers, Plugin development
« Reply #11 on: August 02, 2010, 04:26:31 PM »

admin.py is the heart of B3. Without that B3 is just a shadow of it's own potential. It hurts to see it ripped out...
Logged

Tags: bfbc2  bc2 
Pages: [1]   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal