SUMMARY

Quetoo: Quake2 for deathmatch haX0rs

This is a source port of id Software's Quake II.  Initially a fork of the 
Quake2Forge project, this engine aims to provide security and performance
enhancements.  If you're looking for visual effect updates and gimmick 
features, run something else..

Quetoo is meant to build and run on GNU/Linux.  It is also fully supported
on FreeBSD.  Quetoo uses Simple Direct Medialayer (SDL) for sound and OpenGL
context management.  If your platform has SDL, Quetoo might run for you.

INSTALL

Quetoo builds with GNU Automake.  To build it, do the following:

./configure && sudo make install

Your Quake II game data should reside in $PREFIX/share/quake2.  To specify
an alternate path, use --datadir=/some/path.  A quake2 directory is 
automatically appended to the path you provide.  See ./configure --help for
more information.

RUNNING

Quetoo can be executed from any path.  To set your video mode, use vid_width,
vid_height, and vid_fullscreen.  You must issue vid_restart for your changes
to take effect.

vid_width 1024; vid_height 768; vid_fullscreen 1; vid_restart

F11 toggles fullscreen quickly, for switching to other windows.

Mouse cvars are universally prefixed with "m_."  So use m_sensitvity, 
m_invert, and m_filter to adjust your mouse.

To adjust brightness levels, use vid_gamma.  You may also play with 
gl_modulate and gl_intensity, but you must issue gl_reload for these changes
to take effect.

To change rail trail color, adjust cl_railtrailcolor.  "Tan" and "blue" are 
recognized strings.  Integers from 1-255 are also valid.

Use cl_showfps to view your framerate on screen, and cl_maxfps to cap it.
60 is a good number for LCD monitors, 124 provides optimal physics for 
jumping.  You can also use cl_showspeed to view your player's horizontal
velocity, which can be helpful for practicing jumps.

High color Targa (.tga) image support is available for textures, status
bar pics, crosshairs, and model skins.  You may wish to download our 
Retexture pak from http://jdolan.dyndns.org/trac/wiki/Retexture.

Location files (.loc) are fully supported, and should reside in your maps
directory, alongside their respective .bsp file.  e.g. baseq2/maps/q2dm1.loc.
You may create your own .loc files using the addloc and savelocs commands.
The tokens $loc_here and $loc_there are expanded in your chat messages to
your current location, and the location you're looking at, respectively.

Wildcard Pakfiles (*.pak) are also supported, so you're not limited to 
pak0-9.pak for your Pakfiles.  Meaningful names like retexture.pak and 
qmass-sounds.pak will help keep your baseq2 folder organized.

There's quite a bit more to this engine.  Cvarlist and cmdlist are your
friends, so use them.  You may also find the CHANGES section of this 
file interesting.  Enjoy.

CREDITS

Jay Dolan, http://jaydolan.com/quetoo.html
The QuakeForge Project, http://quakeforge.net
id Software, http://idsoftware.com

ADDITIONAL CREDITS

Alexey Dokuchaev, danfe at nsu dot ru
  FreeBSD support, railtrail cvar, and other invaluable patches.
Eddie Pettis, npettis at ecn dot purdue dot edu
  Profiling support.
Ragnvald "Despair" Maartmann-Moe IV
  Particles drawing, relentless criticism ;)
Richard "R1CH" Stanway, http://r1ch.net
  Protocol 35 support, security enhancements.

LICENSE

Quetoo is released under the GNU General Public License (GPL) v2.0.

TODO

-Re-add Xatrix/Rogue stuff?
-Bundle quetoo rc/init.d script?

CHANGES

0.6.1 (Revision 203)

-Added asynchronous video/sound and network framing.  Video and sound updates
are now run independently of network updates (CL_SendCommand).  This allows
clients to run at desirable (high) video framerates (i.e. vsync) without 
saturating their connection or flooding the server.  The cvar cl_maxfps now
limits video/sound/input frames, while cl_maxpps (default value 30) caps
network frames.
-Added facilities to immediately send network packets containing urgent 
information (weapon firing, inventory use, begin, new, ..).  This helps 
clients with low cl_maxpps stay competitive, and provides a nice edge for
the rest.
-Added bright player skins support via cl_brightskins.  Red boys, green girls.
-Added call to CL_Drop in SV_Map.  Fixes several small issues when joining a
local server.

0.6.0 (Revision 191)

