BigBrotherBot v1.6.1
System Development Information for the BigBrotherBot project.

b3::parser::Parser Class Reference

Inheritance diagram for b3::parser::Parser:
b3::fake::FakeConsole b3::parsers::altitude::AltitudeParser b3::parsers::frostbite::abstractParser::AbstractParser b3::parsers::homefront::HomefrontParser b3::parsers::q3a::abstractParser::AbstractParser b3::fake::FakeColoredConsole b3::parsers::bfbc2::Bfbc2Parser b3::parsers::moh::MohParser b3::parsers::cod::CodParser b3::parsers::et::EtParser b3::parsers::etpro::EtproParser b3::parsers::iourt41::Iourt41Parser b3::parsers::oa081::Oa081Parser b3::parsers::smg11::Smg11Parser b3::parsers::smg::SmgParser b3::parsers::sof2::Sof2Parser b3::parsers::wop15::Wop15Parser b3::parsers::wop::WopParser

List of all members.

Public Member Functions

def __init__
def getAbsolutePath
def start
def die
def restart
def upTime
def loadConfig
def saveConfig
def startup
def pause
def unpause
def loadEvents
def createEvent
def getEventID
def getEvent
def getEventName
def getPlugin
def reloadConfigs
def loadPlugins
def loadArbPlugins
def pluginImport
def startPlugins
def disablePlugins
def enablePlugins
def getMessage
def getMessageVariables
def getCommand
def getTzOffsetFromName
def formatTime
def run
def parseLine
def registerHandler
def queueEvent
def handleEvents
def write
def writelines
def read
def shutdown
def getWrap
def error
def debug
def bot
def verbose
def verbose2
def console
def warning
def info
def exception
def critical
def time
def stripColors
def updateDocumentation
def getPlayerList
 ## Inheriting classes must implements the following methods.
def authorizeClients
def sync
def say
def saybig
def message
def kick
def ban
def unban
def tempban
def getMap
def getMaps
def rotateMap
def changeMap
def getPlayerPings
def getPlayerScores
def inflictCustomPenalty

Public Attributes

 Events
 name
 prefix
 msgPrefix
 delay
 delay2
 input

Static Public Attributes

 clients = None
float delay = 0.33
float delay2 = 0.02
 game = None
 gameName = None
 type = None
 working = True
 queue = None
 config = None
 storage = None
 output = None
 log = None
 replay = False
 remoteLog = False
 screen = None
 rconTest = False
int logTime = 0
 OutputClass = b3.parsers.q3a.rcon.Rcon
string name = 'b3'
string prefix = '^2%s:^3'
string msgPrefix = ''
 info = None
tuple exiting = thread.allocate_lock()
 exitcode = None

Properties

 cron = property(_get_cron)

Private Member Functions

def _dumpEventsStats
def _get_cron

Private Attributes

 _publicIp
 _port
 _rconIp
 _rconPassword
 _eventsStats
 _events
 _pluginOrder

Static Private Attributes

tuple _lineFormat = re.compile('^([a-z ]+): (.*?)', re.IGNORECASE)
dictionary _handlers = {}
dictionary _plugins = {}
list _pluginOrder = []
 _paused = False
 _pauseNotice = False
dictionary _events = {}
dictionary _eventNames = {}
dictionary _commands = {}
dictionary _messages = {}
 _timeStart = None
 _debug = True
dictionary _settings = {}
tuple _reColor = re.compile(r'\^[0-9a-z]')
 _cron = None
string _publicIp = ''
string _rconIp = ''
 _rconPort = None
int _port = 0
string _rconPassword = ''

Constructor & Destructor Documentation

def b3::parser::Parser::__init__ (   self,
  config 
)

Reimplemented in b3::fake::FakeConsole.


Member Function Documentation

def b3::parser::Parser::_dumpEventsStats (   self) [private]
def b3::parser::Parser::_get_cron (   self) [private]
Instantiate the main Cron object
def b3::parser::Parser::authorizeClients (   self)
\
For all connected players, fill the client object with properties allowing to find 
the user in the database (usualy guid, or punkbuster id, ip) and call the 
Client.auth() method 

