Skip to content

redrumrobot/tremstats

 
 

Repository files navigation

Tremstats Too 2.1.0

The program parses Tremulous 1.2 games.log and stores the extracted information in a database. Then it can be viewed through a set of PHP pages.

The version 2.0.0 add the computation of individual players' skills based on the TrueSkill algorithm.

The version 2.1.0 adds two separates skills for games played as a human and for games played as an alien.

Requirements

You need atleast the following things for the Tremulous server:

  • Python 2.6
  • Site-Packages: (common .deb or .rpm package name)
    • MySQLdb (python-mysqldb or MySQL-python)
    • Python Imaging Library "PIL" (python-imaging)

And the following things for the webserver (may be the same box):

  • MySQL 4.1 or higher
  • PHP 5.1 or higher
  • php-gd (php module for gd graphics library)

A server running:

  • Tremulous 1.2

Note: Windows specific code has been removed from the log parser, this plus the lack of any testing whatsoever on Windows almost guarantees that you will need to fix tremstats.py if you plan to parse logs on a Windows platform.

Privacy

By default everything is enabled for viewing from the web, including player chat and name aliases.

You may wish to protect some of your player's privacy by disabling the PRIVACY options in web/core/config.inc.php by setting them to '1'.

Installation

To make it slightly easier, a setup.sh script is included which will walk you through setting up the initial database config files. (needs bash)

First you have to setup your MySQL database. So create a new database or change to an existing one. Then execute both of the SQL files structure.sql and data.sql.

Now copy all files from the parser directory to a directory on your Tremulous server, for example /usr/local/games/tremstats/. Then give the mainfile execute rights by typing chmod a+x tremstats.py.

Then copy config.py.default to config.py, open config.py in your prefered texteditor and edit the first few lines and enter your MySQL data and location of the games.log and all your custom maps PK3s. After this part is done, you may parse your log which was created so far by typing ./tremstats.py.

You may want to parse your logfile every 12 hours or something like that. (as your database gets bigger, calculating stats will take more time, so try to avoid parsing more than once or twice a day unless you have processing power to spare -Rezyn ) If you use crontab, you can enter the following line into /etc/crontab:

0 */12 * * * root /usr/local/games/tremstats/tremstats.py

For further information about crontab, see Google.

Now, as you have setup all important things, you also want to see some output. So copy all files from web to a directory reachable from the internet. Copy the file core/config.inc.php.default to core/config.inc.php, edit core/config.inc.php and enter your MySQL data here again. The last setting in this file is the address of your tremulous server. This should be something like localhost:30720 or an external address. If you have done this step, you have done everything. Have fun with Tremstats!

Notices on tremstats.py

Tremstats.py offers you some nice features. Type tremstats.py --help for more information.

Notices on the output

The output system is written very simple. If you want to just change the colors, you may edit the CSS file. If you want a bigger change to the layout, you can change the template files in the template directory. They are written in PHP, so you don't have to learn any complicated template system syntax. Even if you don't know PHP but HTML, you will understand the really simple syntax used there.

If you change the colors background behind the graphs, you may also edit the _graphs.php file and set the colors there.

Special Thanks from DASPRiD

I want to thank Ingar, who supported me with a lot of knowledge about linux and helped me to test the parser several times. He also patched Tremulous for me.

Then I want to thank WolfWings, who wrote the patch for Tremulous, very good work.

Also a big thanks to Gilmor, who found the cause for this nasty bug of unlogged kills and destructions and also to DigiFad, who submitted a patch for windows.

At this point, thanks to Basilisk for the really great icons!

At least I want to thank all users in #tremulous, who helped me with some small information and gave me lots of tips. Your are the best!

Contact

Contact Petr at the github project webpage. Do not contact Rezyn or DASPRiD about problems with this Tremstats fork.

Tremstats 2.1.0

Tremstats Too 1.9.3

Tremstats 0.6.0

Original tremstats release by DASPRiD

About

A log parser and statistics generator for the Tremulous game.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 95.6%
  • Python 3.7%
  • Other 0.7%