Title    : Clan Arena Server Code
Filename : caserver.zip
Version  : 1.1
Date     : 10-29-97
Author   : Mungo
Email    : target@radix.net
Webpage  : http://www.planetquake.com/servers/arena
---------------------------------------------------

Clan Arena is like clanring or qwring for the most part. You join a server,
"ready up", and once everybody is set to a team, the match begins.

********
Features
********

Modes
~~~~~

There are three different modes for Clan Arena:

- Normal Mode

Normal mode is where there are no teams and there is just one line of people.
People fight, and the winner fights the next player in line. When you lose a
fight, you go to the end of the line.  "players" controls how many people are
put into the arena at once.  If "players" is set to 3, 3 people would play
a 1on1on1.  If set to 4, it would be a 4 way.

- Competition Mode

A certain number of players are chosen from each team, determined by the
"players" setting, and placed into the arena.  When someone dies, someone
from his team replaces him (if there is someone left to replace him), and
everyone in the arena keeps their armor/health.  Once all but one team has
been eliminated, the round ends.  By default, a best of 9 rounds is played.
("rounds" setting controls the number of rounds played).  A different player
from each team starts the next round.  Once the series of rounds ends, the
team with the most wins in given the victory.

- Round Robin Mode

Only one player from each team is put into the arena.  As soon as the fight
ends the winner is teleported out to make room for the next set of players.
The series ends when everyone on a team has had a chance to play against
everyone else.  Keep in mind that this can create a large number of matches.
For example, a 2-team 4on4 would need to play 16 matches.  A 3-team 4on4on4
would be 64 matches long.  This mode should probably only be used for clans
interested in holding "official" matches, with 4 players to a team.
NOTE:  This mode forces "players" to 1, and "rounds" is set automatically

An ADMIN can rotate through the modes using the 'modeset' console command.

Number of Players
~~~~~~~~~~~~~~~~~

In Clan Arena, the number of players to be put into the arena is fully
configurable.  For example, if "players" is set to "3" on normal arena,
3 people would be put into the arena, making for a 1on1on1, with the last
one standing the winner.
In competition mode, if "players" is set to "2", two players from every
team are put into the arena at once.  For example, if there are 2 teams,
4 people would be put into the arena, making for a 2on2.

An ADMIN can set the number of players by typing '/setinfo players <#>'

Number of Teams
~~~~~~~~~~~~~~~

The number of teams participating at once can be anywhere between 2 and 4.
This controls the MAXIMUM number of teams allowed.  The minimum to start
a game is always 2.

An ADMIN can set the number of teams by typing '/setinfo teams <#>'

Arena on Any Map
~~~~~~~~~~~~~~~~

Clan Arena doesnt require an arena map to be played.  Clan Arena works
on id maps.  In fact, it can also work on any map, as long as the map
name is specified in the server's localinfo as an "id-style" map.
Check the sample server.cfg for an example of how to do this.

Spectators on id Maps
~~~~~~~~~~~~~~~~~~~~~

All non-players are non-solid spectators who can not be seen or heard. All
spectators have a null team value and are color 0 (white). Because of the
client predicition in quakeworld, a spectator cannot move through a solid
player.  While you are a spectator, you can either walk around on your own,
or use the tracking camera. To use the tracking camera, press the attack
button, and then use the jump button to track the various players. If you
want to exit the track cam mode, just press the fire button.

By default, your pushlatency is automatically set to '0' when you become
and observer, and to '-500' when you enter the arena. This makes for a
much smoother trackcam. To turn off this feature, type 'nopl' at the console.

Re-joining a Series
~~~~~~~~~~~~~~~~~~~

If you disconnect from a server before a series ends, you can reconnect
before the series ends and you should be placed back on your team the
very next round.  If you want to explicitly substitute someone, have them
do "/setinfo oldteam <teamname>" before they connect, and they should be
placed on the team the very next round.  This will only work if the team
is missing a player.

************
Server Setup
************

To set up a Clan Arena server,
1. Extract the files in the caserver.zip into a 'quake\carena' directory. 

If you want to run Rocket Arena maps on your server, 
2. Copy the pak0.pak from your Rocket Arena (quake\arena) directory 
into your Clan Arena directory (quake\carena).

