-----------------------------------------------------------------------------
                                   LocalStats
                                  Version 106
                        by Michiel 'El Muerte' Hendriks
                           elmuerte@drunksnipers.com
-----------------------------------------------------------------------------

LocalStats will create log files which can be converted to statistics just 
like Epic's http://ut2003stats.epicgames.com
LocalStats is a server actor so it will not show up in the mutator list or
requires client downloads. Also with LocalStats you can still use the global
stats.
LocalStats can also send the log entries to a remote host via a TCP 
connection.

Note: version 105 had a bug in the year notation of the filename, this has 
  been fixed in 106. So make sure you change your filename format again if
  you changed it before
-------------------------------- INSTALLATION -------------------------------
Copy the LocalStats.u file to the UT2003 System directory.
Then edit you UT2003 Server Configuration file (UT2003.ini) and add the 
following line:

    [Engine.GameEngine]
    ServerActors=LocalStats.LocalStats

------------------------------- CONFIGURATION -------------------------------
Since version 103 LocalStats supports some more configuration options, in 
your Server Configuration (UT2003.ini) file you can set the following 
variables:

  [LocalStats.LocalStats]
  bUseRemote=false
  bLogChat=false
  sLogDir="Logs/"
  bFixEmptyLog=false

bUseRemote
  This will controll the remote logging
bLogChat
  this will enable logging of server chats
sLogDir
  Here you can specify a subdirectory (relative to the System directory) 
  where to place the log files. It's important to include the trailing slash
  (or blackslash for linux)
bFixEmptyLog
  This will fix empty logfiles on a server shutdown. But with this enabled you
  will get extra lines in the server log for every stats line

To set up logging to a remote host you have to add the following lines to
your server configurations:

    [LocalStats.LocalStats]
    bUseRemote=true

    [LocalStats.RemoteStats]
    sHostname=host where to log to
    iPort=tcp port to connect to

When you launch UT2003 it will open a TCP connection to that host and port 
and it will start sending the log entries as described below. You have to 
program the receiving appplication yourself, also no authentication is used
at the moment.

------------------------------------ USAGE ----------------------------------

LocalStats will generate a seperate log file for every game, the file will be 
saved in the System directory with the following format:

    LocalStats_<GamePort>_<Year>_<Month>_<Day>_<Hour>_<Minute>_<Second>.txt

But this can be changed by editing the config setting sFileFormat (since 
version 105)
You can use the following replacements:
  %P  server Port
  %Y  current Year (4 digits since 106)
  %M  current Month
  %Y  current Day
  %H  current Hour
  %I  current mInute
  %S  current Second
  %N  server Name
Not all characters are supported in the filename, for example '.', these will
be translated to an underscore '_'

The data in the file will have the following format, fields are delimited by 
tabs (tabs in fields are replaced by underscores):

<timestamp> <event> <data>

<timestamp> is the number of seconds since the level has been loaded
<event>     is a tag that defines what event occured, it will be one of the
            following:
              NG      New Game
              SI      Server Info 
              SG      The game has started
              EG      The game has ended
              C       A player has connected
              D       A player has disconnected
              S       Score event
              T       Team score event
              K       Kill
              TK      Team kille
              P       Special player event, like: first blood, killing 
                      spree, type kill, multikill
              G       Special game event: flag drop, name changes, etc.
              V       Chat (3rd party addition)
              TV      Team chat (3rd party addition)
<data>      This is depended on the event type:

NG
  <full time> <timezone> <map name> <map title> <map author> <game type>
  <game name>
SI
  <server name> <timezone> <admin name> <admin email> <other server info>
SG
  nothing but the tag
EG
  <reason>
C
  <player number> <player name>
  <player number> <cdkey hash> <player name> <password hash>
  note: this line will appear twice per player if worldstat logging is 
  enabled, first with the player name then with the stat ID
D
  <player number>
S
  <player number> <points> <description>
T
  <team> <points> <description>
K or TK
  <killer number> <damage type> <victim number> <vicitim weapon>
S
  <player number> <description>
  description is usualy something like:
    first_blood, spree_#, type_kill, multikill_#
G
  <event description> <player number> <description>
  the event description is often something like:
    flag_dropped, flag_taken, flag_returned, flag_returned_timeout, 
    flag_pickup, flag_captured, NameChange, TeamChange, bomb_droppen,
    bomb_taken, bomb_pickup, bomb_returned_timeout
  description is often used for the player number or team number, depends on
  the game event
V
  <player number> <message>
TV
  <player number> <message>

--------------------------------- SOURCE CODE -------------------------------
LocalStats is provided under the GPL. The complete source code is available
from the website. Please respect the GPL:
                      http://www.gnu.org/licenses/gpl.txt

----------------------------- CONTACT INFORMATION ---------------------------
LocalStats has been written by Michiel 'El Muerte' Hendriks 
<elmuerte@drunksnipers.com> member of The Drunk Snipers (TDS for short)
If you have any questions you can contact me, but I will not reply to 
questions who's answers can be found in this document.

The latest version of this server add-on can be downloaded from: 
http://www.drunksnipers.com/services/ut/ut2003/localstats

-----------------------------------------------------------------------------
Michiel 'El Muerte' Hendriks                        elmuerte@drunksnipers.com
The Drunk Snipsers - ICT Solutions                http://www.drunksnipers.com
-----------------------------------------------------------------------------