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

b3::parsers::battleye::abstractParser::AbstractParser Class Reference

Inheritance diagram for b3::parsers::battleye::abstractParser::AbstractParser:
b3::parser::Parser b3::parser::Parser b3::parsers::arma2::Arma2Parser b3::parsers::arma2::Arma2Parser

List of all members.

Public Member Functions

def run
def setup_battleye_connection
def close_battleye_connection
def OnBattleyeEvent
def routeBattleyeEvent
def startup
def pluginsStarted
def sayqueuelistener_worker
def start_sayqueue_worker
def getCommand
def write
def OnPlayerChat
 Battleye events handlers.
def OnPlayerLeave
def OnPlayerConnected
def OnUnverifiedGUID
def OnVerifiedGUID
def OnServerMessage
def OnBattleyeKick
def OnUnknownEvent
def getClient
 B3 Parser interface implementation.
def getPlayerList
def authorizeClients
def sync
def say
def saybig
def kick
def message
def ban
def unban
def tempban
def getMap
def getMaps
def rotateMap
def changeMap
def getPlayerPings
def getPlayerScores
def getTeam
def getBanlist
 Other methods.
def load_conf_max_say_line_length
def load_config_message_delay
def load_protocol_logging
def load_use_unverified_guid
def shutdown
def restart
def getWrap
def run
def setup_battleye_connection
def close_battleye_connection
def OnBattleyeEvent
def routeBattleyeEvent
def startup
def pluginsStarted
def sayqueuelistener_worker
def start_sayqueue_worker
def getCommand
def write
def OnPlayerChat
 Battleye events handlers.
def OnPlayerLeave
def OnPlayerConnected
def OnUnverifiedGUID
def OnVerifiedGUID
def OnServerMessage
def OnBattleyeKick
def OnUnknownEvent
def getClient
 B3 Parser interface implementation.
def getPlayerList
def authorizeClients
def sync
def say
def saybig
def kick
def message
def ban
def unban
def tempban
def getMap
def getMaps
def rotateMap
def changeMap
def getPlayerPings
def getPlayerScores
def getTeam
def getBanlist
 Other methods.
def load_conf_max_say_line_length
def load_config_message_delay
def load_protocol_logging
def load_use_unverified_guid
def shutdown
def restart
def getWrap

Public Attributes

 exitcode
 the block below can activate additional logging for the BattleyeServer class

Static Public Attributes

 gameName = None
int SAY_LINE_MAX_LENGTH = 128
 OutputClass = BattleyeRcon
tuple battleye_event_queue = Queue.Queue(400)
tuple sayqueue = Queue.Queue(100)
 sayqueuelistener = None
tuple re_playerlist = re.compile(r'''^\s*(?P<cid>[0-9]+)\s+(?P<ip>[0-9.]+):(?P<port>[0-9]+)\s+(?P<ping>[0-9-]+)\s+(?P<guid>[0-9a-f]+)\((?P<verified>[A-Z\?]+)\)\s+(?P<name>.*?)(?:\s+(?P<lobby>\(Lobby\)))?$''', re.I|re.MULTILINE)

Private Member Functions

def _say
def _say

Static Private Attributes

 _serverConnection = None
int _nbConsecutiveConnFailure = 0
tuple _reColor = re.compile(r'(\^[0-9])')
tuple _reSafename = re.compile(r"('|\\)")
dictionary _settings
tuple _gameServerVars = ()
dictionary _commands
dictionary _eventMap
tuple _regPlayer = re.compile(r'^(?P<cid>[0-9]+)\s+(?P<ip>[0-9.]+):(?P<port>[0-9]+)\s+(?P<ping>[0-9-]+)\s+(?P<guid>[0-9a-f]+)\((?P<verified>[A-Z\?]+)\)\s+(?P<name>.*?)$', re.I)
tuple _regPlayer_lobby = re.compile(r'^(?P<cid>[0-9]+)\s+(?P<ip>[0-9.]+):(?P<port>[0-9]+)\s+(?P<ping>[0-9-]+)\s+(?P<guid>[0-9a-f]+)\((?P<verified>[A-Z\?]+)\)\s+(?P<name>.*?)\s+(?P<lobby>\(Lobby\))$', re.I)
 _useunverifiedguid = False
 _waiting_for_round_start = True

Detailed Description

An base class to help with developing battleye parsers

Member Function Documentation

