I rolled a basic StdLog parser last night. No extensive testing has been done on it, but theory-wise, it should all work. At present, the parser only aggregates statistics, but it doesn't conclude upon it (no "score" or anything of that nature). (If someone gives me equations/expressions/math, then a score could be added.)
[edit: a new version is available in a post later in this thread]I don't know how well it compares speed/efficiency wise, as I chose to write the code itself to be as correct as possible, but a quick test on my server tells:
ss1# ./teststdlog.php ../pball/server27921.log 0
Log filesize: 6.74 MB
Games parsed: 523
Time to parse: 7.24498 secs
I'll see if I can post the system's specs as I remember/find them.
Example output:
http://digitalpaint.therisenrealm.com/downloads/sdk/libdpstdlog/output.txtTest script:
http://digitalpaint.pastebin.com/f9b5e11dNote that the class does not eat up the file on its own -- it is used merely to parse input. This way, I could write a real-time parser that would sit in the background and broadcast best K/D, best kill streak, etc. information on my server when the game ended.
parse will return the data when a round has ended, so for overall server stats, you'll need to roll your own thing.
The only known bug, although not intrinsically with my class but rather the StdLog output, is with bots that have the same conflicting names will cause inconsistent player states. Turning off
DigitalPaintStdLogStateParser->strict will prevent the
InconsistentStdLogPlayerState exception from being thrown.
=======
Stats tracked:
For each game:start_time (when the map was loaded, absolute UNIX timestamp)
game_start_time (when the first round started)
map
game_mode
first_kill (predator, victim, weapon, time, and predator ping)
last_kill (predator, victim, weapon, time, and predator ping)
kill_weap (list of weapons used, and how much)
death_weap (list of weapons used, and how much)
rounds (list)
run_time
play_time
scores (for team games)
winner (for DM)
players (list)
For each round:start_time
end_time
elapsed_time
result (who won, which is available for every round but the last)
kills
accountable_kills
team_kills
suicides
flags_saved
flags_base_grabbed
flags_captured
flags_team_captured
flags_white_captured (siege and white)
kill_weap (list of weapons used, and how much)
death_weap (list of weapons used, and how much)
For each player:name
is_bot
aliases (names they used)
kills
accountable_kills (non-team kills)
team_kills
kill_streak (best)
kill_weap (list of weapons used, and how much)
deaths
accountable_deaths (non-team deaths)
team_deaths
death_streak (most)
death_weap (list of weapons used, and how much)
suicides
flags_saved
flags_base_grabbed
flags_captured
flags_team_captured
flags_white_captured
flag_bonus_times
first_kill_for_team (times killed first in a round for team)
first_death_for_team (times died first in a round for team)
ping_avg
connected_time
play_time
k_d (kill/death ratio)