Games::Quake::Log - information gleaned from the output of a Quake2 DM log
my $q_log = Games::Quake::Log->new($log_file_with_dir_path_if_necessary); my %kills = %{ $q_log->kills }; my %suicides = %{ $q_log->suicides }; my %game = %{ $q_log->game }; my %time_in_gmae = %{ $q_log->time_in_game }; my %frequency = %{ $q_log->frequency };
This module parses the log file generated by Quake2 from one of the standard logging mods. (Personally, I use sl_dm.)
When instansiated with a log file, you can ask for certain information. This is all the information that the log file has. So, if you want to make stats, just rearrange into different ways!
my %kills = %{ $q_log->kills };
This returns a hash, in the following format: $kills{$gameid}{$victor}{$victim}{$weapon} = $total_kills
my %game = %{ $q_log->game };
This returns a hash in the following format: $game{$gameid}{$game_flag} = $value
my %suicides = %{ $q_log->suicides };
This returns a hash in the following format: $suicides{$gameid}{$who}{$how_they_killed_themselves} = $total
my %time_in_game = %{ $q_log->time_in_game };
This returns a hash in the following format: $time_in_game{$gameid}{$who}{'time'} = $time_in_secs
my %freq = %{ $q_log->frequency };
This returns a hash in the following format: $freq{$gameid}{$when_in_game} = ($victor, $victim)
my $number_of_games = $q_log->number;
Self-evident, really.
A few bizarre things happen sometimes.
Extend to cope with other mods, like CTF et al.
This is the 'return-a-hash' version of this module. I originally wrote it with Class::DBI so I could store all the info in a mySQL database for a bit of persistence. If you want that version, mail me and I can send it on, with table definitions and everything!
StrayToaster <quake@stray-toaster.co.uk>
To install Games::Quake::Log, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Quake::Log
CPAN shell
perl -MCPAN -e shell install Games::Quake::Log
For more information on module installation, please visit the detailed CPAN module installation guide.