BigBrotherBot v1.5.0
System Development Information for the BigBrotherBot project.
Public Member Functions | Static Public Attributes | Static Private Attributes

b3::parsers::cod::CodParser Class Reference

Inheritance diagram for b3::parsers::cod::CodParser:
b3::parsers::q3a::abstractParser::AbstractParser b3::parser::Parser b3::parsers::cod2::Cod2Parser b3::parsers::cod4::Cod4Parser b3::parsers::cod5::Cod5Parser b3::parsers::cod6::Cod6Parser b3::parsers::cod7::Cod7Parser

List of all members.

Public Member Functions

def startup
def setVersionExceptions
def OnK
def OnD
def OnQ
def OnJ
def OnA
def OnSay
def OnSayteam
def OnTell
def OnInitgame
def OnExitlevel
def OnItem
def unban
def getTeam
def getMaps
def getNextMap
def sync
def connectClient
def newPlayer
def authorizeClients

Static Public Attributes

string gameName = 'cod'
 IpsOnly = False
 PunkBuster = None

Static Private Attributes

int _guidLength = 6
tuple _pbRegExp = re.compile(r'^[0-9a-f]{32}$', re.IGNORECASE)
int _logSync = 3
dictionary _counter = {}
dictionary _settings = {}
dictionary _commands = {}
dictionary _eventMap
tuple _lineClear = re.compile(r'^(?:[0-9:]+\s?)?')
tuple _lineFormats
tuple _regPlayer = re.compile(r'^(?P<slot>[0-9]+)\s+(?P<score>[0-9-]+)\s+(?P<ping>[0-9]+)\s+(?P<guid>[0-9]+)\s+(?P<name>.*?)\s+(?P<last>[0-9]+)\s+(?P<ip>[0-9.]+):(?P<port>[0-9-]+)\s+(?P<qport>[0-9]+)\s+(?P<rate>[0-9]+)$', re.I)
tuple _reMap = re.compile(r'map ([a-z0-9_-]+)', re.I)

Member Function Documentation

def b3::parsers::cod::CodParser::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 from b3::parsers::q3a::abstractParser::AbstractParser.

Reimplemented in b3::parsers::cod4::Cod4Parser.

def b3::parsers::cod::CodParser::connectClient (   self,
  ccid 
)
def b3::parsers::cod::CodParser::getMaps (   self)
\
return the available maps/levels name

Reimplemented from b3::parsers::q3a::abstractParser::AbstractParser.

def b3::parsers::cod::CodParser::getNextMap (   self)
def b3::parsers::cod::CodParser::getTeam (   self,
  team 
)
def b3::parsers::cod::CodParser::newPlayer (   self,
  cid,
  codguid,
  name 
)
def b3::parsers::cod::CodParser::OnA (   self,
  action,
  data,
  match = None 
)
def b3::parsers::cod::CodParser::OnD (   self,
  action,
  data,
  match = None 
)
def b3::parsers::cod::CodParser::OnExitlevel (   self,
  action,
  data,
  match = None 
)
def b3::parsers::cod::CodParser::OnInitgame (   self,
  action,
  data,
  match = None 
)
def b3::parsers::cod::CodParser::OnItem (   self,
  action,
  data,
  match = None 
)
def b3::parsers::cod::CodParser::OnJ (   self,
  action,
  data,
  match = None 
)

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

def b3::parsers::cod::CodParser::OnK (   self,
  action,
  data,
  match = None 
)
def b3::parsers::cod::CodParser::OnQ (   self,
  action,
  data,
  match = None 
)
def b3::parsers::cod::CodParser::OnSay (   self,
  action,
  data,
  match = None 
)
\
if self.type == b3.COMMAND:
    # we really need the second line
    text = self.read()
    if text:
msg = string.split(text[:-1], '^7: ', 1)
if not len(msg) == 2:
    return None
else:

Reimplemented from b3::parsers::q3a::abstractParser::AbstractParser.

def b3::parsers::cod::CodParser::OnSayteam (   self,
  action,
  data,
  match = None 
)
def b3::parsers::cod::CodParser::OnTell (   self,
  action,
  data,
  match = None 
)
def b3::parsers::cod::CodParser::setVersionExceptions (   self)
\
Dummy to enable shortversionexceptions for cod2.
Use this function in inheriting parsers to override certain vars based on ie. shortversion

Reimplemented in b3::parsers::cod2::Cod2Parser.

def b3::parsers::cod::CodParser::startup (   self)
\
Depreciated. Use onStartup().

Reimplemented from b3::parsers::q3a::abstractParser::AbstractParser.

Reimplemented in b3::parsers::cod6::Cod6Parser, and b3::parsers::cod7::Cod7Parser.

def b3::parsers::cod::CodParser::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 from b3::parsers::q3a::abstractParser::AbstractParser.

Reimplemented in b3::parsers::cod4::Cod4Parser.

