Coder Social home page Coder Social logo

cnsuhao / unvstats Goto Github PK

View Code? Open in Web Editor NEW

This project forked from unvanquished/unvstats

0.0 1.0 0.0 3.33 MB

A log parser and statistics generator for Unvanquished.

License: GNU Lesser General Public License v2.1

Python 13.87% Shell 1.35% PHP 81.85% CSS 2.93%

unvstats's Introduction

Unvstats 0.1.0

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

It is derived from Tremstats Too.

From Tremstats Too:

Version 2.0.0 adds the computation of individual players' skills based on the TrueSkill algorithm.

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

Version 2.2.0 renames all references to the term TrueSkill to avoid legal issues.

Version 2.3.0 hashes QKEYs so that they cannot misused. It upgrades the database automatically. Note that the database becomes backward incompatible.

Requirements

You need at least the following things for the Unvanquished 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:

  • Unvanquished

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 unvstats.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 Unvanquished server, for example /usr/local/games/unvstats/. Then give the mainfile execute rights by typing chmod a+x unvstats.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 ./unvstats.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/unvstats/unvstats.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 Unvanquished server. This should be something like localhost:27960 or an external address. If you have done this step, you have done everything. Have fun with Unvstats!

Notices on unvstats.py

unvstats.py offers you some nice features. Type unvstats.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

Do not contact Rezyn, DASPRiD or Petr about problems with this Tremstats fork.

Tremstats 2.3.0

Tremstats Too 1.9.3

Tremstats 0.6.0

Original tremstats release by DASPRiD

unvstats's People

Contributors

dsalt avatar ppetr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.