Software and tools
Warsow-esport.net produces open source statistic tools for Warsow.
Since Warsow does not (at this writing) have native way of outputting statistics from the server, so we had to write our own log parser to do the job. All code produced by warsow-esport.net is released under GNU General Public License V3. Contact me for feedback, patches, feature suggestions, etc :-)
WICN-Client
WICN-Client is an open source log parser for parsing wswconsole.log and outputting html frag top lists. WICN-Client is written in Ruby programming language.
Authors
WICN-Client is brought you by:
- Mikko Ruohola
- Tarmo Hyvärinen (aka kiki/crizis)
Features
Parses color coded names, instagib statistics from wswconsole.log. Can parse multiple server logs, collected as one list by game type. Decently fast, parsers 150MB logfile in 30 seconds~ (on 2.16GHz Core2Duo laptop, your mileage may vary). Outputs html table of scores. Also outputs top5 as .txt files which can be included as message of the day.
Roadmap/TODO
- Separate config to external yaml file or xml
- Support for normal weps (implemented in 0.2)
- Clan tag support for parsing clan stats
- Alias support to group frags under one player name (For example ]m0d[k!k! and k!k! as one player)
- !shout command, shout short clips directly from the servers and output html
- Remote XML score submitting + WICN-Server for submitting scores to centralized location
- Automatically find log files from ~/.warsow/basewsw/
- Detect gametype automatically, follow callvote settings if gametype gets changed?
- Include empty sqlite database to get 'zero-configuration' setup
- BUG: 0.2 release includes queries against non-existing tables. (fixed in 0.2.1)
Downloads
The software is provided AS IS, no support provided!. It may eat your log (and babies).
Download version 0.2.1 (released 5.7.2009)
Download version 0.2 (released 2.5.2009)
Download version 0.1 (released 22.2.2009)
Installation
Warsow Server requirements
Logging with timestamps must be enabled from the server side. Especially important option is the logconsole_timestamp or stats will not work. dedicated_autoexec.cfg options:
set log_stats "1" set logconsole "wswconsole.log" set logconsole_append "1" // don't destroy the old log when restarting server set logconsole_timestamp "1"
Installation tips
WICN-Client was developed on Ubuntu/Debian Linux servers, so installing is easiest on these operating systems.
In a nutshell, WICN-Client requires Ruby 1.8 with RubyGems, XML, XSLT and SQLite3 extensions.
Install required packages for Ubuntu/Debian:
sudo apt-get install libxml-ruby1.8 ruby1.8 ruby1.8-dev sqlite3 libsqlite3-ruby1.8 rubygems sudo apt-get install libxslt1-dev libxslt-ruby1.8 build-essential sudo gem install sqlite3-ruby sudo gem install ruby-xslt sudo gem install builder
Edit configuration options
This should be moved to external yaml or xml file, but it's now located inside the code. So edit wicn-client.rb to meet your needs:
$defaults={
'database'=>'wicn-client.sqlite3',
'days'=>7,
'xsl'=>'warsow.xsl',
'html'=>'stats.html',
'server'=>'localhost:44400',
'gametype'=>'ica',
'version'=>'wicn-client 0.1',
'enable_motd_top'=>1,
'motd_header'=>'motd output blah'
}
Create database
Create new SQLite3 database:
sqlite3 wicn-client.sqlite3
Create score table (Notice that the table does not have separate ID as primary key/autoincrement. For some reason the SQLite would work unbelieveably slow unless name was set as primary key. Go figure)
CREATE TABLE warsowstats ( name CHAR(255) NULL , killed CHAR(255) NULL , killtime INTEGER NULL, server CHAR(255) NOT NULL, gametype CHAR(255) NOT NULL, PRIMARY KEY(name,killed,killtime) );
Test-run
Now your should be able to run frag parser against your wswconsole.log and get generated stats.html file
Example command:
./wicn-client.rb sv1.warsow-insta.net:44400 wswconsole.log 2 warsow.xsl stats.html ica
Brief explanation of the above: First parameter is the name of your server. This does not show up anywhere, it's used in the database for separating stats for different servers. Second parameter is the location to your warsow log file. Third is the number of days backwards to parse. For first run you should set this to at least as big amount as your log file has data. For later runs in crontab using 2 is good value, this checks frags from last two days. setting this to one day may lose some frags when the day changes. Fourth parameter is the target XSLT template. warsow.xsl is provided in the release as reference. Fifth parameter is the gametype. This is only used in the DB for separating servers by gametype.
Have fun!