Reimplemented in b3::fake::FakeConsole, b3::parsers::altitude::AltitudeParser, b3::parsers::cod::CodParser, b3::parsers::cod4::Cod4Parser, b3::parsers::frostbite::abstractParser::AbstractParser, b3::parsers::homefront::HomefrontParser, and b3::parsers::q3a::abstractParser::AbstractParser.

def b3::parser::Parser::bot (   self,
  msg,
  args,
  kwargs 
)
Log a bot message

Reimplemented in b3::fake::FakeConsole, and b3::fake::FakeColoredConsole.

def b3::parser::Parser::changeMap (   self,
  map 
)
\
load a given map/level
return a list of suggested map names in cases it fails to recognize the map that was provided

Reimplemented in b3::parsers::altitude::AltitudeParser, b3::parsers::bfbc2::Bfbc2Parser, b3::parsers::homefront::HomefrontParser, b3::parsers::moh::MohParser, and b3::parsers::q3a::abstractParser::AbstractParser.

def b3::parser::Parser::console (   self,
  msg,
  args,
  kwargs 
)
Log a message from the console

Reimplemented in b3::fake::FakeConsole, and b3::fake::FakeColoredConsole.

def b3::parser::Parser::createEvent (   self,
  key,
  name = None 
)
Create a new event
def b3::parser::Parser::critical (   self,
  msg,
  args,
  kwargs 
)
Log a message from the console

Reimplemented in b3::fake::FakeConsole, and b3::fake::FakeColoredConsole.

def b3::parser::Parser::debug (   self,
  msg,
  args,
  kwargs 
)
Log a debug message

Reimplemented in b3::fake::FakeConsole, and b3::fake::FakeColoredConsole.

def b3::parser::Parser::die (   self)
Stop B3 with the die exit status (222)
def b3::parser::Parser::disablePlugins (   self)
Disable all plugins except for publist, ftpytail and admin
def b3::parser::Parser::enablePlugins (   self)
Enable all plugins except for publist, ftpytail and admin
def b3::parser::Parser::error (   self,
  msg,
  args,
  kwargs 
)
Log an error

Reimplemented in b3::fake::FakeConsole, and b3::fake::FakeColoredConsole.

def b3::parser::Parser::exception (   self,
  msg,
  args,
  kwargs 
)
Log a message from the console

Reimplemented in b3::fake::FakeConsole, and b3::fake::FakeColoredConsole.

def b3::parser::Parser::formatTime (   self,
  gmttime,
  tzName = None 
)
Return a time string formated to local time in the b3 config time_format
def b3::parser::Parser::getAbsolutePath (   self,
  path 
)
Return an absolute path name and expand the user prefix (~)
def b3::parser::Parser::getCommand (   self,
  cmd,
  kwargs 
)
Return a reference to a loaded command

Reimplemented in b3::parsers::frostbite::abstractParser::AbstractParser.

def b3::parser::Parser::getEvent (   self,
  key,
  data,
  client = None,
  target = None 
)
Return a new Event object for an event name
def b3::parser::Parser::getEventID (   self,
  key 
)
Get the numeric ID of an event name
def b3::parser::Parser::getEventName (   self,
  id 
)
Get the name of an event by numeric ID
def b3::parser::Parser::getMessage (   self,
  msg,
  args 
)
Return a message from the config file
def b3::parser::Parser::getMessageVariables (   self,
  args,
  kwargs 
)
Dynamically generate a dictionnary of fields available for messages in config file
def b3::parser::Parser::getPlayerList (   self)

## Inheriting classes must implements the following methods.

## Plugins that are game independant assume those methods exist ## ##

\
Query the game server for connected players.
return a dict having players' id for keys and players' data as another dict for values

Reimplemented in b3::parsers::altitude::AltitudeParser, and b3::parsers::homefront::HomefrontParser.

