Big Brother Bot (B3)

Updated: 2005-07-10 15:26:00

Links [contents]

Official website - www.bigbrotherbot.com
Forums - www.bigbrotherbot.com/forums

About [contents]

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. With the stock configuration files, B3 will will keep your server free from offensive language, and team killers alike. A completely automated and customizable warning system will warn the offending players that this type of behavior is not allowed on your server, and ultimately kick, and or ban them for a predetermined time limit.

B3 was designed to be easily ported to other online games. Currently, B3 is in production for Call of Duty and Call of Duty: United Offensive. An Enemy Territory version is in development. Since these games are based on the Quake III Arena engine, conversion to any game using the engine should be easy.

Plugins provide much of the functionality for B3. These plugins can easily be configured. An SDK will be provided to make your own plugins. I can also make custom plugins for you for a fee.

The future of server adminning has arrived. Big Brother Bot is here to take charge of your server. Now its time to relax, enjoy some gaming, and not worry about the everyday adminning that used to keep you busy while everyone else was having fun. Install B3 today, and rest easy knowing your server is safe, friendly, and jerk free 24/7.

Name Origin

Big Brother is the nominal leader of Oceania in Nineteen Eighty-Four, George Orwell's chilling dystopic novel. The name is now used to mean surveillance in general, usually by a government.

Quoted from Wikipedia

B3's primary purpose is to facilitate surveillance of games servers so Big Brother seemed like an obvious choice. Thanks to kNox.

Big Brother Bot is watching you!

Status of Documentation

This document is far from complete. It is a first stab at documenting the massive B3 project for system administrators, moderators, and users.

Changelog

7/10/2005 - MT

7/8/2005 - MT

5/24/2005 - MT

5/22/2005 - MT

5/16/2005 - MT

5/14/2005 - MT

5/12/2005 - MT

5/8/2005 - MT

5/2/2005 - MT

4/29/2005 - MT

Contents [contents]

  1. Links
  2. About
    1. Name Origin
    2. Status of Documentation
      1. Changelog
  3. Contents
  4. Features
  5. License
  6. Setup
    1. Requirements
    2. Assumptions
    3. Install
    4. Database Setup
    5. Running
      1. Linux
      2. Windows
      3. All Systems
    6. Configuration
      1. b3.cfg
      2. Admin Plugin Configuration
        1. Warning Configuration
      3. TK Plugin Configuration
      4. Status Plugin Configuration
    7. Installing Plugins
  7. Usage
    1. Administration
    2. User Roles and Groups
      1. Super Admin
      2. Senior Admins
      3. Full Admins
      4. Admins
      5. Moderators
      6. Regulars
      7. Users
  8. Plugins
    1. Admin Plugin
      1. Warnings
        1. Automated Warnings
      2. Spammages
    2. TK Plugin
    3. Censor Plugin
    4. Spam Control Plugin
    5. Ping Watch Plugin
    6. Advertisement Plugin
    7. Status Plugin
    8. Stats Plugin
    9. Custom Plugins
  9. Command Reference
    1. Time Suffixes
    2. Player Identification
      1. Partial Name
      2. Client ID
      3. Database ID
    3. Private Commands
    4. Admin Plugin Commands
      1. !register
      2. !help
      3. !regtest
      4. !time
      5. !maps
      6. !nextmap
      7. !seen
      8. !admins
      9. !b3
      10. !greeting
      11. !list
      12. !say
      13. !spam
      14. !spams
      15. !warn
      16. !warninfo
      17. !warnremove
      18. !warns
      19. !warntest
      20. !admintest
      21. !aliases
      22. !baninfo
      23. !find
      24. !kick
      25. !leveltest
      26. !scream
      27. !tempban
      28. !ban
      29. !spank
      30. !pbss
      31. !permban
      32. !clear
      33. !lookup
      34. !makereg
      35. !map
      36. !restart
      37. !warnclear
      38. !clientinfo
      39. !cmdlevel
      40. !delgroup
      41. !editgroup
      42. !groups
      43. !newgroup
      44. !pause
      45. !putgroup
      46. !rebuild
      47. !ungroup
      48. !die
      49. !disable
      50. !enable
      51. !reconfig
      52. !mask
      53. !unmask
      54. !runas
    5. TK Plugin Commands
      1. !forgive
      2. !forgiveall
      3. !forgiveprev
      4. !forgivelist
      5. !grudge
      6. !forgiveinfo
      7. !forgiveclear
    6. Stats Plugin Commands
      1. !mapstats
      2. !testscore
  10. Plugin SDK
    1. Database Connection
    2. Example Plugin
    3. Calling Other Plugins
    4. Creating User Commands
      1. Command Callbacks
    5. Console (Parser Object)
    6. Plugin Object
    7. Events
    8. Event Object
    9. Event Types
    10. Cron Object
    11. CronTab Object
    12. OneTimeCronTab Object
      1. Command Object
    13. Client Object
    14. ClientVar Object
    15. Game Object
    16. Notes
  11. FAQ
    1. General Questions
      1. Does B3 have stats?
    2. Plugin Questions
      1. How can I temporarily disable a plugin?
      2. How do I make custom plugins?
      3. Why doesn't my plugin load?
    3. Setup Questions
      1. What do I do when B3 starts but nothing happens?
  12. Contributors

Features [contents]

License [contents]

Copyright (c) 2005, Michael "ThorN" Thornton www.BigBrotherBot.com
All rights reserved.

Redistribution and use in binary forms, with or without
modification, are permitted provided that the following conditions are
met:

    * BETA releases may not be redistributed.
    * Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
    * Neither the name of Michael "ThorN" Thornton, 
www.BigBrotherBot.com, nor the names of its contributors may be used
to endorse or promote products derived from this software without
specific prior written permission.
	* Michael "ThorN" Thornton reserves the right to issue, deny, or 
revoke IP Keys licenses to any server, group or individual at 
his sole discretion.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Setup [contents]

Requirements

B3 IP Key License - You only need one per IP, not IP/port combination.
Python 2.3
MySQL-python Tested with 0.9.2 and 1.0
MySQL Tested with 3.23

Assumptions

I assume you know how to use/install python, MySQL, and your operating system. If not you should consult the documentation for these if you have problems or questions on how to administer each.

Install

Download the package
Extract the package to a suitable location, example: /usr/local/games/b3

DO NOT extract b3lib.zip unless you want to break everything.

Database Setup

To setup MySQL you can use the default b3 SQL scripts.

