-----------------------------------
---     ET Admin Mod v0.29      ---
-----------------------------------
(c) Mark Davis <gaming@d1p.de> 2004/2005
    etadmin_mod.pl: ([d1p])H. Potter

Contact via www.gamesunited.de, et.d1p.de
or via E-Mail (see above email address).

################################################

Visit: http://et.d1p.de/etadmin_mod/ to get the 
latest informations about features, installations 
instructions, howto's, ...

################################################

Basic Installation Instructions.
--------------------------------
Extract the etadmin_mod somewhere on your harddrive. After extracting, 
modify the etadmin_mod.sh in the base path and the config files in the 
"etc" directory to match your needs. Most of the options in the 
config file are explained in detail. If you want to use the 
admin_functions, see the Configuration section for details.

After you finished the configuration, just start the etdamin_mod:

To start:
./etadmin_mod.sh start 

To stop:
./etadmin_mod.sh stop

To reload the configuration (without restarting the script):
./etadmin_mod.sh reload
(Its a simple kill -HUP on the process id)

The Configuration (the configuration, the shrubbot.cfg and the protected.cfg)
are reloaded on every map restart or with the ingame command "!readconfig".
-------------------------------------------------------------------

Troubleshooting
---------------
If you get a error msg, then make sure, that

1. Perl is installed (in /usr/bin/perl, else make a symlink to it)
2. The first line of the bin/etadmin_mod.pl is the path to your perl-binary
3. look into the log/etadmin.log for a detailed error.

If the program closes after you logout with your shell (from the server), 
then try to use nohup. Just type nohup in front of the start up
command in the etadmin_mod.sh.

If the script runs, but you see no messages ingame, get no response or
killing sprees, then increase the debug level to 1 and look, if you see
some kills in the logfile. If you don't see any kills in the etadmin.log, 
then the path to the etconsole.log is probably wrong.
-------------------------------------------------------------------

Configuration
-------------
The main configuration file for the etadmin_mod is in the etc-directory.
The configuration file, that will be used, can be configured in the 
startscript (etadmin_mod.sh). Default is: etadmin.cfg
Most of the options should be explained in the configuration file in detail.

Note: There are 2 sample etadmin.cfg files in the etc-directory. One (the etpro)
is symlinked to etadmin.cfg.

A small example:
--------------------
Enemy Territory installation directory:
/usr/local/games/enemy-territory

User: games, with homedir: /usr/local/games

You will then find the console logfile (etmain/shrub):
/usr/local/games/.etwolf/etmain/etconsole.log

or if you use etpro:
/usr/local/games/.etwolf/etpro/etconsole.log

Maybe extract the etadmin_mod to:
/usr/local/games/enemy_territory/etadmin_mod
(cd /usr/local/games/enemy-territory; tar xzf etadmin_mod-0.XX.tar.gz)

Then edit: 
/usr/local/games/enemy-territory/etadmin_mod/etc/etadmin.cfg 

The Path to the console logfile has be something like this then:
logfile                 = /usr/local/games/.etwolf/etmain/etconsole.log

if you use etpro, it will be:
logfile                 = /usr/local/games/.etwolf/etpro/etconsole.log

Be aware, that the path to the console logfile may be different in your 
installation. It depends on the user, your ET-Server runs with.
You can't use the game.log, because its not updated as fast as the console.log.

Be sure to set the right rcon password or the script will not work!
-------------------------------------------------------------------

Configuring your ET-server:
---------------------------

You have to set the following in your server-configuration.
The correct order (as shown below) is important (Or your etadmin_mod
output may lag).

// Your game-log file. (This is not to be used by the etadmin_mod)
set g_log <name of your serverlog file>	// e.g game.log (don't use that file for etadmin_mod)
set logfile 2			// 1 or 2. Better leave it 2
set g_logsync 0

-------------------------------------------------------------------

Configuring the admin_functions for the use with etpro.
-------------------------------------------------------
If you ran shrub before you used etpro, then you will likely already
have a shrubbot.cfg. It includes the levels, the users and the bans.

Included in the etadmin_mod Package is a file called: shrub_admin.pl
This file is for added / removing admins to the shrubbot.cfg.
The path to the program has to be configured in the etadmin.cfg.
If you want to ban people with the etadmin_mod, then you also have to
configure the path to the shrub_ban.pl. 

The first time you want to use the admin_functions, you have to add
yourself a lvl5 (or a other user / level) to the shrubbot.cfg. The
path to the shrubbot.cfg has to be configured in the header of the 
shrub_admin.pl and shrub_ban.pl (not in the etadmin.cfg).

A sample shrubbot.cfg is included in the etadmin_mod Package.
Just replace the name / guid (complete upper case) with your own, 
then you can start to use the admin functions and use setlevel 
to assign other admins ingame.

How do i get my GUID (you may ask)?
-----------------------------------
Just start your Enemy Territory Client and type \pb_myguid 
(without joining a server) into the console to get your Punkbuster
GUID. Furthermore you can use \condump <filename.txt> to dump 
the guid into a textfile.

Alternativly you can log into your server and use the rcon command
guids to see your GUID.

How do i know, if the script works?
-----------------------------------
If you start the etadmin_mod, a message should be displayed ingame.
If not, then something went wrong (maybe wrong et_mod setting?).

If the message is displayed, then you can also try to type:
!whos_ya_daddy
then a short message with version and author should be displayed ingame.
-------------------------------------------------------------------

External Program support
------------------------
You can include external programs (stats, funprograms, newsticker, ...)
for your players. Some examples (notify, stats, uptime) are included
in the configfile and in the addons directory. The path to the
programs has to be modified in the etadmin_mod configfile. Furthermore
some of the included programs (like the notify.sh) need additional
configuration. Just open them with a editor like vi or joe, and you
will see, what you can edit.

- For the stats scripts, you have to configure the database parameters
- for the notify.sh you have to configure the lock-directory.

The included notify.sh sends a plain email. I modified my own notify 
script to send email, icq & jabber messages to all our admins. But you 
are free to modify those addons or make your own.
-------------------------------------------------------------------

Questions, Feedback, Suggestions, Problems, else...
---------------------------------------------------
If you have a question, problem or something else, then visit my
forum here:

http://forum.et.d1p.de

or the documentation wiki / homepage here:

http://et.d1p.de/etadmin_mod

