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

b3::parsers::ravaged::RavagedParser Class Reference

Inheritance diagram for b3::parsers::ravaged::RavagedParser:
b3::parser::Parser b3::parser::Parser

List of all members.

Public Member Functions

def __new__
def startup
 B3 parser initialisation steps.
def pluginsStarted
def on_connected
 Game events handlers.
def on_entered_the_game
def on_joined_team
def on_disconnected
def on_server_say
def on_server_say
def on_loading_map
def on_round_started
def on_round_finished
def on_say
def on_say_team
def on_committed_suicide
def on_killed
def on_connected_remotely
def on_disconnected_from_rcon
def on_unknown_line
def getPlayerList
 B3 Parser interface implementation.
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 rotateMap
def changeMap
def getPlayerPings
def getPlayerScores
def inflictCustomPenalty
def getWrap
 Other methods.
def getClientOrCreate
def getTeam
def do_kick
def do_ban
def do_tempban
def do_unban
def getmaplist
def getMapsSoundingLike
def getplayerlist
def set_map
def run
 B3 parser game event thread stuff.
def setup_game_connection
def close_game_connection
def handle_game_event
def route_game_event
def shutdown
def __new__
def startup
 B3 parser initialisation steps.
def pluginsStarted
def on_connected
 Game events handlers.
def on_entered_the_game
def on_joined_team
def on_disconnected
def on_server_say
def on_server_say
def on_loading_map
def on_round_started
def on_round_finished
def on_say
def on_say_team
def on_committed_suicide
def on_killed
def on_connected_remotely
def on_disconnected_from_rcon
def on_unknown_line
def getPlayerList
 B3 Parser interface implementation.
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 rotateMap
def changeMap
def getPlayerPings
def getPlayerScores
def inflictCustomPenalty
def getWrap
 Other methods.
def getClientOrCreate
def getTeam
def do_kick
def do_ban
def do_tempban
def do_unban
def getmaplist
def getMapsSoundingLike
def getplayerlist
def set_map
def run
 B3 parser game event thread stuff.
def setup_game_connection
def close_game_connection
def handle_game_event
def route_game_event
def shutdown

Public Attributes

 exitcode
 the block below can activate additional logging for the RavagedServer class ravagedServerLogger = logging.getLogger("RavagedServer") for handler in logging.getLogger('output').handlers: ravagedServerLogger.addHandler(handler) ravagedServerLogger.setLevel(logging.getLogger('output').level)

Static Public Attributes

string gameName = 'ravaged'
 privateMsg = True
 OutputClass = RavagedRcon
 PunkBuster = None
tuple game_event_queue = Queue(400)
tuple game_event_queue_stop_token = object()

Static Private Attributes

dictionary _settings
 _serverConnection = None
int _nbConsecutiveConnFailure = 0
tuple _reColor = re.compile(r'(\^[0-9])')

Detailed Description

Ravaged B3 parser

Member Function Documentation