def b3::parser::Parser::getPlayerScores (   self)
def b3::parser::Parser::getPlugin (   self,
  plugin 
)
Get a reference to a loaded plugin

Reimplemented in b3::fake::FakeConsole.

def b3::parser::Parser::getTzOffsetFromName (   self,
  tzName 
)
def b3::parser::Parser::getWrap (   self,
  text,
  length = 80,
  minWrapLen = 150 
)
Returns a sequence of lines for text that fits within the limits

Reimplemented in b3::parsers::frostbite::abstractParser::AbstractParser.

def b3::parser::Parser::handleEvents (   self)
Event handler thread
def b3::parser::Parser::inflictCustomPenalty (   self,
  type,
  client,
  reason = None,
  duration = None,
  admin = None,
  data = None 
)
Called if b3.admin.penalizeClient() does not know a given penalty type. 
Overwrite this to add customized penalties for your game like 'slap', 'nuke', 
'mute', 'kill' or anything you want.
/!\ This method must return True if the penalty was inflicted.

Reimplemented in b3::parsers::homefront::HomefrontParser, and b3::parsers::iourt41::Iourt41Parser.

def b3::parser::Parser::info (   self,
  msg,
  args,
  kwargs 
)
Log a message from the console

Reimplemented in b3::fake::FakeConsole, and b3::fake::FakeColoredConsole.

