work in progress
In B3 a parser is a module containing a class that inherits from the b3.parser.Parser class. The b3.parser.Parser class is to be considered abstract and must be extended by inheriting parser classes.
gameName which is the parser name to be used in b3.xml. Must be unique among B3 parsers and lowercase only.output which is an file-like Python object to be used to send rcon commands_lineTime which is a regular expression that extract the timestamp from a game log line (only in the case where your parser does not overwrite the b3.parser.Parser.run() method)_reColor which is a regular expression able to remove color codes from a string. By default remove Quake3 like color codesparseLine(line) : Called to parse a single line from the game log file. If the line is recognized, then it should return a B3 event matching the content of that line.getPlayerList() : Query the game server for connected players. return a dict having players' id for keys and players' data as another dict for valuesauthorizeClients() : 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 sync() : 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.say(msg) : broadcast a message to all playerssaybig(msg) : broadcast a message to all players in a way that will catch their attention.message(client, msg) : display a message to a given playerkick(client, reason, admin, silent, …) : kick a given playerban(client, reason, admin, silent, …) : ban a given playerunban(client, reason, admin, silent, …) : unban a given playertempban(client, reason, duration, admin, silent, …) : tempban a given playergetMap() : return the current map/level namegetMaps() : return the available maps/levels namerotateMap() : load the next map/levelchangeMap(map) : load a given map/level. return a list of suggested map names in cases it fails to recognize the map that was providedgetPlayerPings() : returns a dict having players' id for keys and players' ping for valuesgetPlayerScores() : returns a dict having players' id for keys and players' scores for valuesinflictCustomPenalty(type, …) : 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.run() : this is the method that retrieves game events. By default it does so by reading lines from a game log file, but for some games this method need to be redefined to read events from a network connection. This the the piece of code that calls the parseLine() method.