3. Customize the server.cfg in the quake\carena directory to your
preferences.

4. Start the server with a command line like:
'qwsv +gamedir carena'

The sv_gamedir variable is set to 'arena' in the server.cfg, so clients
will use the Rocket Arena pak file in their 'quake\arena' directories.


********
Commands
********

settings
~~~~~~~~

This command is like modstatus in qwring, it shows the current settings of
the clan arena mod. Each setting can be changed by an ADMIN by typing:
"/setinfo <setting> <value>" in the quake console. The available settings
are listed below.

atype           - armor type. 1 = red armor, 2 = yellow armor,
                              3 = green armor, 4 = no armor

armor		- how much armor you start with.
health		- how much health you start with.

(NOTE: an ammo value of 999 specifies unlimited ammo of that type of ammo.)

shells		- number of shells you start with. 
nails		- number of nails you start with.
rockets		- number of rockets you start with.
cells		- number of cells you start with.

teamplay        - standard teamplay variable.
players		- number of players from each team to fight at the same time.
NOTE:           There are two different players settings.  One is for normal
                mode and defaults to 2, the other is for Competition mode and
                defaults to 4.
teams           - maximum number of teams.

mode            - current mode of server.
                  (Normal, Competition, or Round Robin)
NOTE:           Mode can NOT be set with setinfo. The mode is changed with the
                "modeset" command ONLY.

The settings will not take effect until the current round or series is
finished.

playerlist
~~~~~~~~~~

The playerlist command shows which team each player belongs to. If the team
field is blank for a player, it means that player is not on a team.
Thre are 4 fields, labeled "F D H S".  They mean, "fired", "direct hits",
"hits", "self-inflicted", respectively, and are a total accout of all the
rockets the player has fired.  These numbers are reset at the beginning of
each series.

yes
~~~

This command is used to vote yes for an election to admin.

no
~~

This command is used to vote no for an election to admin.

listmaps
~~~~~~~~

Lists the maps in the map loop. The map loop is set the same way that the
standard quakeworld map loop is set.  If the current map is not in the map
loop, this command will only list the current map, and the last map that was
in the loop.

elect
~~~~~

Used by a normal player to become admin.  During the voting time, a person
votes with "yes" and "no". The voting is controlled with the server variables
"votepct" and "votetime".  "votepct" controls the percentage of votes that
must be "yes" in order for the person to become an admin.  For example, if
there are 6 people on the server, and votecpt is "50", there would need to
be at least 3 "yes" votes in order for the person to be admin'd.
The server variable "votetime" is the number of seconds the voting lasts.
Default is 60.  If "votepct" is not set or is 0, voting is disabled.

ready
~~~~~

Adds you to the team you have specified, or enables the team you have
specified.  To specify your team, use the "team" console command.
If you join a team that's already been created, your colors will be changed
to match the team colors.

For a server in 'normal' mode, you are set ready by default. Type 'notready'
to get out of line. For the other two modes, you MUST type 'ready' before
the match can begin.

admin
~~~~~

Use this command to become an admin if you enter the correct admin code. The
admin code is four digits, and you enter one digit at a time.

commands
~~~~~~~~

List available commands, and the impulse for the command.

notready
~~~~~~~~

Removes you from the team you have specified, and if you were the only player
on your team, "notready" clears the old team.

scores
~~~~~~

Only works in either Competition or Round Robin modes.  It shows the teams
participating in the current series and how many wins/losses/forfeits they
have.

nopl
~~~~

Use this command to toggle on and off auto-pushlatency mode.
When auto-pushlatency is enabled, your pushlatency will be set to 0 when you
enter track cam mode, and when you exit track cam mode, your pushlatency will
be set to -500. When auto-pushlatency is disabled, your pushlatency setting
will not be changed at all.  The default setting of auto-pushlatency is off.
If you disconnect when you are in track cam mode, the mod will not have a
chance to correct your pushlatency setting, so keep this in mind when using
"nopl".
Note that the track cam is smoothest when your pushlatency is set to 0.


**************
Admin Commands
**************

modeset
~~~~~~~

This command swicthes the mode of the clan arena mod.

warp
~~~~