Create a user that has full permissions on this database for B3:

Download B3 database/user SQL and save to a file. Open the file in a text editor and change <password> to the password you want to use with B3. Execute the command below. Make sure you are in the directory that you saved the .sql script to. You may need to enter your MySQL password. If you do not have a password, remove "-p <mysql password>" from the command below.

Execute:

mysql -u root -p <mysql password> < b3-db.sql

Create the B3 tables:

Download B3 table SQL and save to a file. Execute the command below. Make sure you are in the directory that you saved the .sql script to. You may need to enter your MySQL password. If you do not have a password, remove "-p <mysql password>" from the command below.

Execute:

mysql -u root -p <mysql password> < b3.sql

Your B3 database should be configured and ready to go.

Running

Linux

You should run B3 as the same user as your game server

Make sure B3 shell scripts have execute permissions:
Example:

cd /usr/local/games/b3 
chmod 755 *.sh

Make sure the .sh files point to your correct Python installation.

Example:

PYTHON="/usr/local/bin/python2.3"

Run

cd /usr/local/games/b3 
./b3.sh > /dev/null &

Windows

Edit the b3 shortcut and make sure the Target points to your python install.

Example:

C:\Python23\python.exe "b3_run.py"

Make sure Start In points to your b3 directory.

./b3.lnk you can just double click the b3 shortcut

You can now just click the b3 shortcut to run.

All Systems

You can check the status by monitoring the b3.log

Linux Example:

tail -n100 -f b3.log

Connect to the server and type !iamgod. This will register you as the server owner.

If you have any problems, check b3.log.

Tip:

You may have to set iamgod to 0 in plugin_admin.cfg to use it. Make sure it is set back to "none" after you have been set as the Super Admin.

Configuration

b3.cfg

[b3] Section

[b3]
; parser: What game parser to run.
; Default cod
parser = cod
; database: Database connection.
; Format <scheme>://<username>:<password>@<host>/<database>
; Example mysql://b3:password@localhost/b3
database = mysql://b3:password@localhost/b3
; bot_name: Name to display of B3.
; Default b3
bot_name = b3
; bot_prefix: Prefix to show before B3 messages. Must have "%s" for the bot_name
; Default ^0(^2%s^0)^7:
bot_prefix = ^0(^2%s^0)^7:
; time_format: Time display format.
; Default %I:%M%p %Z %m/%d/%y
time_format = %I:%M%p %Z %m/%d/%y
; ipk: Location of B3 IP Key file.
; Default b3.ipk
ipk = b3.ipk
; rcon_password: Rcon password.
; Default password
rcon_password = password
; rcon_port: Rcon/server port.
; Default 28960
rcon_port = 28960
; game_log: Game log for B3 to process.
; Default games_mp.log
game_log = games_mp.log
; log_level: How much to log. 9 = verbose, 10 = debug, 21 = bot, 22 = console. Leave log_level at 9 for debugging, If there is a bug found I will need your b3.log.
; Default 9
log_level = 9
; logfile: B3 log file. See b3.log_level
; Default b3.log
logfile = b3.log
; welcome: Who to welcome
1 = welcome_newb
2 = welcome_announce_user
4 = welcome_first
8 = welcome_announce_first
16 = welcome_user
add numbers, example 31 = all
; Default 31
welcome = 31

[plugins] Section

[plugins]
; #.pluginname: Plugins to load by order.
; Default conf/plugin_pluginname.cfg
#.pluginname = conf/plugin_pluginname.cfg
[plugins]
; Default plugins
1.censor = conf/plugin_censor.cfg
2.spamcontrol = conf/plugin_spamcontrol.cfg
3.admin = conf/plugin_admin.cfg
4.tk = conf/plugin_tk.cfg
5.stats = conf/plugin_stats.cfg
6.pingwatch = conf/plugin_pingwatch.cfg
7.adv = conf/plugin_adv.cfg
8.status = conf/plugin_status.cfg

[messages] Section

[messages]
; kicked_by: Message to display when a user is kicked.
; Default %s^7 was kicked by %s^7 %s
kicked_by = %s^7 was kicked by %s^7 %s
; kicked: Message to display when a user is kicked by B3.
; Default %s^7 was kicked %s
kicked = %s^7 was kicked %s
; banned_by: Message to display when a user is banned.
; Default %s^7 was banned by %s^7 %s
banned_by = %s^7 was banned by %s^7 %s
; banned: Message to display when a user is banned by B3.
; Default %s^7 was banned%s
banned = %s^7 was banned%s
; temp_banned_by: Message to display when a user is temp-banned.
; Default %s^7 was temp banned by %s^7 for %s^7 %s
temp_banned_by = %s^7 was temp banned by %s^7 for %s^7 %s
; temp_banned: Message to display when a user is temp-banned by B3.
; Default %s^7 was temp banned for %s^7 %s
temp_banned = %s^7 was temp banned for %s^7 %s
; unbanned_by: Message to display when a user is un-banned.
; Default %s^7 was un-banned by %s^7 %s
unbanned_by = %s^7 was un-banned by %s^7 %s
; unbanned: Message to display when a user is un-banned by B3.
; Default %s^7 was un-banned %s
unbanned = %s^7 was un-banned %s
; welcome_*: Welcome messages
%(name)s = player name
%(id)s = player id
%(lastVisit)s = last visit time (only on welcome_user and welcome_newb)
%(group)s = players group (only on welcome_user)
%(connections)s = number of times a user has connected (only on welcome_user and welcome_announce_user)
; Default ''
welcome_* = ''
; welcome_user: displayed to admins and regs
; Default ^7[^2Authed^7] Welcome back %(name)s ^7(^3@%(id)s^7), last visit ^3%(lastVisit)s^7, you're a ^2%(group)s^7, played %(connections)s times
welcome_user = ^7[^2Authed^7] Welcome back %(name)s ^7(^3@%(id)s^7), last visit ^3%(lastVisit)s^7, you're a ^2%(group)s^7, played %(connections)s times
; welcome_newb: displayed to users who have not yet registered
; Default ^7[^2Authed^7] Welcome back %(name)s ^7(^3@%(id)s^7), last visit ^3%(lastVisit)s. Type !register in chat to register. Type !help for help
welcome_newb = ^7[^2Authed^7] Welcome back %(name)s ^7(^3@%(id)s^7), last visit ^3%(lastVisit)s. Type !register in chat to register. Type !help for help
; welcome_announce_user: displayed to everyone when a player with less than 15 connections joins
; Default ^7Everyone welcome back %(name)s^7, player number ^3#%(id)s^7, to the server, played %(connections)s times
welcome_announce_user = ^7Everyone welcome back %(name)s^7, player number ^3#%(id)s^7, to the server, played %(connections)s times
; welcome_first: displayed to a user on his first connection
; Default ^7Welcome %(name)s^7, this must be your first visit, you are player ^3#%(id)s. Type !help for help
welcome_first = ^7Welcome %(name)s^7, this must be your first visit, you are player ^3#%(id)s. Type !help for help
; welcome_announce_first: displayed to everyone when a player joins for the first time
; Default ^7Everyone welcome %(name)s^7, player number ^3#%(id)s^7, to the server
welcome_announce_first = ^7Everyone welcome %(name)s^7, player number ^3#%(id)s^7, to the server

