Clanring Quake Server v3.15 1/22/98
	Goto http://www.mpog.com/clanring/crmod
		For the latest information.
=================================================================================

!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!
The Author of this mod and ClanRing take no responsabilty for any damages
attained from using this mod. This includes but is not limited to: damage
to your machine, loss of job, spouse, girlfriend, boyfriend, lover, money
or right to attend a certain educational institution, etc.
!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!


Notable Stuff in this Version
=================================================================================

Version 3.15: Fixed bug where players could not respawn if they tried to switch weapons while dying. (thanks zatz)

Version 3.11: Fixed a bug in the QSmack code (thanks Joel)

Version 3.1:  Leet Ass Mofo Status Bar, SetGib, Increased Speed and Efficiency of code, Animated MOTD, Custom Obituary Messages, New & Improved Freelook written by Sinth[LOD] for use in ClanRing Mod, voting no longer counts Admins for total votes, Client HeartBeat, other bug fixes (including end of match server crashing).  QSmack support.  daPAK support.

Check versions.txt for version history.


Overview
=================================================================================

The purpose of this mod is to server as a Free For All Server 95% of the time and a ClanRing Match Server the other 5%.  Of course the actual use is up to you.  Modes are set by the samelevel setting.  Samelevel 0 sets a FFA server and samelevel 2 sets a ClanRing Match Server.  This can be set from the autoexec.cfg file used by the server.  This way, this mod can be used as a general purpose mod.  And can be changed from FFA to ClanRing very quickly without having to restart the server.  Also many maintenance features have been added through admin.  Admins can change teamplay, deathmatch, sv_aim, levels, etc.. from a remote client.  Admins may also kick players off servers.  Making this mod much more versitile than just a plain Quake Server.  Also, players may use many of the features available during FFA that were previously only available in the ClanRing Style, including, all 6 observer modes, and the extended playerstats.

This server was designed to be controlled exclusively from the console, I believe that this is a superior method to the impulse command driven system that was previously used.  Console commands do not require that keys be bound to certain little-used impulses and provide a much more intuitive means of interaction.

However, it is possible to use access all functions outside of console by binding keys.  Here is a list of general guidelines that will allow you to do this.  I don't want to go into great depth here so if you have a question or suggestion for making something clearer, send email to me at pbaker@idle.com.

First of all, you need to bind keys to the impulses of the commands that you would like to use.  Particularly valuable bindings would be Warp and Admin.

You need to make sure that 1 thru 0 is bound to impulse 1 through 10. You also need to make sure you have "yes" and "no", impulses 121 and 110 respectively.



Instructions - Setup
=================================================================================

There are only a couple steps that need to be taken to setup a clanring server.  This setup is done by setting a couple of variables and recompiling the server code.  All settings are located in the settings.qc file.  These settings are as follows.

ADMIN_CODE_REAL ==> the 4 digit code used to get admin powers, default is 1234,
		I suggest you change it.

FRESH_SPAWN ==> If enabled, all players start out a new level with just the shotgun
		and 100 health.  i.e weapons, ammo, armor, etc  don't carry from
		level to level.  Default is 1, 0 disables

LOCKOUT ==> Keeps players from joining a match in progress.  1 enables, 0 disables

LOCK_NUM ==> Limits the maximum number of players allowed per team.  Default value
		is 2, but can be as high as 8, 0 disables.

OBSERVER_ENTRY ==> Should all players enter the server in observer mode.  1 enables,
		0 disables.

LOCK_TEAM ==> Sets the maximum number of teams allowed to play at a time. Default
		value is 2, can be as high as 8.

OVERRIDE_VOTES ==> percentage of players needed to start timer with override function

EXIT_TIME_MIN ==> the minimum amount of time in a level before exits are allowed

PROG_LEVEL_SEQ ==> 1 enables, 0 disables, If enabled, Programmable Level Sequence 
		will be used, set the sequence in the pls.qc file.

AUTO_RESPAWN ==> the number of seconds that a player is allowed to remain dead, 0 disables

LOCK_LEVEL ==> locks the game onto a single level 1 enables, 0 disables

DM_SV_AIM ==> if sv_aim 0.93 should be used in deathmatch; 1 enables, 0 disables

