svenstats

所属分类:构建工具
开发工具:Perl
文件大小:0KB
下载次数:0
上传日期:2023-10-31 23:23:46
上 传 者sh-1993
说明:  Sven Co-op专用服务器(SvenDS)日志的日志分析器,用于收集玩家统计信息(姓名、分数、死亡、国家等)。
(Log parser for Sven Co-op dedicated servers (SvenDS) logs, to gather player statistics (name, score, deaths, country, etc.).)

文件列表:
cpanfile (315, 2023-10-31)
hldschat.pl (959, 2023-10-31)
regenerate_all_stats.bash (373, 2023-10-31)
schema.sqlite (620, 2023-10-31)
svenstats.pl (7910, 2023-10-31)
svenstats_cronjob.bash (1431, 2023-10-31)
svenstats_oneshot.pl (6917, 2023-10-31)

# `svenstats.pl` Log parser for Sven Co-op dedicated servers (SvenDS) logs, to gather player statistics (name, score, deaths, country, etc.). ## Notes * 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') ## Requirements * SvenDS log files * Perl >=5.16 * MaxMind::DB::Reader (and [GeoLite2-City.mmdb](https://dev.maxmind.com/geoip/geoip2/geolite2/)) * MaxMind::DB::Reader::XS (optional but much faster, requires [libmaxminddb](http://maxmind.github.io/libmaxminddb/)) * DBI * DBD::SQLite * File::Slurp * File::Basename * SQLite 3 * xz-utils ## Get started 1. `sqlite3 scstats.db < schema.sqlite` 2. Configure `$db` and `$geo` in `svenstats.pl` 3. 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) 4. Add a daily cronjob which feeds yesterdays closed log to `svenstats.pl` (example file: `svenstats_cronjob.bash`) 5. Do cool stuff with the gathered data # `svenstats_oneshot.pl` 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. ## Requirements * SvenDS log files * Perl >=5.20 * MaxMind::DB::Reader (and [GeoLite2-City.mmdb](https://dev.maxmind.com/geoip/geoip2/geolite2/)) * MaxMind::DB::Reader::XS (optional but much faster, requires [libmaxminddb](http://maxmind.github.io/libmaxminddb/)) * File::Slurp * File::Basename * LWP::UserAgent * Encode::Simple * JSON::MaybeXS * JSON::XS (optional) ## Get started 1. Configure the Discord webhook URL: `$url` in `svenstats_oneshot.pl` 2. Optionally set `$steam` to `1` and set `$steamkey` to your Steam API key if you want to use the Steam API (adds links to the players Steam Community profile) 3. Add a daily cronjob which feeds yesterdays closed log to `svenstats_oneshot.pl` (example file: `svenstats_cronjob.bash`) # `hldschat.pl` Outputs the in-game chat logs in simple HTML format. Without a database and thus only for one log file at a time. ## Requirements * HLDS log files * Perl >=5.16 * HTML::Entities

近期下载者

相关文件


收藏者