-R1Q2 Protocol 35 support.  Enjoy bandwidth savings and faster downloads.
-Fixed connectionless vulnerabilities in client discovered by R1CH.
-Server now prevents malformed skins (e.g. male/../female/athena).
-Ability to build dedicated server only.  Client object code is not compiled
or linked into binary.  Pass --without-client to ./configure.
-Removed setenv and prog client commands.  These were not used.
-Changed cl_forcefov to simply use fov->value when set.  Value is archived.
-Added instagib and arena gameplay modes to qmass mod.  Gameplay may be 
changed on the fly.  Clients are respawned and items are toggled accordingly.
-Added player voting system to qmass mod.  Map, gameplay, fraglimit, 
timelimit, kick, and other commands may all be voted upon.
-Added Lithium II style offhand hook to qmass mod.  Bind a key to +hook.
May be toggled via hook cvar, and is votable.  Defaults to off.
-Added client connect and disconnect MySQL logging to qmass mod.
-Added teamplay to qmass mod.  Uses new scoreboard layout when enabled.
-The zlib cvar has been superceded by a quetoo cvar, which uses an integer
value to bitmap various Quetoo-specific protocol extensions (like zlib).
-Zlib is never considered for messages smaller than 200 bytes.
-New extension QUETOO_PLAYERSTATE makes optimizations for Quetoo client
playerstate messages.  Saves a significant amount of bandwidth.
-Client records demos with the current server's protocol.  Quetoo server
has been modified to handle Protocol 35 demo playback.
-Removed attractloop boolean from server, this functionality can be
resolved by examining sv.state.  Client maintains this field as demoserver.
-Removed loadgame boolean from server.  No longer needed.
-Removed disable screen boolean from client.  No longer needed.
-Game progs are never reloaded, nor their frames run, for demo playback.
-Game for demos is set immediately, rather than latched as before.  This
allows immediate playback of demos requiring game-specific data (e.g. ctf).
-Sound updates are no longer performed if a client is less than fully 
connected and active (i.e. no more stuttering during map changes).
-Removed server sided demo recording.  It was never used.
-Functionality in q_shared.c is built as a libtool library, and is made
available to game mods at linktime.  No more duplicate code.
-Game mods to be built are now specified with --with-games='mods'.  Ctf is 
no longer built by default.  Try --with-games='baseq2 ctf qmass'.
-Reverted cvar structure.  Quetoo game mods will run on other engines, and
vise-versa.  Try the qmass mod on r1q2ded.
-Removed CL_PrecacheModels.  Was rather uneccessary.
-Removed all dlsym glue for sound and video refreshes.  Removed software
renderer.  Quetoo now requires OpenGL and SDL.
-Client now sleeps briefly when at fullscreen console.
-SV_DemoCompleted now sends friendly message to clients and shuts server
down cleanly.  Removed killserver muck.
-Existence of maps and demos is checked before a SV_SpawnServer is tried.
-Only calc screen vrect when dirty.
-Added signal handling for clean(er) exits.
-Because no refresh library is dlopen'ed, vid_restart only applies video
mode changes.  In order to manipulate game textures (gl_modulate, 
gl_intensity, gl_loadtga, etc) use gl_reload.
-Bundled the Vanilla CTF mod source code, cleaned up for gcc4 and fitted with
Autoconf build scripts.  Ah, the memories..

0.5.1 (Security fixes inspired by r1q2, Revision 147)

-Refuse connections for clients with empty or invalid userinfo strings.
-Refuse connections for clients stuffing xFF in userinfo strings.
-Refuse connections for clients stuffing IP address in userinfo strings.
-Fix bug where valid clients can be overwritten by reconnect challenges.
-Drop clients who provide empty or invalid userinfo.
-Drop clients who stuff xFF into userinfo or stringcmd.
-Drop clients who request negative baselines or configstrings offset.
-Drop clients who request illegal download offset or filename.
-Drop clients who issue multiple begins when spawned.
-Drop clients who issue illegal player movement commands.
-Catch buffer overflows in command token parsing.
-Added SV_KickClient(client_t *cl, char *msg).  NULL msg is fine.
-Added SV_ClientAdrToString(client_t *cl) for printing client IPs.
-Removed checksum validation of player movement.
-Dedicated servers may now host demos.
-Added s_ambient to toggle ambient (world) sounds.  Defaults to 1 (on).
-Fixed gl_texturemode default value.

0.5.0 (Revision 141)