Admin Plugin Configuration

[settings] Section

[settings]
; noreason_level: Minimum level needed to use !kick, !ban, etc. without giving a reason.
; Default 100
noreason_level = 100
; hidecmd_level: Minimum level needed to use private commands.
; Default 60
hidecmd_level = 60
; long_tempban_level: Minimum level needed to use a !tempban longer than 1 day.
; Default 80
long_tempban_level = 80
; command_prefix: Default command prefix.
; Default !
command_prefix = !
; command_prefix_loud: Loud command prefix, see loud command prefix
; Default @
command_prefix_loud = @
; admins_level: Minimum level needed to be considered an admin/moderator.
; Default 20
admins_level = 20
; ban_duration: How long to ban a user for with the !ban command.
; Default 14d
ban_duration = 14d

[warn] Section

[warn]
; reason: Message displayed when a user is temp-banned from warnings. "%s" is where the reason goes.
; Default ^7too many warnings: %s
reason = ^7too many warnings: %s
; alert_kick_num: After this many warnings a user will be alerted and temp-banned if warnings are not removed.
; Default 3
alert_kick_num = 3
; instant_kick_num: After this many warnings a user is temp-banned without warning.
; Default 5
instant_kick_num = 5
; tempban_num: After this many warnings a user is automatically temp-banned for tempban_duration.
; Default 6
tempban_num = 6
; tempban_duration: How long a user is temp-banned for if he reaches tempban_num warnings.
; Default 1d
tempban_duration = 1d
; max_duration: The maximum duration B3 will temp-ban for warnings.
; Default 1d
max_duration = 1d
; message: The message prefix displayed when a user gets a warning. "%s" is the number of warnings the user has.
; Default ^1WARNING^7 (^3%s^7):
message = ^1WARNING^7 (^3%s^7):
; warn_delay: How many seconds an admin has to wait before a user can be warned again. This is to prevent two admins warning for the same thing at the same time.
; Default 15
warn_delay = 15
; duration_divider: The number used to dived the total warning activity time by to determine how long to temp-ban the user.
; Default 30
duration_divider = 30
; alert: The alert message displayed when a user reaches alert_kick_num warnings. "%(warnings)s" is the number of warnings the user has. "%(name)s" is the user's name.
; Default ^1ALERT^7: %(name)s^7 auto-kick from warnings if not cleared (^3%(warnings)s^7)
alert = ^1ALERT^7: %(name)s^7 auto-kick from warnings if not cleared (^3%(warnings)s^7)

[commands] Section

[commands]
; command: Each command is assigned a minimum user level. A command shortcut follows the command name. For example, in "permban-pb", "permban" is the command and "pb" is the command shortcut. The keyword "none" disables a command. A dash in the level defines the minium and maximum levels allowed to use the command. For example, 0-1 has a minimum level of 0 and a max of 1.
; Default 0
command = 0
[commands]
iamgod = none

enable = 100
disable = 100
die = 100
reconfig = 100
restart = 100
mask = 100
unmask = 100

cmdlevel = 90
pause = 90
rebuild = 90
ungroup = 90
delgroup = 90
putgroup = 90
clientinfo = 90
editgroup = 90
groups = 90
newgroup = 90

permban-pb = 80
map = 80
maprotate = 80
warnclear-wc = 80
clear-kiss = 80
lookup-l = 80
makereg-mr = 80
spankall-sall = 80
banall-ball = 80
kickall-kall = 80

ban-b = 60
unban = 60
spank-sp = 60

tempban-tb = 40
aliases-alias = 40
baninfo-bi = 40
find = 40
kick-k = 40
admintest = 40
scream = 40

warns = 20
warninfo-wi = 20
warnremove-wr = 20
warn-w = 20
warntest-wt = 20
spams = 20
spam-s = 20
list = 20
admins = 20
say = 20
status = 20
leveltest-lt = 20

b3 = 9
greeting = 9

seen = 2
maps = 2
nextmap = 2

regtest = 1
time = 1

help-h = 0
register = 0-0
rules-r = 0

[spamages] Section

[spamages]
; keyword: A message template displayed by the !spam command. Messages that begin with "rule" and followed by a number are displayed by the !rules command.
; Default message
keyword = message
[spamages]
rule1 = ^3Rule #1: No racism of any kind 
rule2 = ^3Rule #2: No clan stacking, members must split evenly between the teams 
rule3 = ^3Rule #3: No arguing with admins (listen and learn or leave) 
rule4 = ^3Rule #4: No abusive language or behavior towards admins or other players 
rule5 = ^3Rule #5: No offensive or potentially offensive names, annoying names, or in-game (double caret (^)) color in names 
rule6 = ^3Rule #6: No recruiting for your clan, your server, or anything else
rule7 = ^3Rule #7: No advertising or spamming of websites or servers 
rule8 = ^3Rule #8: No profanity or offensive language (in any language) 
rule9 = ^3Rule #9: Do ^1NOT ^3fire at teammates or within 10 seconds of spawning 
rule10 = ^3Rule #10: Offense players must play for the objective and support their team

[messages] Section

