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

b3::parsers::homefront::HomefrontParser Class Reference

Inheritance diagram for b3::parsers::homefront::HomefrontParser:
b3::parser::Parser

List of all members.

Public Member Functions

def startup
def routePacket
def run
def onServerHello
def onServerAuth
def onServerLogin
def onServerUid
def onServerLogout
def onServerTeam_change
def onServerClan_change
def onServerKill
def onServerRound_over
def onServerChange_level
def onServerPlayerping
def onChatterBroadcast
def onChatter
def onServerBan_remove
def onServerBan_added
def onServerPlayer
def onServerBan_item
def onServerVotestart
def onServerVote
def onServerVoteend
def getPlayerList
def authorizeClients
def sync
def say
def saybig
def message
def kick
def ban
def unban
def tempban
def getMap
def getNextMap
def getMaps
def checkMapline
def rotateMap
def changeMap
def getEasyName
def getPlayerPings
def getPlayerScores
def getTeam
def inflictCustomPenalty
def getClient
def getClientByUidOrCreate
def getftpini
def ftpconnect
def retrieveBanList
def retrievePlayerList

Public Attributes

 input

Static Public Attributes

string gameName = "homefront"
 OutputClass = rcon.Rcon
 PunkBuster = None
 ftpconfig = None
 maplist = None
 mapgamelist = None
string prefix = '%s: '

Private Member Functions

def _handle_connection_close

Private Attributes

 _pauseNotice
 _original_connection_handle_close_method
 _nbConsecutiveConnFailure

Static Private Attributes

 _serverConnection = None
tuple _reColor = re.compile(r'(\^[0-9])')
 _currentmap = None
 [string: Map] example : fl-harbor
 _ini_file = None
tuple _mapline = re.compile(r'^(?P<start>Map=)(?P<mapname>[^\?]+)\?(?P<sep>GameMode=)(?P<gamemode>.*)$', re.IGNORECASE)
tuple _reSteamId64 = re.compile(r'^[0-9]{17}$')
int _ftplib_debug_level = 0
int _connectionTimeout = 30
int _playerlistInterval = 15
dictionary _server_banlist = {}
dictionary _commands = {}
dictionary _settings

Detailed Description

The HomeFront B3 parser class

Member Function Documentation

def b3::parsers::homefront::HomefrontParser::_handle_connection_close (   self) [private]
def b3::parsers::homefront::HomefrontParser::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::parser::Parser.

def b3::parsers::homefront::HomefrontParser::ban (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
\
ban a given player

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::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 from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::checkMapline (   self,
  line 
)
def b3::parsers::homefront::HomefrontParser::ftpconnect (   self)
def b3::parsers::homefront::HomefrontParser::getClient (   self,
  name 
)
return a already connected client by searching the 
clients cid index.

This method can return None
def b3::parsers::homefront::HomefrontParser::getClientByUidOrCreate (   self,
  uid,
  name 
)
return a already connected client by searching the 
clients guid index or create a new client

This method can return None
def b3::parsers::homefront::HomefrontParser::getEasyName (   self,
  mapname 
)
Change levelname to real name 
def b3::parsers::homefront::HomefrontParser::getftpini (   self)
def b3::parsers::homefront::HomefrontParser::getMap (   self)
\
return the current map/level name

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::getMaps (   self)
\
return the available maps/levels name

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::getNextMap (   self)
Return the name of the next map
def b3::parsers::homefront::HomefrontParser::getPlayerList (   self)
\
Returns a list of client objects

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::getPlayerPings (   self)
\
returns a dict having players' id for keys and players' ping for values

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::getPlayerScores (   self)
\
returns a dict having players' id for keys and players' scores for values

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::getTeam (   self,
  team 
)
def b3::parsers::homefront::HomefrontParser::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' or anything you want.
/!\ This method must return True if the penalty was inflicted.

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::kick (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
\
kick a given player

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::message (   self,
  client,
  text 
)
Todo:
Change private messages when the rcon protocol will allow us to
\
display a message to a given player

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::onChatter (   self,
  data 
)
\
Everything that is said by the server or a player is sent over this channel.
All onChatterBroadcast messages also reappear here.
def b3::parsers::homefront::HomefrontParser::onChatterBroadcast (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerAuth (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerBan_added (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerBan_item (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerBan_remove (   self,
  data 
)
[int: SteamID] 
def b3::parsers::homefront::HomefrontParser::onServerChange_level (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerClan_change (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerHello (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerKill (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerLogin (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerLogout (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerPlayer (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerPlayerping (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerRound_over (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerTeam_change (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerUid (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerVote (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerVoteend (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::onServerVotestart (   self,
  data 
)
def b3::parsers::homefront::HomefrontParser::retrieveBanList (   self)
\
Send RETRIEVE BANLIST to the server
def b3::parsers::homefront::HomefrontParser::retrievePlayerList (   self)
\
Send RETRIEVE PLAYERLIST to the server to trigger onServerPlayer return events
def b3::parsers::homefront::HomefrontParser::rotateMap (   self)
\
load the next map/level

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::routePacket (   self,
  packet 
)
def b3::parsers::homefront::HomefrontParser::run (   self)
Main worker thread for B3

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::say (   self,
  msg 
)
\
broadcast a message to all players

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::saybig (   self,
  msg 
)
\
broadcast a message to all players in a way that will catch their attention.

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::startup (   self)
\
Called after the parser is created before run(). Overwrite this
for anything you need to initialize you parser with.

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::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::parser::Parser.

def b3::parsers::homefront::HomefrontParser::tempban (   self,
  client,
  reason = '',
  duration = 2,
  admin = None,
  silent = False,
  kwargs 
)
\
tempban a given player

Reimplemented from b3::parser::Parser.

def b3::parsers::homefront::HomefrontParser::unban (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
Todo:
Need to test response from the server
\
unban a given player

Reimplemented from b3::parser::Parser.


Member Data Documentation

dictionary b3::parsers::homefront::HomefrontParser::_commands = {} [static, private]

Reimplemented from b3::parser::Parser.

[string: Map] example : fl-harbor

tuple b3::parsers::homefront::HomefrontParser::_mapline = re.compile(r'^(?P<start>Map=)(?P<mapname>[^\?]+)\?(?P<sep>GameMode=)(?P<gamemode>.*)$', re.IGNORECASE) [static, private]
tuple b3::parsers::homefront::HomefrontParser::_reColor = re.compile(r'(\^[0-9])') [static, private]

Reimplemented from b3::parser::Parser.

tuple b3::parsers::homefront::HomefrontParser::_reSteamId64 = re.compile(r'^[0-9]{17}$') [static, private]
Initial value:
{'line_length': 90, 
                 'min_wrap_length': 100}

Reimplemented from b3::parser::Parser.

Reimplemented from b3::parser::Parser.

Reimplemented from b3::parser::Parser.


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