-Added .loc file support for reporting player's location to teammates 
in-game.  $loc_here and $loc_there are chat macros which expand to the 
player's current location and targetted location, respectively.
-Added addloc and savelocs commands for manipulating .loc files.
-Added wildcard pak file support, use meaningful names for your pak files.
-Added positioned console editing.  Backspace, delete, and left arrow each
act as you'd expect in any text editor.
-Bundled new conchars and ch4 Targas for GL renderer.  Set cl_crosshair 4.
-Removed savegame support.  Quetoo is not recommended for SP.
-Setenv and getenv calls are #ifdef'ed out for Windows builds.
-Removed all renderer conditionals from GL path.  Chipsets and drivers
requiring special case handling are _broken_, and very old.
-Removed SGIS multitexture support.  It is deprecated.
-Removed 3dfx shared palette support.  It is deprecated.
-Removed support for broken 3dlabs drivers.
-Removed RF_DEPTHHACK.  Was only used for viewmodel.
-Removed mutable palette.  Was only used by cinematics.
-Fixed non-multitexture lighting path.  Was broken some time ago.
-Added datarootdir to appease autoconf 2.60.
-Removed zlib header from zlib datagrams, saves a few bytes.

0.4.0 (Revision 107)

-Cvars now print their current value when tab-completing.
-Use quetoo.cfg instead of config.cfg, no longer exec default.cfg on startup.
-TGA support for crosshairs and conchars (console font).
-gl_monolightmap provides a neutral, white lightmap for all surfaces.
-zlib compression for network datagrams when playing on Quetoo server.
-cl_precachemodels allows clients to specify a set of player models
to precache.  This can be used to avoid initial model and sound loading
stutter on machines with slow drives (laptops).  Defaults to "male 
female cyborg".  See #10.
-cl_ignore is a whitespace-delimited string containing chat strings to
be ignored.  Messages containing an ignorable string are simply dropped.
This can be used to ignore a player, a team or clan, etc.  See #11.
-cl_chatsound specifies the wav file to be played for chat alerts.  Defaults
to "misc/talk.wav".  Set to "" to silence chat alerts.  See #11.
-cl_forcefov overrides fov directives in player state packets.  Useful 
for watching demos at fov > 90.  Defaults to 0 (disabled).
-s_mixahead now defaults to 0.05 instead of 0.2.
-SDL sound driver has been refactored, and no longer causes Sig11 when
switching back and forth with the ALSA driver.  See #9.
-SDL sound driver chooses more sane sample rates.
-ALSA driver is a little better at setting requested sample rates.
-ALSA default period and buffer are now 2048 and 8192, respectively.
-Added configurable speed cheat detection via SV_GiveMsec.  sv_enforcetime
threshold now defaults to MSEC_ERROR_MAX (30).  Bad movements increase
clients error threshold by 10, normal movements decrement by 1.
-Removed lightlevel hack.  Monsters now attack player even if in dark places.
Client packets are 128-padded to maintain protocol 34 compatibility.
-Fixed a long-standing Quake2 bug where servers running on a level for more
than 9 hours would enter twilight zone (plats go through ceilings, doors fall
through floors, lasers trigger every other frame, etc..).  This was caused
by a failed check in g_phys.c, SV_RunThink.  Fixed in all game modules.
-Fixed another original Quake2 bug, some calls to gi.error burried in g_main.c
and g_phys.c erroneously passed a print level constant, altho the signature
for the function calls for just a string format.
-Fixed a bug in the ctf scoreboard which caused the left half of the board to
be transmitted and drawn twice on each scoreboard request.  Saves a bit of 
bandwidth for ctf games.
-Renamed R_LightPoint to GL_LightPoint in GL render path, to avoid name
collision.  Was previously linking from software renderer.
-Fully removed all polyblend code from render paths.  Note that the player
state struct still requires this for protocol compatibility.  However, the
software renderer is significantly faster now that the blend is completely
ignored.
-Removed sky rotation support, as it was horribly inefficient.
-Removed timerefresh, as it's a worthless benchmark.
-Removed togglechat function, it's never called.
-Only update netgraph values when scr_netgraph is enabled
-Re-added beam entity creation and drawing (ctf grapple, etc..)
-Sound info struct is now snddef_s, typedef snddef_t.
-Removed nextserver nonsense, as Quetoo does not support cinematics.  Server
will gracefully skip over intermissions and procede to next level.
-Refactored demomap command to simply demo, and .dm2 suffix is no longer
necessary, (e.g. demo demo1).
-Cleaned up server downloading checks, there were several length errors.
-Major namespace changes; SNDDMA functions are now simply SND.  snd_dma.c
has been renamed snd_ref.c.  REF functions are now VID.  ref_*.c have each
been renamed to vid_*.c accordingly.
-Many cvar and cmd name changes:
	CHANGED cl_drawfps->cl_showfps, sensitivity->m_sensitivity, sndspeed->s_rate,
		sndbits->s_bits, sndchannels->s_channels, play->s_play, soundstop->s_stop,
		soundlist->s_list, soundinfo->s_info, netgraph->scr_netgraph
	REMOVED cl_lookstrafe, cl_lookspring, cl_add_lights, cl_add_blend, cl_gun,
		demomap, m_forward, m_side
	NEW m_invert, gl_monolightmap, cl_chatsound, cl_ignore, cl_precachemodels,
		cl_showspeed, demo, cl_forcefov, zlib