TM_SV_AIM ==> if sv_aim 0.93 should be used in teamplay; 1 enables, 0 disables

TIMER_MATCH ==> Set this to what you want the default time for matches to be.  This can
		changed by admins with MatchUp and MatchDown.  The ClanRing endorced
		default is 20 minutes.

TIMER_SKIRM ==> Set the default timelimit to be used during Skirmish Mode (FFA).

RANDOM_SPAWNS ==> Whether or not players should respawn in a random order or sequentially.
		1 enables random spawning, 2 enables Extended random spawning, 
		0 disables random spawning.

DEBUG_VERSION ==> Used for debugging purposes.  1 turns on debug info.

ANIMATE_MOTD ==> Whether or not to used Animated MOTD on server connect.  1 enables, 0 disables.

MOTD_TIME ==> Number of seconds to display MOTD when a player connects to the server.

VOTE_GIB ==> Whether players should be allowed to vote to turn Gibs off or on.
             Many HPB players complain that gibs can lag a server, especially
             During Match Start.  It is suggested that you leave this set
             to 1 so that players can vote to turn gibs off when most of the
             players are HPB's, and then vote them back on afterwards.


Other adjustable things are the MOTD.  Also, are the level sequence to use in PLS, and a listing of your custom levels and/or daPAK(http://www.planetquake.com/dapak/) support.  All adjustable settings are now located in the settings.qc file.  Just go through the whole file and if its a variable, its a good bet that its an admin adjustable setting.

QSMACK SUPPORT in v3.1
QSmack is a server administration tool for Quake (not QuakeWorld) servers: a
program permanently connected to a server as a client with admin privileges, so
that it can do anything a "real" admin could do (often automatically). It exists
primarily because the "ban" console command in regular Quake is insufficient. That
command does not allow multiple IP addresses or subnets to be banned. It also
doesn't allow banning based on player's names. QSmack can do all that and more.

QSmack was written by the good ol' boyz of Clan 9 from Outer Space.  For more information
on QSmack, point your favorite web browser to the url http://lemur.stanford.edu/clan9/qsmack/

To enable the QSmack support, set USE_QSMACK to 1.

Then choose 5 numbers for the auto_admin code.
Available Impulses are:  13-38, 57-74, 77, 79, 91-98, 100-109, 111-120, 122-129, 136-139,
                         149-159, 162-169, 174-199, 202, 204, 206, 208, 210-219, 238-240, 
                         245-251, and 254


Once these variables are set, run the qccdos.exe file in the progs directory, this will create a new progs.dat file.  Once this is done, you're ready to run the server.

Instructions for adding extra cameras for use with AutoCam are included in the file cameras.zip included with this file.

Powerups are controlled by the Server Variable "Temp1".  When Temp1 is set to zero(0), all power ups are enabled.  Add 1 to disable Quad.  Add 2 to disable Pent.  Add 4 to disable Eyes.  In otherwords, if Temp1 is set to 1, Quad will be disabled.  If Temp1 is set to 2, pent is disabled.  If Temp1 is set to 3, Quad and Pent are disabled.  If Temp1 is set to 7, Quad, Pent, and Eyes are disabled.

Gibs are also controlled by the "Temp1" Server Variable.  To turn gibs off add 8 to the temp1 variable.
For example, a temp1 value of 9 would turn Quad and Gibs off.

You can set the Temp1 variable in the server's autoexec.cfg.  A sample autoexec.cfg could be:

	hostname ClanRing3.1
	sys_ticrate 0.7 <---- This sets how fast data is sent to players from the server.
                              Read techinfo.txt for more info.
	samelevel 2     <---- Tells the server to start in ClanRing Competition mode.
	teamplay 2      <---- Sets teamplay 2.
	sv_aim 2        <---- Turns autoaiming off.
	temp1 6         <---- Turns Pent and Eyes off, but leaves Quad and Gibs on.
	map dm3         <---- Starts the server on DM3.

You could also do this exact same configuration from the commandline.

	quake.exe -dedicated 16 -game clanring +samelevel 2 +teamplay 2 +sv_aim 2 +temp1 6 +map dm3	

I have received countless emails about how to properly start up a server using the ClanRing Mod.  I hope the above example clears everything up.  But for the .cfg-impaired, I will be releasing a teeny-tiny little program soon that you can run and it will ask you questions about how you want the server set up and then it will set the cfg's and qc files up accordingly.

Instructions - Observing
===================================================================================

Camera and AutoCamera Modes
===========================
The system is comprised of however many intermission points are on the level in addition to any cameras that admins have created.  Only admins may create or remove cameras, however, any observer may use them.  To become a camera observer, just type "Camera".  This will move you to the first available camera or intermission point.  Pressing Jump(spacebar) will move you through the various camera positions.  If you are an admin, you may delete your current camera by typing "RemoveCam"  If you are an admin and would like to add cameras, type "Observer"  this will put you into flying observer mode.  Flying Observer mode allows you to fly around the level in search of the perfect cam spot.  Once you've found a good spot, orient yourself in the direction that you want the camera and type "MakeCam"  If there aren't already 9 cameras, it'll create a new one.  Type "Camera" again when you're done setting up cameras.  Flying observer is also available to anyone to use.

The second part of the system is AutoCam.  This is enabled by typing "autocam".  This will enter you into a completely automated system which will attempt to show you some of the more interesting displays of violence in the level.  Typing "autocam" a second time will disable the system.  The viewer may also type "smooth" to help reduce the jerkyness of AutoCam.

ChaseCam and AutoChase Modes
============================
This Observer Mode is similar to a third person view available in many video games.  The Observer followes from behind the choosen player from an over the shoulder position.  This Observer Mode is choosen by typing ChaseCam.  You follow every move of the player, so if they move jerky and make several sharp turns, you will have a rough trip.  Players can be cycled through by pressing Jump(spacebar).  The observer does have the option of typing "smooth" which should help reduce the jerkyness associated with ChaseCam, but it is still dependant mainly on the choosen players movement and quality the observers connection.

The second part of this system is AutoChase.  This is enabled by typing "autochase".  This will choose the player to view for you.  And it will always keep you close to where the action is.  AutoChase is turned off by typing "autochase" a second time.

QuakeTV Mode and FreeLook
============================
QuakeTV Mode is a combination of both AutoCam and AutoChase.  It uses AutoCam most of the time but once a player has Quad Damage, it switches to ChaseCam and follows that player through the level.  Once Quad has expired, it switches back to AutoCam.  This Mode is turned on by typing "quaketv".  It is then turned off by typing "quaketv" again.

FreeLook allows an observer to choose the direction to look while using ChaseCam.  Freelook is enabled by typing "freelook" and then disabled by typing it a second time.



Commands - Players
============================================================================

Ready(impulse 40) ==> this signals the server that you are ready to play and you'd like to be placed on a team.  It will then place you on a team if you pant color matches one of the team pant colors, or it will create a new team if it doesn't.  You cannot join a team when you pant color is white.  If you receive the error "Invalid Color" you either have white pants or there are already 2 teams and your color doesn't match either of them.  Use "playerlist" to see the existing team colors.

The ready command will also give you your 3 digit ghost id code, you will need this code if you get disconnected and you try to re-enter the game.

Note:  When all players on a server have joined teams and the game is not being run by an observer, the game will automatically start at 1 minute countdown, once this is up, the match will begin.

NotReady(impulse 41) ==> this says that you're not happy with your current team.  It will remove you from your team and eliminate your team if you were the last person remaining.  It will also stop the countdown if the game is being run without an observer

Observer(impulse 42) ==> this removes you from your team and makes you an observer.  You can view the match without interferring as an observer.  Spacebar will let you move around the level.

Note:  If you join a match in progress or if the match starts and you do not have a team, you will automatically be made an observer.  You can type "Ready" to join a team if you are an observer, even if match is in progress.

Camera(impulse 171) ==> this removes you from your team and makes you a camera.  You can view the match without interferring as an observer. Spacebar will let you move between cameras.

Playerlist(impulse 80) ==> a very valuable command, this allows you to see the status of everyone on the server and to see what the pant colors of the existing teams are.  a pant color of 0 corresponds to a non-existant team.

Ghost(impulse 50) ==> this command allows you to rejoin a game as yourself if you get disconnected from the server.  The game will then prompt you for your 3 digit code that you were given when you first joined the match.  After you enter in the code, it will set your color and score.  It will then prompt you to type "Ready" to enter the match.

Warp(impulse 48) ==> allows changing of levels.  If you are not an admin, you need the approval of half of the people on the server, or a minimum of 3 people to change levels.  After you type in "warp" and hit enter, type in the episode number and hit enter and then hit the level number.  It will then request that the remaining people on the server confirm that this is where you want to go.  Once a sufficient number of people have typed "yes" at the console, the level will change.

Note:  Episode 5 is the deathmatch levels, Episode 6 is the start level, Episode 7 is your custom levels..

Commands(impulse 99) ==> gives a listing of all available commands.

Admin(impulse 51) ==> initiates admin authorization sequence.  You are prompted for the 4 digit code.  If you are unsuccessful at typing the code more than a couple times, the game assumes you are trying to hack the server and disconnects you.  If you are already an admin, you will become a normal observer.

Score(impulse 76) ==> tells you the current score

ViewRecord(impulse 44) ==> tells the scores and playerinfo from the previous match

ModStatus(impulse 49) ==> gives information about current settings

Colors(impulse 38) ==> will restore your colors if cleared by observer or admin commands

AutoCam(impulse 173) ==> engages AutoCam system which will switch you to the most interesting camera every so often

PlayerStats(impulse 81) ==> Gives stats about players, such as kills, deaths, friendly kills, enemy kills

ClanStats(impulse 82) ==> Gives stats about players, such as kills, deaths, friendly kills, enemy kills

Efficiency(impulse 84) ==> Gives efficiency ratings about players, currently kill efficiency and ammo efficiency

Timerstart(impulse 130) ==> Initiates Timer Override Function

ChaseCam(impulse 201) ==> Enables ChaseCamera Observer Mode

AutoChase(impulse 203) ==> enages AutoChase system which chooses the most interesting player to watch for you.

Smooth(impulse 205) ==> Toggles Camera smoothing (Results Vary!!!).  Works for AutoCam, ChaseCam, and AutoChase.

FreeLook(impulse 209) ==> Toggles FreeLooking for ChaseCam, AutoChase and AutoCam

QuakeTV(impulse 207) ==> Toggles QuakeTV system which is a combination of AutoChase and AutoCam

MOTD(impulse 253) ==> Displays the MOTD Server Connect statement

AutoWeapon(impulse 87) ==> Toggles whether AutoWeapon Mode.  OFF = No autoweapon switching period.  SMART = Changes to weapon when you pick it up or get ammo for it, except lightening gun under water, and it will not switch to explosive weapons when you pick up a back pack.  ON = Normal Quake AutoWeapon Switching.

ModeSet(impulse 147) ==> Start vote to switch from ClanRing Mode to Skirmish(FFA) Mode or vice-versa.

StatusBar(impulse 88) ==> Toggles whether to use the standard status bar or the Leet Ass Mofo Status Bar.  LAMSB is similar to Quake2's status bar.  Milage may vary.

SetRes(impulse 90) ==> If you are using a screen resolution other than 320x200, you need to run this command and then choose your resolution height from the list.  LAMSB will then be displayed in the proper place as will the QuakeTV mode displays.  Becareful when using this command.  If you choose a resolution higher than your actual res, Quake will most likely crash.

SetGib(impulse 56) ==> This will start a vote to turn gibs off or on.



Commands - Admins Only
==============================================================================

These commands won't be explained in great depth, mainly because there are too many of them, and partially because my hands are getting sore from typing.  All commands available to players are also available to admins and are therefore not listed here.

Timerstart(impulse 130) ==> starts the game timer in 10 minute rally/20 minute game mode

Timerstop(impulse 133)  ==> stops all timers and returns game to standby mode.  If in the middle of a match, it will actually end the match (i.e. gib players and show stats).

Timerup(impulse 131) ==> adds one minute to current timer

Timerdown(impulse 132) ==> subtracts one minute from current timer

Tlimitup(impulse 142) ==> adds ten minutes to current timelimit

Tlimitdown(impulse 143) ==> subtracts ten minutes from timelimit

Flimitup(impulse 144) ==> adds ten to the fraglimit

Flimitdown(impulse 145) ==> subtracts ten from the fraglimit

Noexitset(impulse 146) ==> toggles noexit setting

Matchup(impulse 134) ==> adds ten minutes to match timer

Matchdown(impulse 135) ==> subtracts ten minutes from match timer

Skick(impulse 75) ==> initiates kick routine.  game will then display the names of those on the server one by one.  Use the "Yes" and "No" commands for each player.

Showscore(impulse 200) ==> shows the current clan score to everyone on the server

Score(impulse 76) ==> shows the current clan score to you

Ghostlist(impulse 160) ==> gives you a listing of all ghosts in database. Information displayed is the id code, clan number, and number of frags.

Note:  all ghost data is cleared at start of match

Playerlist(impulse 154) ==> same as listed in player commands

Clearclans(impulse 161) ==> clears all clan information, including removal of all individuals from each clan and removal of clan color information.
This is NOT intended to be used except in rare occasions.  All clan info is automatically wiped after each game, and use of this command during a game would have disasterous consequencies.

Noexitset(impulse 78) ==> toggles noexit

Warp(impulse 48) ==> same as in player commands, except that level change is instantaneous since approval of other players is not required.

Commands(impulse 99) ==> listing of currently available commands

Dmset(impulse 68) ==> Toggles between deathmatch modes

Tmset(impulse 140) ==> Toggles between teamplay modes

Modeset (impulse 147) ==> Toggles between skirmish and clanring modes

Timerpause(impulse 45) ==> freezes the timer and all players

ViewRecord(impulse 44) ==> tells the scores and playerinfo from the previous match

Lockout(impulse 46) ==> toggles whether players can join a match in progress

Lockmax(impulse 47) ==> toggles the number of players that can be on a team, available values are between 2 and 8

Lockteam(impulse 39) ==> toggles the number of teams that are allowed, 2 is default, currently supports up to 8

ModStatus(impulse 49) ==> gives information about current settings

Colors(impulse 38) ==> will restore your colors if cleared by observer or admin commands

MakeCam(impulse 170) ==> creates a camera at your current position

RemoveCam(impulse 172) ==> removes the current camera

Efficiency(impulse 84) ==> Gives efficiency ratings about players, currently kill efficiency and ammo efficiency

StatDump(impulse 43) ==> Toggles whether or not you will receive a stat summary at the end of the match

Aimset(impulse 148) ==> Toggles SV_AIM between 0.93 and 2

RandomSpawns(impulse 86) ==> Toggles Random Spawning on and off.

PauseMode(impulse 89) ==> Toggles whether or not players can pause the game.

Reset(impulse 52) ==>  Restarts current level.

SetQuad(impulse 53) ==> Toggles Quad on or off.  Must Reset Server for it to take affect.

SetPent(impulse 54) ==> Toggles Pent on or off.  Must Reset Server for it to take affect.

SetEyes(impulse 55) ==> Toggles Eyes on or off.  Must Reset Server for it to take affect.

SetGib(impulse 56) ==> Turn gibs off or on.


Copyright Information
===========================================================================
Quake, is a registered Tradrmark of id Software,inc.
ClanRing, MPOG is a registered Trademark of Idle Communications, inc.

The original Quake C files are Copyright by id Software, 1996

This file and all modifications made to the files accompanying
it our Copyright by Idle Communication, Inc, 1997.  ALL Rights reserved.  

This modification if free for public and private NON-COMMERCIAL
use.  To use this modification for COMMERCIAL purposes, you must
contact the author, Paul Baker, for expressed written permission.

Authors MAY NOT use these modifications as a basis for other
publicly or commercially available work, without expressed
written permission from the Author, Paul Baker.

No modification can be made to this patch with the exception
of the settings.qc file, without expressed written permission
from the Author, Paul Baker.

You may distribute this Quake modification in any electronic
format as long as all the files in this archive remain intact
and unmodified and are distributed together.

You may not include this Quake modification on a CD or other
collection without the expressed written consent of the Author,
Paul Baker

This patch may be run on a quake server under the following
conditions:
	A:	No fee may be charged for the use of the server,
		either directly	or indirectly
	B:	No entity, be it a corporation or individual, 
		including but not limited to players, 
		server admins, or sponsers, may	receive 
		compensation, restitution, reimbursment, or
		payment resulting from any use of this Quake
		modification, either directly nor indirectly.
		This includes, but is not limited to, online or
		offline tournaments or events where this Quake
		modification is used without the expressed, written
		permission of the Author, Paul Baker.

You may post this Quake modification on a server, such as
a WWW or FTP server.


Special Thanks
============================================================================
I would like to thank, pAX-, my roommate for putting up with my very long hours and ramblings.  As well as me bugging him with questions like, "How do you do this in C?" and "Will you wake me up for my Astronomy test tomorrow?"

Marmot, for doing the ClanRing mod before me and helping? me get started.

I would like to thank Zoid, for telling me how to get centerprint to work the way I want it to.

Dru for talking to Zoid and asking him if he would take the time out finishing CTF 4.0 to help me.

Ignatu for allowing me to do this.

I would also like to help all the people of #ClanRing.

Special thanks goes out to John Bock(NB-Disciple).  He did most of the CTF mod work up until 2.5.  He have a discussion almost everynight about different things to add and we are constently bouncing ideas and code off eachother.  Thanks for all the help and support John.

Another Special thanks goes out to Joel Baxtor(lemurboy).  He wrote the code for Smart AutoWeapon, since i didn't have the time to.  He's DA MAN!!!  He has also taken up maintaining the CTF mod for me.  He is also part of the QSmack team which is now built into this mod.

Jonathan Roy for writing FastQCC.  Compiles QC about 20 times faster than qccdos which really helped during those times of extreme frustration.  Did I say 20 times faster?

And in no particular order, all the people who helped me test this mod and get the bugs out of it:

Dormouse (IPX Quake scanner!!!!, kick ass mail scanner and great source for programming help), zatz, Someone, Urs|DiY, Smits, Madclown, Melkor, sCary, Zero for crashing servers and then telling me how he did it...ass ;-), Larry Ellsworth for offering to pay me!, [MnO]Blade, Polaris, Pud, _Shade_, RaV, FuFu, ARM-Frug, Viper, Jester, _Sickboy_, AM-Hump, Latinum, Diablos, Thorn9, Biatch9, Beatch, Fourier, Shard, CSHarmony, TGR-Innoc, Reverence, Zero-TGR, Zero[s/p], Fraggle, InsnctTGR, Gollum, TheFatMan, ^DaG|mP^, Scrotovibe I miss the dynasty already :~(, Slim`, LizShue  I love her eyes!! Don't you?, MackJ2, HVC_Palp, PK-Random, |Satan|, |silent|, BigMike, HVC-Polynice, AM-Hermi, Bovril, SpamJav, Pillage, Jokey, Baby, Papa, Lindril, IceMan-SQ -- good luck with the new clan, Draco, Lambadomy, Zero (okay, I think I got all the Zero's now), Ner`zhul, and anyone else I forgot but belongs here (yes there are tons I have forgotten), you know who you are, so email me and tell me to add your name.

And I would like to give out a VERY, VERY, VERY SPECIAL THANKS to my girlfriend and solemate, Lesley, for putting up with me over these last few months while I was moody because of something that happened, rushing to meet a deadline, being frustrated by bugs in my code, etc.....  I LOVE YOU LESLEY!!!!


Just a note
============================================================================
Next time you see me on IRC, ask for blind.mov!!!


Disclaimer
============================================================================
I Deny having any idea as to what any of this all means.  As far as I know it could all be lies.  I give no warrenties, neither expressed nor implied.


Mp3's I Listened to the Most While Making This Version
============================================================================
Mouth by Bush (stingray mix), Supermans Dead by Our Lady of Peace.


Favorite Quotes made during the production of this mod
============================================================================
The Onion -- "After the recent furor over sheep cloning in Scotland, Onion reporters scoured the globe only to undercover another travesty against nature:  Mexican scientists at the University of Guadalajara have successfully copied a picture of sheep."

Ignatu -- "You should change your name to giZruptor!"




HOLY SHIT!!! Someone who read all the way to the end!!!