def b3::parsers::ravaged::RavagedParser::__new__ (   cls,
  args,
  kwargs 
)
def b3::parsers::ravaged::RavagedParser::__new__ (   cls,
  args,
  kwargs 
)
def b3::parsers::ravaged::RavagedParser::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::ravaged::RavagedParser::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::ravaged::RavagedParser::ban (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
\
ban a given player on the game server and in case of success
fire the event ('EVT_CLIENT_BAN', data={'reason': reason,
'admin': admin}, client=target)

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::ban (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
\
ban a given player on the game server and in case of success
fire the event ('EVT_CLIENT_BAN', data={'reason': reason,
'admin': admin}, client=target)

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::changeMap (   self,
  map_name 
)
\
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::ravaged::RavagedParser::changeMap (   self,
  map_name 
)
\
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::ravaged::RavagedParser::close_game_connection (   self)
def b3::parsers::ravaged::RavagedParser::close_game_connection (   self)
def b3::parsers::ravaged::RavagedParser::do_ban (   self,
  client,
  reason = None 
)
def b3::parsers::ravaged::RavagedParser::do_ban (   self,
  client,
  reason = None 
)
def b3::parsers::ravaged::RavagedParser::do_kick (   self,
  client,
  reason = None 
)
def b3::parsers::ravaged::RavagedParser::do_kick (   self,
  client,
  reason = None 
)
def b3::parsers::ravaged::RavagedParser::do_tempban (   self,
  client,
  duration = 2,
  reason = None 
)
def b3::parsers::ravaged::RavagedParser::do_tempban (   self,
  client,
  duration = 2,
  reason = None 
)
def b3::parsers::ravaged::RavagedParser::do_unban (   self,
  client 
)
def b3::parsers::ravaged::RavagedParser::do_unban (   self,
  client 
)
def b3::parsers::ravaged::RavagedParser::getClientOrCreate (   self,
  guid,
  name,
  team = None 
)
return an already connected client by searching the clients guid index
or create a new client.
def b3::parsers::ravaged::RavagedParser::getClientOrCreate (   self,
  guid,
  name,
  team = None 
)
return an already connected client by searching the clients guid index
or create a new client.
def b3::parsers::ravaged::RavagedParser::getMap (   self)
\
return the current map/level name

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::getMap (   self)
\
return the current map/level name

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::getmaplist (   self)
return the available maps on the server, even if not in the map rotation list
def b3::parsers::ravaged::RavagedParser::getmaplist (   self)
return the available maps on the server, even if not in the map rotation list
def b3::parsers::ravaged::RavagedParser::getMaps (   self)
\
return the available maps/levels name

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::getMapsSoundingLike (   self,
  mapname 
)
return a valid mapname.
If no exact match is found, then return close candidates as a list
def b3::parsers::ravaged::RavagedParser::getMapsSoundingLike (   self,
  mapname 
)
return a valid mapname.
If no exact match is found, then return close candidates as a list
def b3::parsers::ravaged::RavagedParser::getNextMap (   self)
return the next map in the map rotation list

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::getNextMap (   self)
return the next map in the map rotation list

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::getPlayerList (   self)

B3 Parser interface implementation.

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

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::getPlayerList (   self)

B3 Parser interface implementation.

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

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::getplayerlist (   self)
- query the server for connected players' info
- create Client objects for never seen before players
- update Client objects info
- return a dict<cid, Client>
def b3::parsers::ravaged::RavagedParser::getplayerlist (   self)
- query the server for connected players' info
- create Client objects for never seen before players
- update Client objects info
- return a dict<cid, Client>
def b3::parsers::ravaged::RavagedParser::getPlayerPings (   self)
\
returns a dict having players' id for keys and players' ping for values

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::getTeam (   self,
  team 
)
convert Ravaged team id to B3 team numbers
def b3::parsers::ravaged::RavagedParser::getTeam (   self,
  team 
)
convert Ravaged team id to B3 team numbers
def b3::parsers::ravaged::RavagedParser::getWrap (   self,
  text,
  length = 80,
  minWrapLen = 150 
)

Other methods.

Returns a sequence of lines for text that fits within the limits

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::getWrap (   self,
  text,
  length = 80,
  minWrapLen = 150 
)

Other methods.

Returns a sequence of lines for text that fits within the limits

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::handle_game_event (   self,
  ravaged_event 
)
def b3::parsers::ravaged::RavagedParser::handle_game_event (   self,
  ravaged_event 
)
def b3::parsers::ravaged::RavagedParser::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 from b3::parser::Parser.

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

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

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::message (   self,
  client,
  msg 
)
\
display a message to a given player

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::message (   self,
  client,
  msg 
)
\
display a message to a given player

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::on_committed_suicide (   self,
  name,
  guid,
  team,
  weapon 
)
def b3::parsers::ravaged::RavagedParser::on_committed_suicide (   self,
  name,
  guid,
  team,
  weapon 
)
def b3::parsers::ravaged::RavagedParser::on_connected (   self,
  name,
  guid,
  team,
  ip 
)
def b3::parsers::ravaged::RavagedParser::on_connected (   self,
  name,
  guid,
  team,
  ip 
)
def b3::parsers::ravaged::RavagedParser::on_connected_remotely (   self,
  ip,
  port 
)
def b3::parsers::ravaged::RavagedParser::on_connected_remotely (   self,
  ip,
  port 
)
def b3::parsers::ravaged::RavagedParser::on_disconnected (   self,
  name,
  guid,
  team 
)
def b3::parsers::ravaged::RavagedParser::on_disconnected (   self,
  name,
  guid,
  team 
)
def b3::parsers::ravaged::RavagedParser::on_disconnected_from_rcon (   self,
  login,
  ip,
  port 
)
def b3::parsers::ravaged::RavagedParser::on_disconnected_from_rcon (   self,
  login,
  ip,
  port 
)
def b3::parsers::ravaged::RavagedParser::on_entered_the_game (   self,
  name,
  guid,
  team 
)
def b3::parsers::ravaged::RavagedParser::on_entered_the_game (   self,
  name,
  guid,
  team 
)
def b3::parsers::ravaged::RavagedParser::on_joined_team (   self,
  name,
  guid,
  new_team 
)
def b3::parsers::ravaged::RavagedParser::on_joined_team (   self,
  name,
  guid,
  new_team 
)
def b3::parsers::ravaged::RavagedParser::on_killed (   self,
  name_a,
  guid_a,
  team_a,
  name_b,
  guid_b,
  team_b,
  weapon 
)
def b3::parsers::ravaged::RavagedParser::on_killed (   self,
  name_a,
  guid_a,
  team_a,
  name_b,
  guid_b,
  team_b,
  weapon 
)
def b3::parsers::ravaged::RavagedParser::on_loading_map (   self,
  map_name 
)
def b3::parsers::ravaged::RavagedParser::on_loading_map (   self,
  map_name 
)
def b3::parsers::ravaged::RavagedParser::on_round_finished (   self,
  team 
)
def b3::parsers::ravaged::RavagedParser::on_round_finished (   self,
  team 
)
def b3::parsers::ravaged::RavagedParser::on_round_started (   self)
def b3::parsers::ravaged::RavagedParser::on_round_started (   self)
def b3::parsers::ravaged::RavagedParser::on_say (   self,
  name,
  guid,
  team,
  text 
)
def b3::parsers::ravaged::RavagedParser::on_say (   self,
  name,
  guid,
  team,
  text 
)
def b3::parsers::ravaged::RavagedParser::on_say_team (   self,
  name,
  guid,
  team,
  text 
)
def b3::parsers::ravaged::RavagedParser::on_say_team (   self,
  name,
  guid,
  team,
  text 
)
def b3::parsers::ravaged::RavagedParser::on_server_say (   self,
  text,
  team 
)
def b3::parsers::ravaged::RavagedParser::on_server_say (   self,
  data 
)
def b3::parsers::ravaged::RavagedParser::on_server_say (   self,
  text,
  team 
)
def b3::parsers::ravaged::RavagedParser::on_server_say (   self,
  data 
)
def b3::parsers::ravaged::RavagedParser::on_unknown_line (   self,
  data 
)
catch all lines that were not handled
def b3::parsers::ravaged::RavagedParser::on_unknown_line (   self,
  data 
)
catch all lines that were not handled
def b3::parsers::ravaged::RavagedParser::pluginsStarted (   self)
Called once all plugins were started.
Handy if some of them must be monkey-patched.

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::pluginsStarted (   self)
Called once all plugins were started.
Handy if some of them must be monkey-patched.

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::rotateMap (   self)
\
load the next map/level

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::rotateMap (   self)
\
load the next map/level

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::route_game_event (   self,
  game_event 
)
def b3::parsers::ravaged::RavagedParser::route_game_event (   self,
  game_event 
)
def b3::parsers::ravaged::RavagedParser::run (   self)

B3 parser game event thread stuff.

Main worker thread for B3

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::run (   self)

B3 parser game event thread stuff.

Main worker thread for B3

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::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::ravaged::RavagedParser::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::ravaged::RavagedParser::set_map (   self,
  new_map 
)
update self.game with mapName and gameType
:param new_map: new map name
:return: None
def b3::parsers::ravaged::RavagedParser::set_map (   self,
  new_map 
)
update self.game with mapName and gameType
:param new_map: new map name
:return: None
def b3::parsers::ravaged::RavagedParser::setup_game_connection (   self)
def b3::parsers::ravaged::RavagedParser::setup_game_connection (   self)
def b3::parsers::ravaged::RavagedParser::shutdown (   self)
Shutdown B3

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::shutdown (   self)
Shutdown B3

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::startup (   self)

B3 parser initialisation steps.

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::startup (   self)

B3 parser initialisation steps.

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::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::ravaged::RavagedParser::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::ravaged::RavagedParser::tempban (   self,
  client,
  reason = '',
  duration = 2,
  admin = None,
  silent = False,
  kwargs 
)
\
tempban a given player on the game server and in case of success
fire the event ('EVT_CLIENT_BAN_TEMP', data={'reason': reason,
'duration': duration, 'admin': admin}, client=target)

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::tempban (   self,
  client,
  reason = '',
  duration = 2,
  admin = None,
  silent = False,
  kwargs 
)
\
tempban a given player on the game server and in case of success
fire the event ('EVT_CLIENT_BAN_TEMP', data={'reason': reason,
'duration': duration, 'admin': admin}, client=target)

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::unban (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
\
unban a given player on the game server

Reimplemented from b3::parser::Parser.

def b3::parsers::ravaged::RavagedParser::unban (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
\
unban a given player on the game server

Reimplemented from b3::parser::Parser.


Member Data Documentation

tuple b3::parsers::ravaged::RavagedParser::_reColor = re.compile(r'(\^[0-9])') [static, private]

Reimplemented from b3::parser::Parser.

dictionary b3::parsers::ravaged::RavagedParser::_settings [static, private]
Initial value:
{
        'line_length': 180,
        'min_wrap_length': 180,
        'private_message_color': '00FC48',
        'say_color': 'F2C880',
        'saybig_color': 'FC00E2',
    }

Reimplemented from b3::parser::Parser.

the block below can activate additional logging for the RavagedServer class ravagedServerLogger = logging.getLogger("RavagedServer") for handler in logging.getLogger('output').handlers: ravagedServerLogger.addHandler(handler) ravagedServerLogger.setLevel(logging.getLogger('output').level)

Reimplemented from b3::parser::Parser.

string b3::parsers::ravaged::RavagedParser::gameName = 'ravaged' [static]

Reimplemented from b3::parser::Parser.

Reimplemented from b3::parser::Parser.


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