[messages]
; keyword: Various messages used by B3.
; Default message
keyword = message
[messages]
ban_denied = ^7Hey %s^7, you're no Elvis, can't ban %s
help_available = ^7Available commands: %s
greeting_yours = ^7Your greeting is %s
temp_ban_self = ^7%s ^7Can't ban yourself newb
groups_in = ^7%s^7 is in groups %s
greeting_bad = ^7Greeting is not formated properly: %s
say = ^7%s^7: %s
player_id = ^7[^2%s^7] %s^7
seen = ^7%s ^7was last seen on %s
help_no_command = ^7Command not found %s
lookup_found = ^7[^2@%s^7] %s^7 (^3%s^7)
kick_self = ^7%s ^7Can't kick yourself newb!
groups_welcome = ^7You are now a %s
greeting_changed = ^7Greeting changed to: %s
greeting_cleared = ^7Greeting cleared
warn_denied = %s^7, %s^7 owns you, can't warn
groups_already_in = ^7%s^7 is already in group %s
temp_ban_denied = ^7Hey %s^7, you're no ^1Red ^7Elvis, can't temp ban %s
players_matched = ^7Players matching %s %s
ban_self = ^7%s ^7Can't ban yourself newb!
regme_annouce = ^7%s ^7put in group %s
kick_denied = ^7%s^7 gets 1 point, %s^7 gets none, %s^7 wins, can't kick
no_players = ^7No players found matching %s
spanked_reason = %s ^7was ^1SPANKED^7 by %s ^7for %s
groups_added = ^7%s ^7added to group %s
groups_put = ^7%s ^7put in group %s
groups_none = ^7%s^7 is not in any groups
help_command = ^2%s%s ^7%s
greeting_empty = ^7Your have no greeting set
warn_self = ^7%s ^7Can't warn yourself newb!
regme_regged = ^7You are now a %s
help_none = ^7You have no available commands
greeting = ^7%s^7 joined: %s
spanked = %s ^7was ^1SPANKED^7 by %s
admins = ^7Admins online: %s
time = At the sound of the beep it will be ^3%s^7...(beeeep)
unknown_command = ^7Unrecognized command %s
leveltest = ^7%s ^7(^3@%s^7) is a ^3%s ^7[^2%s^7] since %s
leveltest_nogroups = ^7%s ^7(^3@%s^7) is not in any groups
aliases = ^7%s^7 aliases: %s
warn_kick_alert = ^1ALERT^7: %(name)s^7 auto-kick from warnings if not cleared (^3%(warnings)s^7)
warn_ban_alert = ^1ALERT^7: %(name)s^7 auto-ban from warnings if not cleared (^3%(warnings)s^7)
Warning Configuration

The "warn_reasons" are used by just about any command that can use a reason for reprimand including !warn, !ban, !kick, !tempban, and !permban. One reason per line is placed in the plugin_admin.cfg warn_reasons section. The left side of the "=" is the warning keyword, the right side has two parts seperated by a comma. The first part is the duration that the warning will be active for a user. The default unit is minutes but can be specified with time suffixes. The second part is the reason message or a reference. You can refer to other warnings by using "/<keyword>" or spamages by using "/spam#<keyword>".

Example:

; color = warning keyword
; 1h = 1 hour active duration
; A warning for in-game color
color = 1h, ^7No in-game (double caret (^)) color in names

; language is an exact copy of the rule8 warning
language = /rule8 

; rule1 = warning keyword
; 10d = 10 day active duration
; This warning referres to rule1 from spamages
rule1 = 10d, /spam#rule1

[warn_reasons] Section

[warn_reasons]
; keyword: Message shorcuts used by !warn, !ban, !kick, !tempban, and !permban. For warnings, the prefix is a duration for how long the warning is active. You can use the time suffixes.
; Default message
keyword = message
[warn_reasons] 
generic = 1h, ^7 
default = 1h, ^7behave yourself 

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

stack = 1d, /spam#stack 

lang = /rule8 
language = /rule8 
cuss = /rule8 
profanity = /rule8 

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


adv = /rule7 
racism = /rule1 
stack = /rule2 
recruit = /rule6 
argue = /rule3 
sfire = /rule9 
spawnfire = /rule9 
jerk = /rule4 

afk = 5m, ^7you appear to be away from your keyboard 
tk = 1d, ^7stop team killing! 
obj = 1h, ^7go for the objective! 
camp = 1h, ^7stop camping or you will be kicked! 
fakecmd = 1h, ^7do not use fake commands 
nocmd = 1h, ^7do not use commands that you do not have access to, try using !help 
ci = 5m, ^7connection interupted, reconnect 
spectator = 5m, ^7spectator too long on full server 
spam = 1h, ^7do not spam, shut-up!
; The following warnings are used by B3 and must be defined
generic - used as a prefix to custom warnings
default -  used as the default when no reason is given for the warning
spam - displayed when a user spams too much
sfire - spawn fire
badname - user name on bad names list
cuss - user said something on the bad words list
nocmd - using commands with out access
fakecmd - using commands that do not exist

TK Plugin Configuration

[settings] Section

[settings]
; max_points: Maximum points before a player is kicked for tk damage. If a player reaches 150% this amount he will be kicked without warning.
; Default 400
max_points = 400
; levels: Level definitions for tk point levels, comma seperated
; Default 0,1,2,20,40
levels = 0,1,2,20,40
; round_grace: How many seconds after round start is considered fireing at spawn
; Default 7
round_grace = 7
; issue_warning: Warning issued to players fireing at spawn.
; Default sfire
issue_warning = sfire

[messages] Section

[messages]
; ban: Reason used for ban
; Default ^7team damage over limit
ban = ^7team damage over limit
; forgive: Message used when a player !forgives another
%vnames Victim's name
%anames Attacker's name
%pointss forgiven
; Default ^7%vnames^7 has forgiven %anames ^3%pointss^7
forgive = ^7%vnames^7 has forgiven %anames ^3%pointss^7
; grudged: Message used when a player !grudges another, same parameters as forgive setting
; Default ^7%vnames^7 has a ^1grudge ^7against %anames ^3%pointss^7
grudged = ^7%vnames^7 has a ^1grudge ^7against %anames ^3%pointss^7
; forgive_many: Message used when a player !forgives many players
%attackerss List of attacker names
; Default ^7%vnames^7 has forgiven %attackerss
forgive_many = ^7%vnames^7 has forgiven %attackerss
; forgive_warning: Warning displays when a user is about to be kicked for reaching the max_points
; Default ^1ALERT^7: %names^7 auto-kick if not forgiven ^3%pointss^7
forgive_warning = ^1ALERT^7: %names^7 auto-kick if not forgiven ^3%pointss^7
; no_forgive: Message displayed when there is no one to forgive
; Default ^7no one to forgive
no_forgive = ^7no one to forgive
; players: Message displayed for !forgivelist
%s List of players
; Default ^7Forgive who? %s
players = ^7Forgive who? %s
; forgive_info: Message displayed for !forgiveinfo
; Default ^7%names^7 has ^3%pointss^7 TK points
forgive_info = ^7%names^7 has ^3%pointss^7 TK points
; forgive_clear: Message displayed for !forgiveclear
; Default ^7%names^7 cleared of ^3%pointss^7 TK points
forgive_clear = ^7%names^7 cleared of ^3%pointss^7 TK points