0.3.4

-Killed off acinclude.m4, contained paranoid vararg and SDL checks.
-More cleanups to configure.in #2 #3 and #4.
-Removed #ifdefs for dlopen.  If you don't have it, Quetoo won't work.
-Added MYSQL_LIBS to src/qmass/Makefile.am #5.
-Merged patches from Eddie to enable profiling.
-Merged patches from Alexey for FreeBSD support #6.
-Merged patches from Alexey for configurable railtrail color #7.
-Added .tga texture loading support for all bmodels to gl renderer.
-Tga texture loading can be toggled by gl_loadtga, defaults to 1.
-Removed (unused) .tga loading code from software renderer.
-Broke PCX and Targa loading/writing into separate source files.

0.3.3

-Massive cleanups to config.in.  OpenGL no longer relies on X11.
-Added checks for SSE (i686) floating point optimizations.
-Added -fno-strict-aliasing to src/Makefile.am.  Corrects compilation
issues with gcc 4.1.x (Fedora 5).
-Screenshots now named quetooXX.tga.
-Removed gl_swapinterval, gl_ext_swapinterval.  This was a Windows-
centric vsync feature.  Use nvidia-settings or driconf to control vsync.
-Mousewheel scrolls console.
-Changed (broken) gl_showtris to a working gl_wireframe.
-Small optimizations to cl_screen.c, only calculate vrect when dirty.
-Small optimizations to snd_mix.c, only calculate snd_vol when dirty.
-s_volume may never exceed 1.0.
-F10/F11 fullscreen/windowed mouse toggles were added to ref_sdl.c.
Previous Alt-Enter, Ctrl-G were removed.  ref_sdl.c was also refactored
to more closely resemble ref_glx.c.
-Added README to src/qmass for qmass deathmatch mod.

0.3.2

-Relaxed failed client parse attempts for illegible server messages
(e.g. Rogue/Xatrix effects).  Client simply drops packet.
-Fixed dynamic world light lightmap loading.  Polys intended to
be lit by world dlights no longer appear dark.
-Fixed gcc4 compilation issues with snd_alsa.c.

0.3.1

-Fixed source defines in Makefile.am so that make dist bundles
icon.xbm into distribution tarball.
-Fixed compilation issue with ref_glx.c when XF86VidMode
is not present.

0.3

-Killed off block*.h, d_ifacea.h, these were ASM leftovers.
-Killed off glw.h, in.c, sv_null.c, and other stale source files.
-Renamed rw_*.c to ref_*.c, as this better describes their function.
-Merged rw.h to ref.h, which became vid_ref.h.  Software and GL renderers
now share the same header file.
-Merged vid.h to vid_so.c, which became vid_ref.c.
-Renamed RW_* renderer functions to REF_*.
-Merged snd_loc.h to sound.h.
-Removed [broken] oss sound driver.  OSS is officially deprecated.  If
this is a problem for you, get a new kernel.
-Sound driver now defaulted to "alsa".
-Removed s_khz cvar, redundant to sndspeed.
-Dedicated server loads q2dm1 when no map is provided on startup.
-Sounds may now be precached with global index "#" prefix.
-Removed GL_EXT_POINT check and GL_DrawParticles function.  This 
actually tested to be significantly slower than the software implementation.
-Scaled particle texture to 1/2 size, particles are now smaller.
-Updated copyrights and GNU/GPL header comments.
-Removed IPX protocol support.  I hear the Internet is here to stay.
-Removed dynamic lighting from software and gl renderers.
-Removed shadows from gl renderer.
-Removed explosions.
-Removed cl_newfx.c and other rogue/xatric code.
-Relaxed Com_Error calls on unrecognized muzzleflashes to simply Com_Printf.
-Added proper male sound precaching to qmass game.
-Fixed random skin support in qmass game.
-Fixed vweap in qmass game.
-Much more desirable map rotation in qmass game.  sv_maplist now
specifies a plain text file (e.g. maps.lst) which lists levels, one per line.  This
map is parsed in InitGame, and loaded into a maplist_t struct.  The list is 
iterated by EndDMLevel.  The list is randomized if sv_rmap is set.
-BFG 2d sprite effect has been removed.
-Removed all lightstyles support (world dynamic lights, flickering,
candle effects, etc).  Removed all dlight caches.  Optimized lightmap
loading.
-Removed gl_monolightmap.  Use gl_lightmap instead.
-Added configurable sv_maxrate, defaulted to 5000.
-F10 now toggles vid_fullscreen.
-Added XVidMode support (fullscreen) to ref_softx.c.
-Merged uint32.h to mdfour.h.