This command is used to change maps. Enter one number at a time.
If you want to choose an id map, enter the episode number for the
first digit, the second digit is the level number.  Deathmatch maps
are chosen with 5, episode 1 with 6, episode 2 with 7, and so on.
For example, to choose dm6, enter:
warp
5
6

To choose e1m2, enter:
warp
6
2

reset
~~~~~

Use this command to reset the mod, without switching through the different
modes.

force
~~~~~

This command is used to start a series even though all players have not
readied up.

kick
~~~~

When you enter this command, a list of players and their associated player
numbers will be displayed. To remove a player from the server, enter the
number of the player you wish to kick. Remember to enter one digit at a time.

lock
~~~~

This command toggles whether or not the server is locked. When the server is
locked, no players are allowed to join the server.  See: autolock.  If the
server is locked manually with this command, autolock will be disabled.
The server automatically unlocks if there are no more players on the server,
or the level is changed.


*******
Weapons
*******

Weapons mask
~~~~~~~~~~~~

To set the weapons variable, you set up a bitmask.
The vaules for the bits are:
Bit    Value    Weapon
----------------------
 0       1      Lightning gun
 1       2      Rocket Launcher
 2       4      Grenade Launcher
 3       8      Super Nailgun
 4      16      Nailgun
 5      32      Super Shotgun
 6      64      Shotgun

Add the values of all the weapons you want together, and that is what you
set "weapons" to.
For example, all weapons would be 127
Just the rocket launcher, grenade launcher, and lightning gun would be 7
Just the rocket launcher would be 2
All weapons except the grenade launcher would be 123
An ADMIN would do a '/setinfo weapons 123' to do this.

Weapon Toggling
~~~~~~~~~~~~~~~

The admin can use the 7 weapon toggle commands (one for each weapon) to turn
off or on a specific weapon.  This is usually easier than setting the
bitmask.


****************
Server Variables
****************

sounds
~~~~~~

The clan arena mod may be configured to use two sets of sounds. If you prefer
the Street Fighter sounds, set the server variable "sounds" to 0. If you
prefer the Mortal Kombat sounds, set "sounds" to 1. The Mortal Kombat sounds
are used by default. If a player does not have the sounds, they will be
downloaded.

autolock
~~~~~~~~

If "autolock" is set to 1, then the server automatically locks iself before
each series begins, and unloks after each series.  If set to 0, autolocking
is disabled.

setinfo variables
~~~~~~~~~~~~~~~~~

All of the "setinfo" variables settable by an admin can also be set in the
server.cfg using the 'localinfo' command.  These values are only loaded once, 
when the server first starts.


****
Note
****

There's a known issue with this mod where your movement can become very
unstable and you can move halfway into a wall.  It seems to be the result
of using the trackcam for a while, or being crushed by a plat when you're
a spectator.  To fix the problem, type "kill" at the console and your
movement should clear up.  Hopefully this will be fixed very soon.

**************************************
Copyright and Distribution Permissions
**************************************

This patch is freely distributable provided that this clanarena.txt is 
distributed as well and is unchanged.

All code is copyright PlanetQuake 1997.
Commercial code licensing is available by contacting bastard@planetquake.com

*******
Credits
*******

Authors
~~~~~~~

Mungo   (target@radix.net)      Coding
eof     (apathy@cw.umd.edu)     Server admin, ideas, testing, docs

Thank yous
~~~~~~~~~~

Gemini:                 idea of arena on id maps
Sketch:                 original trackcam idea
Phazer, TvAddict:       suggestions
Zoid:                   street fighter sound effects
Angoris and Gemini:     original arena conecpt
SS|NiOXiN:              original arena map

Testers
~~~~~~~

clan SS:                NiOXiN, Soylent, Rush, BodyCount, MicroMegas, Grunt
clan EW:                Artemis, Glock, Sketch, Monk3y, Cloud, Nitro, Nova
clan EG:                Drakken, Pistdov
clan WD:                RCade
clan Cluck:             Mib, Roadwar
clan FFF:               Psy, DemonX
Phazer, TvAddict, Nacho, P00p, Peaches, Hawk'D, Tess[eh]

NOTE:  This list doesnt have all the names, since we couldnt possibly
       remember them all.  A big thanks goes to all the testers, and
       sorry if we missed your name here!
