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

b3::parsers::ro2::Ro2Parser Class Reference

Inheritance diagram for b3::parsers::ro2::Ro2Parser:
b3::parser::Parser b3::parser::Parser

List of all members.

Public Member Functions

def startup
def handle_chat
def run
def readwriteweb
def webconnect
def readwriteajax
def addplus
def decode_chat_data
def onChat_typeChatnotice
def onChat_typeChatmessage
def getUsername
def decodeplayers
def decode_nextplayer
def decodeBans
def getPlayerList
def write
def writelines
def writeAdminCommand
def getServerPlayerList
def authorizeClients
def findNewPlayers
def syncDeletions
def sync
def say
def message
def kick
def ban
def unban
def tempban
def getMaps
def changeMap
def getMap
def getNextMap
def getPlayerPings
def getPlayerScores
def getTeam
def getClient
def getClientByUidOrCreate
def retrievePlayerList
def retrieveBanlist
def stripMsgColors
def stripColors
def getftpini
def ftpconnect
def rotateMap
def startup
def handle_chat
def run
def readwriteweb
def webconnect
def readwriteajax
def addplus
def decode_chat_data
def onChat_typeChatnotice
def onChat_typeChatmessage
def getUsername
def decodeplayers
def decode_nextplayer
def decodeBans
def getPlayerList
def write
def writelines
def writeAdminCommand
def getServerPlayerList
def authorizeClients
def findNewPlayers
def syncDeletions
def sync
def say
def message
def kick
def ban
def unban
def tempban
def getMaps
def changeMap
def getMap
def getNextMap
def getPlayerPings
def getPlayerScores
def getTeam
def getClient
def getClientByUidOrCreate
def retrievePlayerList
def retrieveBanlist
def stripMsgColors
def stripColors
def getftpini
def ftpconnect
def rotateMap

Public Attributes

 username
 input
 user_agent
 headers
 site
 login_page
 password
 password_hash
 url
 working
 map_cycles
 map_cycle_no
 active_map_cycle

Static Public Attributes

string gameName = "redorchestra2"
 privateMsg = True
 PunkBuster = None
 ftpconfig = None
string url = ''
string login_page = ''
string site = ''
string user_agent = ''
string username = ''
string password = ''
string password_hash = ''
 cj = None
dictionary headers = {}
 opener = None
dictionary map_cycles = {}
int map_cycle_no = 0
int active_map_cycle = 0
string prefix = '%s: '

Private Attributes

 _paused
 _pauseNotice
 _nbConsecutiveConnFailure

Static Private Attributes

tuple _reColor = re.compile(r'(\^[0-9])')
tuple _reSteamId64 = re.compile(r'^[0-9]{17}$')
int _ftplib_debug_level = 0
int _ftpconnectionTimeout = 30
int _playerlistInterval = 30
dictionary _server_banlist = {}
int _read_write_delay = 1
list _write_queue = []
list _read_queue = []
 _ini_file = False
dictionary _gametypes = {"TE" : "ROGame.ROGameInfoTerritories", "CD" : "ROGame.ROGameInfoCountdown", "FF" : "ROGame.ROGameInfoFirefight" }
dictionary _maps
dictionary _commands = {}
dictionary _settings

Detailed Description

The Ref Orchestra 2 B3 parser class

Member Function Documentation

