ET:QW Stats Program by Jay "Awol" Clark

Version 1.0
© 2007 James Clark

This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.

* About the program

This program takes the log files from Enemy Territory and parses the data into a MySQL database. Using that data it feeds a webpage which will desplay the stats for both the server and the players. It is great for community ran servers who only want to compare regular players to each other. It can display a lot of data but unfortunitly it can not go into detail as Splash Damage Rank Server Stats go into.

* Contact information

Email : awol@puregamer.com
Website : www.puregamer.com
MSN : awol1010@hotmail.com

* Requirements

Perl (Tested on ActiveState Perl v5.8.8) See no reason why it won't work on other versions of Perl
DBI Package for Perl, with the MySQL DBD driver
Time::Local (Should be part of the perl install)
File::Copy (Should be part of the perl install)
MySQL Server (Tested on Running on MySQL 4) See no reason why it won't work on other versions of MySQL
PHP (Tested on PHP 4.4.0) See no reason why it won't work on other versions of PHP

INSTALLING THE PROGRAM

* Setting up the server for log files

You need to either add these line to your server.cfg or change it so it reflects these settings. I also suggest
you change your fs_UserPath and fs_SavePath to the same place so it will dump both sets of log files in the same place.

logFile "1" // 1 = buffer log, 2 = flush after each print, default = "0"
logFileName "ETQW.log" // if empty, console.log will be used.
logTimeStamps "1" // add time stamps to console log, default = "0"
g_logObjectives "1" // log objective completion info, default = "1"

* Setting up the Database

  1. Edit the config.pl file and fill in your database and log file information.

    #ET:QW log file folder (include the trailing "/")
    $ETQWLogFolder = "./logs/";

    #Log file prefix. This is the part of the filename that doesn't change. (This is needed)
    $ETQWLogPrefix = "ETQW";

    #Objective log folder (include trailing "/")
    $ObjFolder = "./logs/";
    #Objective log file name
    $ObjFile = "objective.log";

    #The folder all processed log files will be moved to (Include trailing slash "/").
    $ArchiveFolder = "./Archive/";

    #Database Information
    $dbhost = "localhost"; #Server or Hostname of your MySQL Server
    $database = "ETQWStats"; #Database to use
    $dbuser = "Username"; #Username for the MySQL Server
    $dbpass = "Password"; #Password for the MySQL Server
    $TablePrefix = "";

  2. Create the database. (If you can not create new databases you may use the $TablePrefix variable so you can use an existing database.)
  3. Run install.pl on the command line. (DOS prompt or shell) This will create the table structure in the database.
 

* Setting up the PHP (Web Pages)

  1. Copy all the php files, the css file, and the 2 folders to your website.
  2. Edit config.php and fill out the database information.
  3. (OPTIONAL) Edit the ETQWStats.css file to change colors of the webpages.

* Running the Stats

When running the stats its important to know that the program isn't smart. It will read the same log file and reprocess any stats over again if its not archived or if it couldn't be deleted. I suggest creating a batch file or shell script to copy the log files from your ETQW directory to ETQWStats directory. To do this correctly you will need to shutdown your ETQW server. I personally run my server's stats every night and its fully automated. I shutdown the server, copy the 2 log files over to my stats folder, Start the server, run all 2 stat programs (listed below). The program will archive the files for you in case you need to redo stats at sometime in the future.

  1. Run the ETQWStats.pl file on the command line (DOS Prompt or Shell) It will process all the ETQW log files in the log folder you specified in the config file. After it finished each file it will move the file to your archive folder.
  2. Run the ETQWStatsObj.pl file on the command line. It will process the objective.log file and them move it to your archive folder.(This can only be ran after all the ETQW log files are ran otherwise it might not record stats for players)
  3. Run the ETQWStatsRank.pl file. It will read the entire database giving each player a rank based on time, kills, and xp. (You can run this file at anytime)


* Future plans

- Create a Server Only mod for ET:QW to dump more stats into the log and to make it easier to grab information from the log files. This includes which vehicle a weapon was used from. Who completed the objective. Health packs given, etc.
- I might even think about tying Real Time stats into the server only mod so the game itself would just write to the database and no need to run external programs.


Change Log

Version 1.0


Version 0.98

Version 0.96

Version 0.95

Version 0.9