klionmonkeys.blogg.se

Assaultcube server
Assaultcube server







assaultcube server

If it returns undef then we will continue with the normal code. The subclass can either return undef or a defined result. If it's an object, the "parse()" method will be called on it otherwise the coderef will be called.

ASSAULTCUBE SERVER CODE

It will be called before executing the normal parsing code contained in this class. In order to subclass the parser, all you need to do is provide either an object or a coderef to the constructor. What follows will be a description on how this is achieved. It makes sense for us to provide a way for others to make use of this code, and extend it to take their log format into account.

assaultcube server

Since AssaultCube is open source, it is feasible for people to modify the server code to output other forms of logs. This means this class has no methods/subs/attributes attached to it and you should study the subclasses for details :) Subclassing the parser It is this subclass that is actually returned from the constructor. It is important to remember that this class is simply a "factory" that parses the log line and hands the data off to the appropriate subclass. Please review the notes below, "Subclassing the parser". The constructor will return an object or die() if the line is undef/zero-length.įurthermore, you can supply an optional second argument: the subclass parser. The constructor accepts only one argument, the log line to parse. The constructor for this class is the "new()" method. You would need to set up the "fluff" to read the logfile and feed lines into this parser as shown in the SYNOPSIS. The returned object actually is a subclass which inherits from Games::AssaultCube::Log::Line::Base and contains the various accessors suited for that event type. This is the factory which handles the "generic" stuff and the parsing. Please look at the subclasses for all possible event types. This module takes an AssaultCube logfile line as parameter and converts this into an easily-accessed object. Parses an AssaultCube server log line DESCRIPTION " happened\n" Ĭlose( $fh ) or die "Unable to close logfile: $!" ABSTRACT My $log = Games::AssaultCube::Log::Line->new( $line )

assaultcube server

Games::AssaultCube::Log::Line - Parses an AssaultCube server log line SYNOPSIS use Games::AssaultCube::Log::Line









Assaultcube server