def b3::parser::Parser::kick (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
def b3::parser::Parser::loadArbPlugins (   self)
Load must have plugins and check for admin plugin
def b3::parser::Parser::loadConfig (   self,
  config 
)
Set the config file to load
def b3::parser::Parser::loadEvents (   self)
Load events from event manager
def b3::parser::Parser::loadPlugins (   self)
Load plugins specified in the config
def b3::parser::Parser::parseLine (   self,
  line 
)
def b3::parser::Parser::pause (   self)
Pause B3 log parsing
def b3::parser::Parser::pluginImport (   self,
  name,
  path = None 
)
Import a single plugin
def b3::parser::Parser::queueEvent (   self,
  event,
  expire = 10 
)
Queue an event for processing

Reimplemented in b3::fake::FakeConsole, and b3::parsers::wop15::Wop15Parser.

def b3::parser::Parser::read (   self)
read from game server log file

Reimplemented in b3::parsers::cod7::Cod7Parser.

def b3::parser::Parser::registerHandler (   self,
  eventName,
  eventHandler 
)
Register an event handler
def b3::parser::Parser::reloadConfigs (   self)
Reload all config files
def b3::parser::Parser::restart (   self)
Stop B3 with the restart exit statis (221)
def b3::parser::Parser::run (   self)
def b3::parser::Parser::saveConfig (   self)
Save configration changes
def b3::parser::Parser::saybig (   self,
  msg 
)
def b3::parser::Parser::shutdown (   self)
Shutdown B3

Reimplemented in b3::parsers::altitude::AltitudeParser.

def b3::parser::Parser::start (   self)
Start B3
def b3::parser::Parser::startPlugins (   self)
Start all loaded plugins
def b3::parser::Parser::stripColors (   self,
  text 
)
def b3::parser::Parser::sync (   self)
\
For all connected players returned by self.getPlayerList(), get the matching Client
object from self.clients (with self.clients.getByCID(cid) or similar methods) and
look for inconsistencies. If required call the client.disconnect() method to remove
a client from self.clients.
This is mainly useful for games where clients are identified by the slot number they
occupy. On map change, a player A on slot 1 can leave making room for player B who
connects on slot 1.

Reimplemented in b3::fake::FakeConsole, b3::parsers::altitude::AltitudeParser, b3::parsers::cod::CodParser, b3::parsers::cod4::Cod4Parser, b3::parsers::etpro::EtproParser, b3::parsers::frostbite::abstractParser::AbstractParser, b3::parsers::homefront::HomefrontParser, b3::parsers::iourt41::Iourt41Parser, b3::parsers::oa081::Oa081Parser, b3::parsers::q3a::abstractParser::AbstractParser, b3::parsers::smg::SmgParser, and b3::parsers::smg11::Smg11Parser.

def b3::parser::Parser::tempban (   self,
  client,
  reason = '',
  duration = 2,
  admin = None,
  silent = False,
  kwargs 
)
def b3::parser::Parser::time (   self)
Return the current time in GMT/UTC
def b3::parser::Parser::unpause (   self)
Unpause B3 log parsing
def b3::parser::Parser::updateDocumentation (   self)
Create a documentation for all available commands
def b3::parser::Parser::upTime (   self)
Amount of time B3 has been running
def b3::parser::Parser::verbose (   self,
  msg,
  args,
  kwargs 
)
Log a verbose message

Reimplemented in b3::fake::FakeConsole, and b3::fake::FakeColoredConsole.

def b3::parser::Parser::verbose2 (   self,
  msg,
  args,
  kwargs 
)
Log an extra verbose message

Reimplemented in b3::fake::FakeConsole, and b3::fake::FakeColoredConsole.

def b3::parser::Parser::warning (   self,
  msg,
  args,
  kwargs 
)
Log a message from the console

Reimplemented in b3::fake::FakeConsole, and b3::fake::FakeColoredConsole.

def b3::parser::Parser::write (   self,
  msg,
  maxRetries = None 
)
Write a message to Rcon/Console

Reimplemented in b3::fake::FakeConsole.

def b3::parser::Parser::writelines (   self,
  msg 
)
Write a sequence of messages to Rcon/Console. Optimized for speed

Reimplemented in b3::fake::FakeConsole.


Member Data Documentation

b3::parser::Parser::_cron = None [static, private]
b3::parser::Parser::_debug = True [static, private]
dictionary b3::parser::Parser::_eventNames = {} [static, private]
dictionary b3::parser::Parser::_events = {} [static, private]
dictionary b3::parser::Parser::_handlers = {} [static, private]
tuple b3::parser::Parser::_lineFormat = re.compile('^([a-z ]+): (.*?)', re.IGNORECASE) [static, private]
dictionary b3::parser::Parser::_messages = {} [static, private]
b3::parser::Parser::_paused = False [static, private]
list b3::parser::Parser::_pluginOrder = [] [static, private]
dictionary b3::parser::Parser::_plugins = {} [static, private]
int b3::parser::Parser::_port = 0 [static, private]
string b3::parser::Parser::_publicIp = '' [static, private]
string b3::parser::Parser::_rconIp = '' [static, private]
string b3::parser::Parser::_rconPassword = '' [static, private]
b3::parser::Parser::_rconPort = None [static, private]
b3::parser::Parser::_timeStart = None [static, private]

Reimplemented in b3::fake::FakeConsole.

b3::parser::Parser::clients = None [static]

Reimplemented in b3::fake::FakeConsole.

b3::parser::Parser::config = None [static]

Reimplemented in b3::fake::FakeConsole.

float b3::parser::Parser::delay = 0.33 [static]
float b3::parser::Parser::delay2 = 0.02 [static]

Reimplemented in b3::fake::FakeConsole.

tuple b3::parser::Parser::exiting = thread.allocate_lock() [static]
b3::parser::Parser::game = None [static]

Reimplemented in b3::fake::FakeConsole.

b3::parser::Parser::info = None [static]
b3::parser::Parser::log = None [static]
int b3::parser::Parser::logTime = 0 [static]
string b3::parser::Parser::msgPrefix = '' [static]
string b3::parser::Parser::name = 'b3' [static]
string b3::parser::Parser::prefix = '^2%s:^3' [static]
b3::parser::Parser::queue = None [static]
b3::parser::Parser::replay = False [static]
b3::parser::Parser::screen = None [static]

Reimplemented in b3::fake::FakeConsole.

b3::parser::Parser::storage = None [static]

Reimplemented in b3::fake::FakeConsole.

b3::parser::Parser::type = None [static]
b3::parser::Parser::working = True [static]

Reimplemented in b3::fake::FakeConsole.


Property Documentation

b3::parser::Parser::cron = property(_get_cron) [static]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Properties