TK level blocks define how TK points are aquired. A level_# block must be defined for each level defined by levels in [ settings ]. You do not have to make a level block for every level. You only have to define them for the levels in which the previous values change.

[level_#] Section

[level_#]
; kill_multiplier: How many points times the damage dealt for kills
; Default 2
kill_multiplier = 2
; damage_multiplier: How many points times the damage dealt for damage
; Default 1
damage_multiplier = 1
; ban_length: How long bans last for players who reach max_points
; Default 2
ban_length = 2

Below are the default level blocks for B3:

[level_0]
kill_multiplier = 2
damage_multiplier = 1
ban_length = 2

[level_1]
kill_multiplier = 2
damage_multiplier = 1
ban_length = 2

[level_2]
kill_multiplier = 1
damage_multiplier = 0.5
ban_length = 1

[level_20]
kill_multiplier = 1
damage_multiplier = 0.5
ban_length = 0

[level_40]
kill_multiplier = 0.75
damage_multiplier = 0.5
ban_length = 0

Status Plugin Configuration

[settings] Section

[settings]
; interval: Number of seconds between status updates.
; Default 60
interval = 60
; output_file: The file path of the XML output.
; Default ~/status.xml
output_file = ~/status.xml

Installing Plugins

Plugins developed for B3 usually consist of two files, a ".py" python file and a ".cfg" configuration file. The python file belongs in the b3/plugins directory and the config file belongs in the b3/conf directory.

For example, a plugin called "Example Plugin" should have files called "example.py" and "plugin_example.cfg". Place example.py in b3/plugins and plugin_example.cfg in b3/conf.

If the plugins directory does not exist under the b3 directory, you must create it. You also must make an empty file called "__init__.py" and place it in the plugins directory.

Usage [contents]

Administration

A key feature of the B3 Bot is it's ability to monitor a players behaviour and create a patten of development while on a server with B3. Should a player consistantly break rules, however minor, this patten of behaviour can be logged and presented to the player for bahavior modification, or justifcation for not allowing said player to return back to the server. Tracking the type or warn, kick and temp ban can allow the admin a greater understanding of the player and his/her behaviours. For example, a player with a lot of warns for being afk is not a threat to the community, but will inpead the game. The admin now knows to watch for this player while in game for afk status. On the other hand a player with consistant warns for bad language will allow an admin to dish out a more sevear form of discipline, such as a tempban or a kick. should negative behaviour continue.

The tiered system of the B3, allows for a better relationship between admins and players, while still creating a sense of discipline and seniority. The Tiered system also allows the player to choose to become a part of the community/server. by typing !register the player has become a member of the community, the next level can only be given out by senior admins. This automatically creates a relationship between player and admin, and rewards the player with more commands. The player will then wish to stay with the server community longer, to play by the rules and to socialize with the community to gain recognition.

User Roles and Groups

B3's permissions are based on groups and levels. Users are assigned to groups and each group has a level. Commands can be ran by users that have the minimum level needed to use the command. Upper level user roles are assigned by Super Admins with the !putgroup command using the keywords below.

B3 has several default user groups, each serving a different purpose. You can add, edit, or remove user groups but each of the levels below server meaningful purposes in B3. If you change groups, you should at least maintain a level 100, 2, and 1 user.

Super Admin

The Super Admin is the highest level of authority. A Super Admin has access to all commands and is generaly only assigned to the server operators.

Keyword: superadmin
Level: 100

Senior Admins

The Senior Admins are usualy the highest admins that play and admin on the server often. They have access to most commands except for the commands used in server/bot setup. Choose your Senior Admins wisely for they have the full regiment of commands to enforce your server policy.

Keyword: senioradmin
Level: 80

Full Admins

Full admins have less authority than Senior Admins but still have access to harsher punishment commands such as !ban.

Keyword: fulladmin
Level: 60

Admins

Admins are the first level of administrators. Their harshest punishment is a !kick, yet they are probably the most numerous of the admins.

Keyword: admin
Level: 40

Moderators

Moderators are the first step to becoming an admin, an admin training ground if you will. They can only !warn users or remind them of the rules. They can notify higher level admins when harsher punishment is needed.

Keyword: mod
Level: 20

Regulars

Regulars are not admins or moderators, but your loyal server population. You would only give regular status to members of your community who follow the rules and play on your server often. Regulars not only get a status symbol, but access to a few more commands than the average user. Only Senior Admins and up can appoint regulars with the !makereg command.

Keyword: reg
Level: 2

Users

A user is like a self appointed regular. New players can use the !register command to gain user status. User's have only a few commands but gain extra privelages that would be ignored for the one-time visit players.

Keyword: user
Level: 1

Plugins [contents]

Admin Plugin

Command Reference
Plugin Configuration

The command interface is provided by B3's admin plugin. B3 is meant to make administration easy. In fact, most everyday RCON commands are built in including !kick, !ban, !maprotate, player !list, !map, and more.

Commands that take a player as input can use three types of sources: a partial name, game client id, or B3 "@ID", see Player Identification for more details.

Warnings

Warning Configuration

The warning system allows admins to design an easy to use ruleset for their server. Instead of constantly telling your guests the rules of your server, just !warn them. Warnings can use warning shortcuts (one word abbreviations) or custom text.

For example,

!warn PlayerName camping

In this example "camping" would be translated to the servers full length warning:

WARNING (1): PlayerName we do not allow camping on this server
!warn PlayerName exploit
WARNING (2): PlayerName using map exploits are not allowed here

After a set number of warnings, B3 will temp-ban a player. Each warning is individually customized for the amount of time that the warning is active. When a player recieves 3 warnings an alert message will be displayed. If after 30 seconds the warnings have not been cleared, the player will be temp-banned for a time releative to the warning expiration time.

The temp-ban time is based on the total number of days the individuals warnigns are active for. The default setting is 1 / 30 of the total active time. See Admin Plugin Configuration for setting details.

Example:

# 1 day total warnings
86400 / 30 = 2880 seconds = 48 minute temp-ban
# 1 hour total warnings
3600 / 30 = 120 seconds = 2 minute temp-ban
# 5 minutes total warnings
300 / 30 = 10 second temp-ban

3 - 1d warnigns = 2.4 hour temp-ban
3 - 1h warnings = 6 minute temp-ban
3 - 5m warnings = 30 second temp-ban
Tip:

For a quick list of warning shortcuts, use the !warns command. To see what a warnings message is, use the !warntest command. To see how many warnings a user has, use the !warninfo command.

Automated Warnings

B3 will also automatically warn players on a variety of things.

  • The TK Plugin will warn players for team damage or spawn shooting.
  • The Censor Plugin will warn players using banned words.
  • The Spam Control Plugin will warn players for spamming.
  • B3 will warn user for using un-authorized commands.

Spammages

An integrated spam feature lets you display common phrases you find yourself using on a regular basis. Instead of typing your Teamspeak address, your web address, how to join your clan or community, just !spam it.

Example:

!spam website
Visit our website at www.bigbrotherbot.com
Tip:

For a quick list of spam shortcuts, use the !spams command.

TK Plugin

Command Reference
Plugin Configuration

Whenever a user kills/bleeds a teammate they will be issued TK points. At a certain number a repramand will automatically be issued. Should the team damage be an accident, the user that was offended can !forgive the offending user, thus clearing him of TK points. Should the team damage be intentional, a simple !grudge command will stop the offending user from being forgiven in future, thus speeding up the repramand process.

For a complete description of commands see the TK Plugin Commands.

Censor Plugin

The censor plugin will monitor chat messages for banned words. Whenever a player speaks a banned word he will be warned automatically. B3 has been pre-programmed with a list of profanities in many languages. You can modify the badwords.txt to fit your needs.

Spam Control Plugin

The spam control plugin automatically dectects a player spaming messages, commands, binds, or voice commands and warns them. It weighs spam considering color messages, repeat messages, and voice commands more spam-like.

Ping Watch Plugin

The Ping Watch Plugin will monitor player pings and alert players when a players ping is too high or 999 connection interupted

Advertisement Plugin

The Adv Plugin will rotate through ads and display them and regular intervals. Great for displaying your server's website or rules.

Status Plugin

Plugin Configuration

The Status Plugin will output an XML file with player information and server settings periodically.

Stats Plugin

Command Reference

The stats plugin currently provides stats for the current map. It awards points based on skill. To view stats a user can use the !mapstats command.

Future versions of B3 will have persistant stats that keep track of player statistics forever.

Custom Plugins

Even though Big Brother Bot was designed to give complete control of your server, you may have a need unique to your situation, or an idea that may not have been considered. Great news! B3 was also designed with this in mind. Each feature of B3 is actually a plugin module independent of each other. What this means is you can create a plugin for your individual needs, or something that you think the community could use. With a little scripting, the possibilities are almost endless.

www.bigbrotherbot.com will also create custom plugins for you for a fee.

Command Reference [contents]

Level determins the minimum level needed to run the command.
Scope determins whether the message is displayed in public view, private view, or both.
!command <required parameters> [<optional parameters>]
description

Time Suffixes

Commands that deal with time duration like !tempban can use time suffixes.

m = minutes
d = days
h = hours
w = weeks

Example:

1d = 1 day
3h = 3 hours

Player Identification

Commands that accept player designations can use several inputs.

Partial Name

The simplest player identifier is the players name. You can use any part of the player name. Only enough charachters to match the players name uniquely is needed. If more than one player on the server has a simular name, you will be prompted with all players matching that name and thier client id.

Example:

!warn playe cuss

This will first search for players with "playe" in thier name; including "player", "unkownplayer", and "played". If more that one player is found a list of results will be shown to pick a more specific user.

Tip:

You can use the !find to show what players match a given name.

Client ID

The client ID is the number assigned to the player by the game itself. The client ID only works for the current gaming session. For a list of players' client IDs, use the !list command. If a players name is too hard to type or there are more than one players with simuilar names, you can use the client id to single them out.

Example:

!kick 3 tk

Database ID

The Database ID is the players unique identification within the B3 database. It is prepended with an "@" and is often referred to as the "at ID". This ID is displayed with the !leveltest command and the !lookup command. You can use this ID to perform actions against a player even when that player is not connected.

Example:

!makereg @1235
Tip:

You can use the !lookup command to find offline users in the database.

Private Commands

Commands can be hidden from other players if you meet the hidecmd_level. To run a command privately you can use the private messaging built into most games.

Call Of Duty Example:
First you must figure out your client ID. You can use !list or !find.

!find MyName

If found it should display your name and client ID, for example 12. Once you have your client ID you can use the "/tell" command built into CoD. You must type the message in console.

/tell 12 !mask reg MyName

If you meet the minimum level for Private commands B3 will execute your command. You may see your /tell message displayed twice, this is normal.

Admin Plugin Commands

!register

Level
Scope Private
!register
register youself as a basic user

!help

Level
Scope Private
!help [<command|level>]
get info on how to use a command, you can use "*" for partial matches

!regtest

Level
Scope Public or Private
!regtest
display your current user status

!time

Level 1
Scope Public or Private
!time [<timezone/offset>]
Display the current time. If no timezone or offset is given, the server's timzone is used.

!maps

Level 2
Scope Public or Private
!maps
list the server map rotation

!nextmap

Level 2
Scope Public or Private
!nextmap
display the next map in rotation

!seen

Level 2
Scope Public or Private
!seen <name>
when was this player last seen?

!admins

Level 20
Scope Public or Private
!admins
lists all the online admins

!b3

Level 20
Scope Public or Private
!b3
say b3 version info

!greeting

20
Private

!greeting [<greeting>]
set or list your greeting

!list

Level 20
Scope Public or Private
!list
list all connected players

!say

Level 20
Scope Public
!say
say a message to all players

!spam

Level 20
Scope Public
!spam <name> <message>
spam a predefined message

!spams

Level 20
Scope Private
!spams
list spam messages

!warn

Level 20
Scope Public
!warn <name> [<warning>]
warn user

!warninfo

Level 20
Scope Public or Private
!warninfo <name>
display how many warning points a user has

!warnremove

Level 20
Scope Public
!warnremove <name>
remove a users last warning

!warns

Level 20
Scope Private
!warns
list warnings

!warntest

Level 20
Scope Private
!warntest <warning>
test a warning

!admintest

Level 40
Scope Public or Private
!admintest
display your current user status

!aliases

Level 40
Scope Public or Private
!aliases <name>
list a players aliases

!baninfo

Level 40
Scope Public or Private
!baninfo <name>
display how many bans a user has

!find

Level 40
Scope Public or Private
!find <name>
test to find a connected player

!kick

Level 40
Scope Public
!kick <name> [<reason>]
kick a player

!leveltest

Level 40
Scope Public or Private
!leveltest [<name>]
display the status of a user

!scream

Level 40
Scope Public
!scream <message>
yell a message to all players

!tempban

Level 40
Scope Public
!tempban <name> <duration> [<reason>]
Temporarily ban a player. You can use Time Suffixes for durations.

!ban

Level 60
Scope Public
!ban <name> [<reason>]
ban a player for settings.ban_duration time

!spank

Level 60
Scope Public
!spank <name> [<reason>]
spank a player, naughty boy!

!pbss

Level 80
Scope Private
!pbss <name>
Take a screenshot of a player. Screenshots will be stored on the server under your pb/svss directory. See PB_SV_GetSs in the PunkBuster Documentation for more information.

!permban

Level 80
Scope Public
!permban <name> [<reason>]
Permantly ban a player.

!clear

Level 80
Scope Public
!clear [<player>]
clear all tk points and warnings

!lookup

Level 80
Scope Private
!lookup <name>
lookup a player in the database

!makereg

Level 80
Scope Public
!makereg <name>
make a name a regular level 1 user

!map

Level 80
Scope Public
!map <map>
switch current map

!restart

Level 80
Scope Public
!restart
restart b3

!warnclear

Level 80
Scope Public
!warnclear <name>
clear all of a users warnings

!clientinfo

Level 90
Scope Public or Private
!clientinfo <name> <field>
get info about a client

!cmdlevel

Level 90
Scope Private
!cmdlevel <command> <level>
set a commands level

!delgroup

Level 90
Scope Private
!delgroup <group>
remove a group and remove all clients from the group

!editgroup

Level 90
Scope Private
!editgroup <group> <-n|-k|-l> <value>
change a group's settings

!groups

Level 90
Scope Private
!groups <name>
lists all the player's groups

!newgroup

Level 90
Scope Private
!newgroup <keyword> <level> <name>
create a new group

!pause

Level 90
Scope Public
!pause <duration>
pause the bot from parsing

!putgroup

Level 90
Scope Public or Private
!putgroup <client> <group>
add a client to a group

!rebuild

Level 90
Scope Private
!rebuild
sync up connected players

!ungroup

Level 90
Scope Public or Private
!ungroup <client> <group>
remove a client from a group

!die

Level 100
Scope Public or Private
!die
shutdown b3

!disable

Level 100
Scope Public or Private
!disable <plugin>
disable a plugin

!enable

Level 100
Scope Public or Private
!enable <plugin>
enable a disabled plugin

!reconfig

Level 100
Scope Private
!reconfig
re-load all configs

!mask

Level 100
Scope Private
!mask <group> [<player>]
Mask a players true group/level. Useful for hiding admin status.

!unmask

Level 100
Scope Private
!unmask [<player>]
Un-mask a previously set !mask.

!runas

Level 100
Scope Private
!runas <player> <command>
Run a command as another user. Useful when you are !masked and using private commands. Example: !runas AnotherAdmin !ban Newb

TK Plugin Commands

!forgive

Level
Scope Public
!forgive [<name>]
forgive a player for team damaging

!forgiveall

Level
Scope Public
!forgiveall
forgive all attacker tk points

!forgiveprev

Level
Scope Public
!forgiveprev
forgive the last person to tk you

!forgivelist

Level
Scope Private
!forgivelist
list all the players who have shot you

!grudge

Level
Scope Public
!grudge [<name>]
grudge a player for team damaging, a grudge player will not be auto-forgiven

!forgiveinfo

Level 20
Scope Public or Private
!forgiveinfo <name>
display a user's tk points

!forgiveclear

Level 60
Scope Public or Private
!forgiveclear <name>
clear a user's tk points

Stats Plugin Commands

!mapstats

Level 1
Scope Public or Private
!mapstats [<name>]
display the current maps stats for a user

!testscore

Level 1
Scope Public or Private
!testscore <name>
show how many skill points you would get if you killed {P name}

Plugin SDK [contents]

Database Connection

For plugin database usage, the best way to connect is to use b3's connection handling. Not only will this ensure you only have one client connected to your database, but b3's connection handler will reconnect in the event the servers connection is interrupted. B3 uses ADODB for Python.

Example:

cursor = self.console.storage.query(sqlQuery)

if cursor:
    # Query successful, cursor is a adodb.ADOCursor

    print '%s Records' % cursor.RecordCount()

    while not cursor.EOF:
        # cursor.GetRowAssoc(0) returns a dictionary with all keys lowercase
        record = cursor.GetRowAssoc(0)

        # do whatever with record here

        cursor.MoveNext()

else:
    # Connection failed, handle gracefuly
    # The database may be temporarily unreachable, 
    # do something intelligent in the mean time.
    # For example, the admins plugin will check
    # a local cache of top admins incase admining
    # is need while the server is down

Example Plugin

Here is a rough example of a plugin. It covers some of the basic functions of a plugin with some rather useless commands.

Config file

; b3/conf/plugin_example.cfg
[settings]
min_level = 20

[messages]
hello = ^1Hi %s
count = ^2Count for %s: ^7%s

Plugin:

# b3/plugins/example.py
# all plugins must import b3 and b3.events
import b3
import b3.events

#--------------------------------------------------------------------------------------------------
class ExamplePlugin(b3.Plugin):
	_adminPlugin = None
	_minLevel = None

	def startup(self):
		"""\
		Initialize plugin settings
		"""

		# get the plugin so we can register commands
		self._adminPlugin = self.console.getPlugin('admin')
		if not self._adminPlugin:
			# something is wrong, can't start without admin plugin
			self.error('Could not find admin plugin')
			return False
		
		# get the minium level allowed to use this plugin
		self.verbose('Getting config options')
		self._minLevel = self.config.getint('settings', 'min_level')

		# register our !echo command
		self.verbose('Registering commands')
		self._adminPlugin.registerCommand(self, 'echo', self._minLevel, self.cmd_echo, 'e')
		self._adminPlugin.registerCommand(self, 'shout', self._minLevel, self.cmd_shout)
		self._adminPlugin.registerCommand(self, 'sayto', self._minLevel, self.cmd_sayto)
		self._adminPlugin.registerCommand(self, 'hello', self._minLevel, self.cmd_hello)
		self._adminPlugin.registerCommand(self, 'count', self._minLevel, self.cmd_count)

		# listen for client say events
		self.verbose('Registering events')
		self.registerEvent(b3.events.EVT_CLIENT_SAY)
		self.registerEvent(b3.events.EVT_CLIENT_TEAM_SAY)

		self.debug('Started')

	def handle(self, event):
		"""\
		Handle intercepted events
		"""

		if event.type == b3.events.EVT_CLIENT_SAY:
			self.debug('Client %s said: %s', event.client.name, event.data)
		elif event.type == b3.events.EVT_CLIENT_TEAM_SAY:
			self.debug('Client %s said to team %s: %s', event.client.name, event.client.team, event.data)

	def cmd_echo(self, data, client, cmd=None):
		"""\
		<message> - repeat a message
		"""

		self.verbose('Client %s echos "%s"', client.name, data)

		if not len(data):
			client.message('^7You must supply a message to echo')
			return False

		# if the user used the ! prefix the message will be private
		# if the user used the @ prefix the message will be public
		cmd.sayLoudOrPM(client, data)

	def cmd_shout(self, data, client, cmd=None):
		"""\
		<message> - shout a message to all users
		"""

		self.verbose('Client %s shouts "%s"', client.name, data)

		if not len(data):
			client.message('^7You must supply a message to shout')
			return False

		self.console.say('^7%s' % data.upper())

	def cmd_sayto(self, data, client, cmd=None):
		"""\
		<player> <message> - send a message to a user
		"""

		# this will split the player name and the message
		input = self._adminPlugin.parseUserCmd(data)
		if input:
			# input[0] is the player id
			sclient = self._adminPlugin.findClientPrompt(input[0], client)
			if not sclient:
				# a player matchin the name was not found, a list of closest matches will be displayed
				# we can exit here and the user will retry with a more specific player
				return False
		else:
			event.client('^7Invalid data, try !help sayto')
			return False

		if not len(input[1]):
			client.message('^7You must supply a message to sayto')
			return False

		# private message the player the message
		sclient.message('^7%s ^3says ^7%s' % (client.exactName, input[1]))

	def cmd_hello(self, data, client, cmd=None):
		"""\
		- Have B3 greet you
		"""

		client.message(self.getMessage('hello', client.exactName))

	def cmd_count(self, data, client, cmd=None):
		"""\
		- Count for the player
		"""

		# get the clients "count" variable and increment it
		count = client.var(self, 'count', 0).value += 1
		self.console.say(self.getMessage('count', client.exactName, count))

Calling Other Plugins

You can get access to other plugins functionality by getting a reference to that plugin.

Example:

self._adminPlugin = self.console.getPlugin('admin')

Creating User Commands

To create commands you can hook into the admin plugin by using getPlugin

Example:

self._adminPlugin = self.console.getPlugin('admin')
if self._adminPlugin:
	# registerCommand(<plugin reference>, <command name>, \
	# <minimum user level>, <callback function>, <command shortcut>)
	self._adminPlugin.registerCommand(self, 'forgive', 0, self.cmd_forgive, 'f')
Tip:

The admin plugin will automatically handle user level security and spam control for your plugin's commands.

Command Callbacks

Commands that use the admin plugin registerCommand must use the folowing interface:

def cmd_myCommandName(self, data, client, cmd=None):
	"""\
	Your command [!help] description goes here
	"""
	# your code here

data is the data after the command that the user passes. For instance, "!kick player tk" the data would be "player tk".
client a Client object for the player who called the command.
cmd is the Command object for the command.

Console (Parser Object)


class Parser:
This is the core of B3. It handles parsing of log files, event queueing and handling, rcon, database connectiviy, and more. Each game (CoD, Q3A, ET) has it's own extended version of Parser and may have minor differences between them. Most B3 objects have a reference to this as "self.console".
Module: b3
Properties
Name Default Type Info
clients - object A Clients object containing all the currently connected clients.
cron - object The active Cron Object for scheduled tasks.
game - object A Game object of the currently active game.
storage - object The active storage method, see Database Connection.

Parser.die()
Stop B3 from parsing and shutdown gracefuly.
Parser.getCvar(<cvar>)
Get the value of a server cvar.
Returns: tuple - A tuple with (current value, default value)
Parameters
Name Default Type Info
<cvar> - string Cvar name.
Parser.getPlugin(<plugin>)
Get a reference to a plugin.
Returns: object - Plugin reference.
Parameters
Name Default Type Info
<plugin> - string Name of the plugin.
Parser.getWrap(<text>, <length>, <minWrapLen>)
Wraps long texts, typically used for "say" messages.
Returns: list - Wrapped text list.
Parameters
Name Default Type Info
<text> - string Text to wrap.
<length> - integer Maximum line length if the data is longer than minWrapLen.
<minWrapLen> - integer Messages less than this value will not be wrapped.
Parser.say(<text>)
Send a global message to the server. Automaticaly wraps.
Parameters
Name Default Type Info
<text> - string Text to send.

See also: Parser.getWrap()
Parser.set(<cvar>, <value>)
Set a server cvar.
Parameters
Name Default Type Info
<cvar> - string Cvar name.
<value> - string Cvar value.
Parser.stripColors(<text>)
Removes game color codes from text.
Returns: string
Parameters
Name Default Type Info
<text> - string Text to remove color codes from.
Parser.time()
The current server time in GMT.
Returns: integer - Time in GMT seconds since epoch.
Parser.upTime()
Amount of time in seconds that B3 has been running.
Returns: integer - Time in GMT seconds since epoch.
Parser.write(<data>)
Send data to server (usually through Rcon)
Returns: string - Return data.
Parameters
Name Default Type Info
<data> - string Data to send.
Parser.writelines(<data>)
Send an multiple lines of data to the server.
Returns: string - Return data.
Parameters
Name Default Type Info
<data> - list Data to send.

See also: Parser.write()

Plugin Object

class Plugin:
B3's base plugin. All B3 plugins extend b3.Plugin.
Module: b3
Properties
Name Default Type Info
config - object The plugins configuration object. A stadard Python ConfigParser object.
console - object The Parser object.
working - boolean A flag for whether or not the plugin should be running. Any long term loops should check this to know when to stop.
working - boolean A flag for whether or not the plugin should be running. Any long term loops should check this to know when to stop.

Plugin.debug(<message>, <*args>)
Log a debug message to the main log.
Parameters
Name Default Type Info
<message> - string Message to log.
<*args> - object Optional parameters to feed into the message.