def b3::parsers::ro2::Ro2Parser::addplus (   self,
  message 
)
Replace spaces with plusses ready for sending to the Ajax interface
also replaces other characters that mess up html
def b3::parsers::ro2::Ro2Parser::addplus (   self,
  message 
)
Replace spaces with plusses ready for sending to the Ajax interface
also replaces other characters that mess up html
def b3::parsers::ro2::Ro2Parser::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::ro2::Ro2Parser::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::ro2::Ro2Parser::ban (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
\
ban a given player

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::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::ro2::Ro2Parser::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::ro2::Ro2Parser::decode_chat_data (   self,
  data 
)
Decode the data reeived from the web interface and extract the chat data
def b3::parsers::ro2::Ro2Parser::decode_chat_data (   self,
  data 
)
Decode the data reeived from the web interface and extract the chat data
def b3::parsers::ro2::Ro2Parser::decode_nextplayer (   self,
  data 
)
Get the next players details from the web data
def b3::parsers::ro2::Ro2Parser::decode_nextplayer (   self,
  data 
)
Get the next players details from the web data
def b3::parsers::ro2::Ro2Parser::decodeBans (   self,
  data 
)
Retrieve the list of Bans from the web data
def b3::parsers::ro2::Ro2Parser::decodeBans (   self,
  data 
)
Retrieve the list of Bans from the web data
def b3::parsers::ro2::Ro2Parser::decodeplayers (   self,
  data 
)
Get the list of players from the web data
def b3::parsers::ro2::Ro2Parser::decodeplayers (   self,
  data 
)
Get the list of players from the web data
def b3::parsers::ro2::Ro2Parser::findNewPlayers (   self,
  c_client_list 
)
Gets a list of non-authed players on the server
def b3::parsers::ro2::Ro2Parser::findNewPlayers (   self,
  c_client_list 
)
Gets a list of non-authed players on the server
def b3::parsers::ro2::Ro2Parser::ftpconnect (   self)
def b3::parsers::ro2::Ro2Parser::ftpconnect (   self)
def b3::parsers::ro2::Ro2Parser::getClient (   self,
  name 
)
return a already connected client by searching the 
clients cid index.

This method can return None
def b3::parsers::ro2::Ro2Parser::getClient (   self,
  name 
)
return a already connected client by searching the 
clients cid index.

This method can return None
def b3::parsers::ro2::Ro2Parser::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::ro2::Ro2Parser::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::ro2::Ro2Parser::getftpini (   self)
def b3::parsers::ro2::Ro2Parser::getftpini (   self)
def b3::parsers::ro2::Ro2Parser::getMap (   self)
\
load the next map/level

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::getMap (   self)
\
load the next map/level

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::getNextMap (   self)
\
load the next map/level

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::getNextMap (   self)
\
load the next map/level

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::getPlayerList (   self)
\
Returns a list of client objects

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::getPlayerList (   self)
\
Returns a list of client objects

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::getServerPlayerList (   self)
\
Returns a list of client objects
def b3::parsers::ro2::Ro2Parser::getServerPlayerList (   self)
\
Returns a list of client objects
def b3::parsers::ro2::Ro2Parser::getTeam (   self,
  team 
)
Get the players team
def b3::parsers::ro2::Ro2Parser::getTeam (   self,
  team 
)
Get the players team
def b3::parsers::ro2::Ro2Parser::getUsername (   self,
  name 
)
Retrieve the username and make it 'safe' 
def b3::parsers::ro2::Ro2Parser::getUsername (   self,
  name 
)
Retrieve the username and make it 'safe' 
def b3::parsers::ro2::Ro2Parser::handle_chat (   self,
  data 
)
Handle the chat from players
def b3::parsers::ro2::Ro2Parser::handle_chat (   self,
  data 
)
Handle the chat from players
def b3::parsers::ro2::Ro2Parser::kick (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
\
kick a given player

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::message (   self,
  client,
  text 
)
\
display a message to a given player

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::message (   self,
  client,
  text 
)
\
display a message to a given player

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::onChat_typeChatmessage (   self,
  data 
)
Handle player chat
def b3::parsers::ro2::Ro2Parser::onChat_typeChatmessage (   self,
  data 
)
Handle player chat
def b3::parsers::ro2::Ro2Parser::onChat_typeChatnotice (   self,
  data 
)
Ignore Admin messages
def b3::parsers::ro2::Ro2Parser::onChat_typeChatnotice (   self,
  data 
)
Ignore Admin messages
def b3::parsers::ro2::Ro2Parser::readwriteajax (   self,
  message = None 
)
Read and Write to the Ajax interface
def b3::parsers::ro2::Ro2Parser::readwriteajax (   self,
  message = None 
)
Read and Write to the Ajax interface
def b3::parsers::ro2::Ro2Parser::readwriteweb (   self,
  data = None,
  referer = None,
  addurl = None 
)
Handles Reading and Writing to the web interface
def b3::parsers::ro2::Ro2Parser::readwriteweb (   self,
  data = None,
  referer = None,
  addurl = None 
)
Handles Reading and Writing to the web interface
def b3::parsers::ro2::Ro2Parser::retrieveBanlist (   self)
\
Returns a list of banned player from the server
def b3::parsers::ro2::Ro2Parser::retrieveBanlist (   self)
\
Returns a list of banned player from the server
def b3::parsers::ro2::Ro2Parser::retrievePlayerList (   self)
\
Retrieve list of players on the server
def b3::parsers::ro2::Ro2Parser::retrievePlayerList (   self)
\
Retrieve list of players on the server
def b3::parsers::ro2::Ro2Parser::rotateMap (   self)
\
load the next map/level

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::rotateMap (   self)
\
load the next map/level

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::run (   self)
Main worker thread for B3

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::run (   self)
Main worker thread for B3

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::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::ro2::Ro2Parser::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::ro2::Ro2Parser::stripColors (   self,
  text 
)

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::stripColors (   self,
  text 
)

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::stripMsgColors (   self,
  text 
)
def b3::parsers::ro2::Ro2Parser::stripMsgColors (   self,
  text 
)
def b3::parsers::ro2::Ro2Parser::sync (   self,
  connected_clients = None 
)
\
if connected_clients is None :
    get dict of connected players from self.getPlayerList()
else use connected_clients as the list of connected players 
For all connected players, 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.
def b3::parsers::ro2::Ro2Parser::sync (   self,
  connected_clients = None 
)
\
if connected_clients is None :
    get dict of connected players from self.getPlayerList()
else use connected_clients as the list of connected players 
For all connected players, 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.
def b3::parsers::ro2::Ro2Parser::syncDeletions (   self,
  connected_clients 
)
\
Check Clients list against all connected players returned by self.getServerPlayerList() and 
if required call the client.disconnect() method to remove a client from self.clients.
def b3::parsers::ro2::Ro2Parser::syncDeletions (   self,
  connected_clients 
)
\
Check Clients list against all connected players returned by self.getServerPlayerList() and 
if required call the client.disconnect() method to remove a client from self.clients.
def b3::parsers::ro2::Ro2Parser::tempban (   self,
  client,
  reason = '',
  duration = 2,
  admin = None,
  silent = False,
  kwargs 
)
\
tempban a given player

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::unban (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
\
unban a given player

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::unban (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
\
unban a given player

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::webconnect (   self)
Login and make initial connection to the web interface
def b3::parsers::ro2::Ro2Parser::webconnect (   self)
Login and make initial connection to the web interface
def b3::parsers::ro2::Ro2Parser::write (   self,
  msg,
  maxRetries = None 
)
Write a message to Console via Ajax

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::write (   self,
  msg,
  maxRetries = None 
)
Write a message to Console via Ajax

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::writeAdminCommand (   self,
  cmd 
)
Write an Admin command via the Web interface console (Limited in what actually works)
def b3::parsers::ro2::Ro2Parser::writeAdminCommand (   self,
  cmd 
)
Write an Admin command via the Web interface console (Limited in what actually works)
def b3::parsers::ro2::Ro2Parser::writelines (   self,
  msg 
)
Write a sequence of messages to Console via Ajax.

Reimplemented from b3::parser::Parser.

def b3::parsers::ro2::Ro2Parser::writelines (   self,
  msg 
)
Write a sequence of messages to Console via Ajax.

Reimplemented from b3::parser::Parser.


Member Data Documentation

dictionary b3::parsers::ro2::Ro2Parser::_commands = {} [static, private]

Reimplemented from b3::parser::Parser.

dictionary b3::parsers::ro2::Ro2Parser::_gametypes = {"TE" : "ROGame.ROGameInfoTerritories", "CD" : "ROGame.ROGameInfoCountdown", "FF" : "ROGame.ROGameInfoFirefight" } [static, private]
b3::parsers::ro2::Ro2Parser::_ini_file = False [static, private]
dictionary b3::parsers::ro2::Ro2Parser::_maps [static, private]
Initial value:
{"TE" : ['TE-Apartments', 'TE-Barracks', 'TE-CommisarsHouse', 'TE-FallenFighters', 'TE-GrainElevator', 'TE-Gumrak', 'TE-PavlovsHouse', 'TE-RedOctoberFactory', 'TE-Spartanovka', 'TE-Station'],
            "CD" : ['CD-Apartments', 'CD-Barracks', 'CD-CommisarsHouse', 'CD-FallenFighters', 'CD-GrainElevator', 'CD-Gumrak', 'CD-PavlovsHouse', 'CD-RedOctoberFactory', 'CD-Spartanovka', 'CD-Station'],
            "FF" : ['FF-Apartments', 'FF-Barracks', 'FF-GrainElevator', 'FF-Station']
            }
list b3::parsers::ro2::Ro2Parser::_read_queue = [] [static, private]
tuple b3::parsers::ro2::Ro2Parser::_reColor = re.compile(r'(\^[0-9])') [static, private]

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

list b3::parsers::ro2::Ro2Parser::_write_queue = [] [static, private]
string b3::parsers::ro2::Ro2Parser::gameName = "redorchestra2" [static]

Reimplemented from b3::parser::Parser.

dictionary b3::parsers::ro2::Ro2Parser::headers = {} [static]
dictionary b3::parsers::ro2::Ro2Parser::map_cycles = {} [static]
string b3::parsers::ro2::Ro2Parser::prefix = '%s: ' [static]

Reimplemented from b3::parser::Parser.

Reimplemented from b3::parser::Parser.

string b3::parsers::ro2::Ro2Parser::site = '' [static]
string b3::parsers::ro2::Ro2Parser::url = '' [static]

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