def b3::parsers::battleye::abstractParser::AbstractParser::_say (   self,
  msg 
) [private]
def b3::parsers::battleye::abstractParser::AbstractParser::_say (   self,
  msg 
) [private]
def b3::parsers::battleye::abstractParser::AbstractParser::authorizeClients (   self)
Authorise clients from player list

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::authorizeClients (   self)
Authorise clients from player list

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::ban (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
Permanent ban

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::ban (   self,
  client,
  reason = '',
  admin = None,
  silent = False,
  kwargs 
)
Permanent ban

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::changeMap (   self,
  map_name,
  gamemode_id = None 
)
\
load a given map/level
return a list of suggested map names in cases it fails to recognize the map that was provided
def b3::parsers::battleye::abstractParser::AbstractParser::changeMap (   self,
  map_name,
  gamemode_id = None 
)
\
load a given map/level
return a list of suggested map names in cases it fails to recognize the map that was provided
def b3::parsers::battleye::abstractParser::AbstractParser::close_battleye_connection (   self)
def b3::parsers::battleye::abstractParser::AbstractParser::close_battleye_connection (   self)
def b3::parsers::battleye::abstractParser::AbstractParser::getBanlist (   self)

Other methods.

def b3::parsers::battleye::abstractParser::AbstractParser::getBanlist (   self)

Other methods.

def b3::parsers::battleye::abstractParser::AbstractParser::getClient (   self,
  name,
  guid = None,
  cid = None,
  ip = '',
  auth = True 
)

B3 Parser interface implementation.

Get a connected client from storage or create it
B3 CID   <--> cid
B3 GUID  <--> guid
def b3::parsers::battleye::abstractParser::AbstractParser::getClient (   self,
  name,
  guid = None,
  cid = None,
  ip = '',
  auth = True 
)

B3 Parser interface implementation.

Get a connected client from storage or create it
B3 CID   <--> cid
B3 GUID  <--> guid
def b3::parsers::battleye::abstractParser::AbstractParser::getCommand (   self,
  cmd,
  kwargs 
)
Return a reference to a loaded command

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::getCommand (   self,
  cmd,
  kwargs 
)
Return a reference to a loaded command

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::getMap (   self)
Return the current level name (not easy map name)

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::getMap (   self)
Return the current level name (not easy map name)

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::getMaps (   self)
Return the map list for the current rotation. (as easy map names)
This does not return all available maps

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::getMaps (   self)
Return the map list for the current rotation. (as easy map names)
This does not return all available maps

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::getPlayerList (   self,
  maxRetries = None 
)
return a dict which keys are cid and values a dict of player properties
as returned by admin.listPlayers.
Does not return client objects
def b3::parsers::battleye::abstractParser::AbstractParser::getPlayerList (   self,
  maxRetries = None 
)
return a dict which keys are cid and values a dict of player properties
as returned by admin.listPlayers.
Does not return client objects
def b3::parsers::battleye::abstractParser::AbstractParser::getPlayerPings (   self)
Ask the server for all clients' pings

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::getPlayerPings (   self)
Ask the server for all clients' pings

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::getPlayerScores (   self)
Ask the server for a given client's team

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::getPlayerScores (   self)
Ask the server for a given client's team

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::getTeam (   self,
  team 
)
def b3::parsers::battleye::abstractParser::AbstractParser::getTeam (   self,
  team 
)
def b3::parsers::battleye::abstractParser::AbstractParser::getWrap (   self,
  text,
  length = None,
  minWrapLen = None 
)
Returns a sequence of lines for text that fits within the limits

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::getWrap (   self,
  text,
  length = None,
  minWrapLen = None 
)
Returns a sequence of lines for text that fits within the limits

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

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

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::load_conf_max_say_line_length (   self)
def b3::parsers::battleye::abstractParser::AbstractParser::load_conf_max_say_line_length (   self)
def b3::parsers::battleye::abstractParser::AbstractParser::load_config_message_delay (   self)
def b3::parsers::battleye::abstractParser::AbstractParser::load_config_message_delay (   self)
def b3::parsers::battleye::abstractParser::AbstractParser::load_protocol_logging (   self)
Allow extra logging from protocol.py to be activaed
def b3::parsers::battleye::abstractParser::AbstractParser::load_protocol_logging (   self)
Allow extra logging from protocol.py to be activaed
def b3::parsers::battleye::abstractParser::AbstractParser::load_use_unverified_guid (   self)
def b3::parsers::battleye::abstractParser::AbstractParser::load_use_unverified_guid (   self)
def b3::parsers::battleye::abstractParser::AbstractParser::message (   self,
  client,
  text 
)
\
display a message to a given player

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::message (   self,
  client,
  text 
)
\
display a message to a given player

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::OnBattleyeEvent (   self,
  event 
)
def b3::parsers::battleye::abstractParser::AbstractParser::OnBattleyeEvent (   self,
  event 
)
def b3::parsers::battleye::abstractParser::AbstractParser::OnBattleyeKick (   self,
  data 
)
#Player #2 NZ (04b81a0bd914e7ba610ef3c0ffd66a1a) has been kicked by BattlEye: Script Restriction #107'
Player has been kicked by Battleye
def b3::parsers::battleye::abstractParser::AbstractParser::OnBattleyeKick (   self,
  data 
)
#Player #2 NZ (04b81a0bd914e7ba610ef3c0ffd66a1a) has been kicked by BattlEye: Script Restriction #107'
Player has been kicked by Battleye
def b3::parsers::battleye::abstractParser::AbstractParser::OnPlayerChat (   self,
  data 
)

Battleye events handlers.

#(Lobby) Bravo17: hello b3'
#(Global) Bravo17: global channel

Player has sent a message to other players
def b3::parsers::battleye::abstractParser::AbstractParser::OnPlayerChat (   self,
  data 
)

Battleye events handlers.

#(Lobby) Bravo17: hello b3'
#(Global) Bravo17: global channel

Player has sent a message to other players
def b3::parsers::battleye::abstractParser::AbstractParser::OnPlayerConnected (   self,
  data 
)
# Player #0 Bravo17 (76.108.91.78:2304)
Initial player connect message received
def b3::parsers::battleye::abstractParser::AbstractParser::OnPlayerConnected (   self,
  data 
)
# Player #0 Bravo17 (76.108.91.78:2304)
Initial player connect message received
def b3::parsers::battleye::abstractParser::AbstractParser::OnPlayerLeave (   self,
  data 
)
#Player #4 Kauldron disconnected
Player has left the server
def b3::parsers::battleye::abstractParser::AbstractParser::OnPlayerLeave (   self,
  data 
)
#Player #4 Kauldron disconnected
Player has left the server
def b3::parsers::battleye::abstractParser::AbstractParser::OnServerMessage (   self,
  data 
)
Request: Message from Server
Effect: None, no messages from server are relevant
def b3::parsers::battleye::abstractParser::AbstractParser::OnServerMessage (   self,
  data 
)
Request: Message from Server
Effect: None, no messages from server are relevant
def b3::parsers::battleye::abstractParser::AbstractParser::OnUnknownEvent (   self,
  data 
)
def b3::parsers::battleye::abstractParser::AbstractParser::OnUnknownEvent (   self,
  data 
)
def b3::parsers::battleye::abstractParser::AbstractParser::OnUnverifiedGUID (   self,
  data 
)
#Player #0 Bravo17 - GUID: 80a5885ebe2420bab5e158a310fcbc7d (unverified)
Players GUID has been found but not verified, no action to take
def b3::parsers::battleye::abstractParser::AbstractParser::OnUnverifiedGUID (   self,
  data 
)
#Player #0 Bravo17 - GUID: 80a5885ebe2420bab5e158a310fcbc7d (unverified)
Players GUID has been found but not verified, no action to take
def b3::parsers::battleye::abstractParser::AbstractParser::OnVerifiedGUID (   self,
  data 
)
#Verified GUID  (80a5885ebe2420bab5e158a310fcbc7d) of player #0 Bravo17
Players GUID has been verified, auth player
def b3::parsers::battleye::abstractParser::AbstractParser::OnVerifiedGUID (   self,
  data 
)
#Verified GUID  (80a5885ebe2420bab5e158a310fcbc7d) of player #0 Bravo17
Players GUID has been verified, auth player
def b3::parsers::battleye::abstractParser::AbstractParser::pluginsStarted (   self)
\
Called after the parser loaded and started all plugins. 
Overwrite this in parsers to take actions once plugins are ready

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::pluginsStarted (   self)
\
Called after the parser loaded and started all plugins. 
Overwrite this in parsers to take actions once plugins are ready

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::restart (   self)
Stop B3 with the restart exit status (221)

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::restart (   self)
Stop B3 with the restart exit status (221)

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::rotateMap (   self)
\
load the next map/level

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::rotateMap (   self)
\
load the next map/level

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::routeBattleyeEvent (   self,
  message 
)
Decide what to do with the event received from the BattlEye server
def b3::parsers::battleye::abstractParser::AbstractParser::routeBattleyeEvent (   self,
  message 
)
Decide what to do with the event received from the BattlEye server
def b3::parsers::battleye::abstractParser::AbstractParser::run (   self)
Main worker thread for B3

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::run (   self)
Main worker thread for B3

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::say (   self,
  msg 
)
\
broadcast a message to all players

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::say (   self,
  msg 
)
\
broadcast a message to all players

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::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::battleye::abstractParser::AbstractParser::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::battleye::abstractParser::AbstractParser::sayqueuelistener_worker (   self)
def b3::parsers::battleye::abstractParser::AbstractParser::sayqueuelistener_worker (   self)
def b3::parsers::battleye::abstractParser::AbstractParser::setup_battleye_connection (   self)
Setup the Connection to the Battleye server
def b3::parsers::battleye::abstractParser::AbstractParser::setup_battleye_connection (   self)
Setup the Connection to the Battleye server
def b3::parsers::battleye::abstractParser::AbstractParser::shutdown (   self)
Shutdown B3

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::shutdown (   self)
Shutdown B3

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::start_sayqueue_worker (   self)
def b3::parsers::battleye::abstractParser::AbstractParser::start_sayqueue_worker (   self)
def b3::parsers::battleye::abstractParser::AbstractParser::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.

Reimplemented in b3::parsers::arma2::Arma2Parser, and b3::parsers::arma2::Arma2Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::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.

Reimplemented in b3::parsers::arma2::Arma2Parser, and b3::parsers::arma2::Arma2Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::sync (   self)
Sync clients with player list

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::sync (   self)
Sync clients with player list

Reimplemented from b3::parser::Parser.

def b3::parsers::battleye::abstractParser::AbstractParser::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::battleye::abstractParser::AbstractParser::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::battleye::abstractParser::AbstractParser::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::battleye::abstractParser::AbstractParser::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::battleye::abstractParser::AbstractParser::write (   self,
  msg,
  args,
  kwargs 
)
Write a message to Rcon/Console
Unfortunately this has been abused all over B3
and B3 plugins to broadcast text :(
def b3::parsers::battleye::abstractParser::AbstractParser::write (   self,
  msg,
  args,
  kwargs 
)
Write a message to Rcon/Console
Unfortunately this has been abused all over B3
and B3 plugins to broadcast text :(

Member Data Documentation

Initial value:
{
        'message': ('say', '%(cid)s', '%(message)s'),
        'say': ('say -1' , '%(message)s'),
        'kick': ('kick', '%(cid)s', '%(reason)s'),
        'ban': ('ban', '%(cid)s', '0', '%(reason)s'),
        'banByGUID': ('addBan', '%(guid)s', '0', '%(reason)s'),
        'unban': ('removeBan', '%(ban_no)s'),
        'tempban': ('ban', '%(cid)s', '%(duration)d', '%(reason)s'),
        'tempbanByGUID': ('addBan', '%(guid)s', '%(duration)d', '%(reason)s'),
        'shutdown': ('#shutdown', ),
        }

Reimplemented from b3::parser::Parser.

Initial value:
{
    }
tuple b3::parsers::battleye::abstractParser::AbstractParser::_reColor = re.compile(r'(\^[0-9])') [static, private]

Reimplemented from b3::parser::Parser.

tuple b3::parsers::battleye::abstractParser::AbstractParser::_regPlayer = re.compile(r'^(?P<cid>[0-9]+)\s+(?P<ip>[0-9.]+):(?P<port>[0-9]+)\s+(?P<ping>[0-9-]+)\s+(?P<guid>[0-9a-f]+)\((?P<verified>[A-Z\?]+)\)\s+(?P<name>.*?)$', re.I) [static, private]
tuple b3::parsers::battleye::abstractParser::AbstractParser::_regPlayer_lobby = re.compile(r'^(?P<cid>[0-9]+)\s+(?P<ip>[0-9.]+):(?P<port>[0-9]+)\s+(?P<ping>[0-9-]+)\s+(?P<guid>[0-9a-f]+)\((?P<verified>[A-Z\?]+)\)\s+(?P<name>.*?)\s+(?P<lobby>\(Lobby\))$', re.I) [static, private]
tuple b3::parsers::battleye::abstractParser::AbstractParser::_reSafename = re.compile(r"('|\\)") [static, private]
Initial value:
{
        'line_length': 128,
        'min_wrap_length': 128,
        'message_delay': .8,
        }

Reimplemented from b3::parser::Parser.

the block below can activate additional logging for the BattleyeServer class

This block will send the logging info to a separate file

Reimplemented from b3::parser::Parser.

tuple b3::parsers::battleye::abstractParser::AbstractParser::re_playerlist = re.compile(r'''^\s*(?P<cid>[0-9]+)\s+(?P<ip>[0-9.]+):(?P<port>[0-9]+)\s+(?P<ping>[0-9-]+)\s+(?P<guid>[0-9a-f]+)\((?P<verified>[A-Z\?]+)\)\s+(?P<name>.*?)(?:\s+(?P<lobby>\(Lobby\)))?$''', re.I|re.MULTILINE) [static]

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