Games::FEAR::Log is a og analysis tool for F.E.A.R. dedicated servers.
SYNOPSIS
use Games::FEAR::Log;
# instantiate new object, passing a hash reference of options
my $log_obj = Games::FEAR::Log->new( {
# database information: a dsn, username, and password
-dbi => [
'DBI:mysql:database=scoreboard;host=localhost;port=3306',
'scoreboard_admin',
'scoreboard_password'
],
# table to store info
-table => 'deathmatch1',
# create table if it doesnt exist
-create => ,
# full path to logfile
-logfile => '/var/log/FEAR/mp_scores.log',
# empty the source logfile after reading it
-truncate => 1,
# delete any records older than 30 days
-history => '30d'
} );
# process log file, importing new entries
$log_obj->process() or die 'processing failed';
# get ID of first user
my @uids = $log_obj->get_uids();
# get playernames this user goes by
my @names = $log_obj->get_playernames( $uid[0] );
# get stats for this user
my $stats = $log_obj->get_stats( $uid[0] );
# get history for this user
my $history = $log_obj->get_history( $uid[0] );
my @gametimes = keys %{$history};
# get information for a game played by said user
my $game = $log_obj->get_game( $gametimes[0] );
# get scoreboard-structured informatuon
my @scores = build_scoreboard('player', 'asc');
This module allows the parsing of a F.E.A.R. multiplayer server log into a manageable database format, and provides an easy to use object-oriented interface to access that information. This information could then be used to create a CGI scoreboard application, such as the one included in the /examples directory.
The underlying system uses a SQL relational database to store and retrieve game information. Initially, this implimentation is built to use a MySQL or PostgreSQL database, but I can add support for other database systems if there is a demand.
Ideally, there could be two different 'pieces' to an application using this module, an administrative interface to import new log entries into the database, and a public interface to display and/or cross-reference already imported information.
If performance is not a concern, however, it could be a one-piece application where new entries are checked for and added every time the interface is viewed.
Product's homepage
Requirements:
· Perl