0.2

-Removed .asm, .S, and .inc assembler files, removed all [m]asm code.  The 
assembler only benefits the software renderer, and provides only a 10% 
performance increase.  A pure c implementation is easier on my eyes.
-Fixed software renderer unresolved symbols.
-Sound mixing is a bit smarter.  Volume is scaled down when more than 2 
sounds are being mixed simultaneously.  Levels are also more aggressively
clipped for stereo samples, resulting in a cleaner sound experience.
-ALSA driver is much more forgiving of cards which do not honor period
and buffer requests.
-Fixed old glx segfault when pressing F11.
-Killed off quakeio.*, ndga.*, and newt.*.  These were no longer used.
-qmass mod is no longer built by default.  --enable-qmass to build it.
-Removed all monster and singleplayer code from qmass.
-Fixed qmass MySQL support
-Fixed qmass deathmatch intermission.
-Added random male skin selection on connect to qmass.  Players may only
change skin if teamplay is enabled in dmflags.

0.1, initial release

-Brand new ALSA sound driver (actually works)
-Netgraph is slightly smaller, with transparent background, and is drawn 
behind the player stats.  Graph data is only updated when graph is visible.
-fs_basedir honors PKGDATADIR and PKGLIBDIR, so mods can be installed like
everyone is used to (e.g. /usr/local/share/quake2/ctf)
-fs_gamedir is exported to environment as QUAKE2_HOME on startup.  Mods may
safely use this variable to perform file io in their respective homes.
-Timedemo is disabled in deathmatch and coop modes, and readonly for 
dedicated servers.  Timedemo in multiplayer is not only stupid, but it 
crashes the server :)
-The rocket launcher is now elegible for selection when a player is out of
ammo.  It was previously skipped.  This is a long-standing bug from id's 
original game source.  Affects baseq2, ctf, and qmass games.
-FS_OpenFile now ensures a file is a regular file before returning it.  This 
fixes a known server crash (e.g. cmd download maps).
-Fixed unchecked strcpy in Cmd_TokenizeString which could allow arbitrary 
code execution.
-Link command is now jailed to fs_gamedir, fixing an exploit that allowed 
random filesystem access to players with rcon (e.g. rcon link /etc foo;
download foo/passwd).
-Fixed unchecked memcpy in Cbuf_Execute which could allow arbitrary code
execution.
-Unix-like cmd/cvar completion.  All potential matches for commands and cvars
are printed on tab.  Nothing is appended to the input buffer unless it is an
exact, or only, match.  Commands are printed in green, cvars in white.
-Removed superfluous fopen/fclose when resolving sexed (per-model) sounds.
This fixes a hiccup in gameplay when such a sound is first loaded on machines
with slower harddrives (i.e. notebooks).
-Video mode is now controlled by two cvars: vid_width and vid_height.  This is
significantly better than any list of hard-coded modes.
-Removed in-game menus
-Removed cd audio support
-Removed .cin and .pcx support
-Removed camera separation (3d vr headset) support
-Removed console show/hide animation
-Removed tiled screen background
-Fixed gl_ztrick bug with 2d display
-No longer start demo on startup (go straight to fullscreen console)
-Removed most explosion effects in deathmatch mode, in favor of simple
particle effects.  This should lighten the load on older machines when in
busy firefights, and allows the player to see what's going on.
-Simplified some particle effects for better visual clarity.
-New QMass game mod, found in src/qmass.  Features MySQL frag logging.
./configure --with-mysql=$prefix to enable.