def b3::parsers::cod::CodParser::unban (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
\
unban a given players

Reimplemented from b3::parsers::q3a::abstractParser::AbstractParser.

Reimplemented in b3::parsers::cod4::Cod4Parser.


Member Data Documentation

dictionary b3::parsers::cod::CodParser::_commands = {} [static, private]
dictionary b3::parsers::cod::CodParser::_counter = {} [static, private]
dictionary b3::parsers::cod::CodParser::_eventMap [static, private]
Initial value:
{
        'warmup' : b3.events.EVT_GAME_WARMUP,
        'restartgame' : b3.events.EVT_GAME_ROUND_END
    }

Reimplemented from b3::parsers::q3a::abstractParser::AbstractParser.

int b3::parsers::cod::CodParser::_guidLength = 6 [static, private]
tuple b3::parsers::cod::CodParser::_lineClear = re.compile(r'^(?:[0-9:]+\s?)?') [static, private]
Initial value:
(
        # server events
        re.compile(r'^(?P<action>[a-z]+):\s?(?P<data>.*)$', re.IGNORECASE),

        # world kills
        re.compile(r'^(?P<action>[A-Z]);(?P<data>(?P<guid>[^;]+);(?P<cid>[0-9-]{1,2});(?P<team>[a-z]+);(?P<name>[^;]+);(?P<aguid>[^;]*);(?P<acid>-1);(?P<ateam>world);(?P<aname>[^;]*);(?P<aweap>[a-z0-9_-]+);(?P<damage>[0-9.]+);(?P<dtype>[A-Z_]+);(?P<dlocation>[a-z_]+))$', re.IGNORECASE),
        # player kills/damage
        re.compile(r'^(?P<action>[A-Z]);(?P<data>(?P<guid>[^;]+);(?P<cid>[0-9]{1,2});(?P<team>[a-z]*);(?P<name>[^;]+);(?P<aguid>[^;]+);(?P<acid>[0-9]{1,2});(?P<ateam>[a-z]*);(?P<aname>[^;]+);(?P<aweap>[a-z0-9_-]+);(?P<damage>[0-9.]+);(?P<dtype>[A-Z_]+);(?P<dlocation>[a-z_]+))$', re.IGNORECASE),
        # suicides (cod4/cod5)
        re.compile(r'^(?P<action>[A-Z]);(?P<data>(?P<guid>[^;]+);(?P<cid>[0-9]{1,2});(?P<team>[a-z]*);(?P<name>[^;]+);(?P<aguid>[^;]*);(?P<acid>-1);(?P<ateam>[a-z]*);(?P<aname>[^;]+);(?P<aweap>[a-z0-9_-]+);(?P<damage>[0-9.]+);(?P<dtype>[A-Z_]+);(?P<dlocation>[a-z_]+))$', re.IGNORECASE),
        # suicides (cod7)
        re.compile(r'^(?P<action>[A-Z]);(?P<data>(?P<guid>[^;]+);(?P<cid>[0-9]{1,2});(?P<team>[a-z]*);(?P<name>[^;]+);(?P<aguid>[^;]*);(?P<acid>[0-9]{1,2});(?P<ateam>[a-z]*);(?P<aname>[^;]+);(?P<aweap>[a-z0-9_-]+);(?P<damage>[0-9.]+);(?P<dtype>[A-Z_]+);(?P<dlocation>[a-z_]+))$', re.IGNORECASE),

        #team actions
        re.compile(r'^(?P<action>[A-Z]);(?P<data>(?P<guid>[^;]+);(?P<cid>[0-9]{1,2});(?P<team>[a-z]+);(?P<name>[^;]+);(?P<type>[a-z_]+))$', re.IGNORECASE),
        
        # Join Team (cod5)
        re.compile(r'^(?P<action>JT);(?P<data>(?P<guid>[^;]+);(?P<cid>[0-9]{1,2});(?P<team>[a-z]+);(?P<name>[^;]+))$', re.IGNORECASE),

        # tell like events
        re.compile(r'^(?P<action>[a-z]+);(?P<data>(?P<guid>[^;]+);(?P<cid>[0-9]{1,2});(?P<name>[^;]+);(?P<aguid>[^;]+);(?P<acid>[0-9]{1,2});(?P<aname>[^;]+);(?P<text>.*))$', re.IGNORECASE),
        # say like events
        re.compile(r'^(?P<action>[a-z]+);(?P<data>(?P<guid>[^;]+);(?P<cid>[0-9]{1,2});(?P<name>[^;]+);(?P<text>.*))$', re.IGNORECASE),

        # all other events
        re.compile(r'^(?P<action>[A-Z]);(?P<data>(?P<guid>[^;]+);(?P<cid>[0-9]{1,2});(?P<name>[^;]+))$', re.IGNORECASE)
    )

Reimplemented from b3::parsers::q3a::abstractParser::AbstractParser.

int b3::parsers::cod::CodParser::_logSync = 3 [static, private]

Reimplemented in b3::parsers::cod2::Cod2Parser.

tuple b3::parsers::cod::CodParser::_pbRegExp = re.compile(r'^[0-9a-f]{32}$', re.IGNORECASE) [static, private]

Reimplemented in b3::parsers::cod2::Cod2Parser.

tuple b3::parsers::cod::CodParser::_regPlayer = re.compile(r'^(?P<slot>[0-9]+)\s+(?P<score>[0-9-]+)\s+(?P<ping>[0-9]+)\s+(?P<guid>[0-9]+)\s+(?P<name>.*?)\s+(?P<last>[0-9]+)\s+(?P<ip>[0-9.]+):(?P<port>[0-9-]+)\s+(?P<qport>[0-9]+)\s+(?P<rate>[0-9]+)$', re.I) [static, private]
tuple b3::parsers::cod::CodParser::_reMap = re.compile(r'map ([a-z0-9_-]+)', re.I) [static, private]
dictionary b3::parsers::cod::CodParser::_settings = {} [static, private]
string b3::parsers::cod::CodParser::gameName = 'cod' [static]

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