Log parser for Sven Co-op dedicated servers (SvenDS) logs, to gather player statistics (name, score, deaths, country, etc.).
- Assumes default SvenDS log settings (
sv_log_daily 1
,sv_log_onefile 0
) sv_log_player_frequency
should be consistent for every log file to calculate playtime from the 'datapoints' value- Score differences achived by players before a map ends may be lost for up to a maximum of the
sv_log_player_frequency
value (seconds). This is due to the nature of how the logging works and thus the gathered stats are not 100% accurate, but still good enough :) - 'joins' are not acual joins, merely a hack to get a better session id ('idx')
- SvenDS log files
- Perl >=5.16
- MaxMind::DB::Reader (and GeoLite2-City.mmdb)
- MaxMind::DB::Reader::XS (optional but much faster, requires libmaxminddb)
- DBI
- DBD::SQLite
- File::Slurp
- File::Basename
- SQLite 3
- xz-utils
sqlite3 scstats.db < schema.sqlite
- Configure
$db
and$geo
insvenstats.pl
- Optional: Feed it once with all existing (closed) logs (so not the one svends currently logging to!)
for i in /path/to/logs/excluding/the/current/one/*.log ; do svenstats.pl $i ; done
- Be sure to feed them in the correct order, from oldest to newest (* glob in bash should take care) - Add a daily cronjob which feeds yesterdays closed log to
svenstats.pl
(example file:svenstats_cronjob.bash
) - Do cool stuff with the gathered data
For posting daily statistics to Discord via webhook.
Same principle as svenstats.pl
but without a database and thus only for one log file at a time.
- SvenDS log files
- Perl >=5.20
- MaxMind::DB::Reader (and GeoLite2-City.mmdb)
- MaxMind::DB::Reader::XS (optional but much faster, requires libmaxminddb)
- File::Slurp
- File::Basename
- LWP::UserAgent
- Encode::Simple
- JSON::MaybeXS
- JSON::XS (optional)
- Configure the Discord webhook URL:
$url
insvenstats_oneshot.pl
- Optionally set
$steam
to1
and set$steamkey
to your Steam API key if you want to use the Steam API (adds links to the players Steam Community profile) - Add a daily cronjob which feeds yesterdays closed log to
svenstats_oneshot.pl
(example file:svenstats_cronjob.bash
)
Outputs the in-game chat logs in simple HTML format. Without a database and thus only for one log file at a time.
- HLDS log files
- Perl >=5.16
- HTML::Entities