]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
moved almost all server cvars to sv_main.c and added corresponding
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 11 May 2007 01:04:45 +0000 (01:04 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 11 May 2007 01:04:45 +0000 (01:04 +0000)
externs in server.h
removed cl_gravity and cl_slowmo cvars
renamed cl.movevars_slowmo to cl.movevars_timescale

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7262 d7cf8633-e32d-0410-b094-e92efae38249

15 files changed:
cl_collision.c
cl_input.c
cl_parse.c
client.h
clvm_cmds.c
csprogs.c
host.c
netconn.h
quakedef.h
server.h
sv_main.c
sv_phys.c
sv_user.c
svvm_cmds.c
world.c

index 1fe3b937e3c1b99e373d2776ab16f7228cfddb36..96980272fa39d0c6c6f4d2d055f5291d65558db7 100644 (file)
@@ -154,7 +154,6 @@ int CL_GenericHitSuperContentsMask(const prvm_edict_t *passedict)
 CL_Move
 ==================
 */
-extern cvar_t sv_debugmove;
 trace_t CL_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, qboolean hitnetworkbrushmodels, qboolean hitnetworkplayers, int *hitnetworkentity, qboolean hitcsqcentities)
 {
        vec3_t hullmins, hullmaxs;
index a2400a6f285c376ffacf264418ce5eb8645d1205..0fd7f40cee4103ed2b8ff9bf2ce32c76e1a01b38 100644 (file)
@@ -333,7 +333,8 @@ cvar_t cl_movement_maxspeed = {0, "cl_movement_maxspeed", "320", "how fast you c
 cvar_t cl_movement_maxairspeed = {0, "cl_movement_maxairspeed", "30", "how fast you can move while in the air (should match sv_maxairspeed)"};
 cvar_t cl_movement_stopspeed = {0, "cl_movement_stopspeed", "100", "speed below which you will be slowed rapidly to a stop rather than sliding endlessly (should match sv_stopspeed)"};
 cvar_t cl_movement_friction = {0, "cl_movement_friction", "4", "how fast you slow down (should match sv_friction)"};
-cvar_t cl_movement_waterfriction = {0, "cl_movement_waterfriction", "-1", "how fast you slow down (should match sv_friction), if less than 0 the cl_movement_friction variable is used instead"};
+cvar_t cl_movement_wallfriction = {0, "cl_movement_wallfriction", "1", "how fast you slow down while sliding along a wall (should match sv_wallfriction)"};
+cvar_t cl_movement_waterfriction = {0, "cl_movement_waterfriction", "-1", "how fast you slow down (should match sv_waterfriction), if less than 0 the cl_movement_friction variable is used instead"};
 cvar_t cl_movement_edgefriction = {0, "cl_movement_edgefriction", "2", "how much to slow down when you may be about to fall off a ledge (should match edgefriction)"};
 cvar_t cl_movement_stepheight = {0, "cl_movement_stepheight", "18", "how tall a step you can step in one instant (should match sv_stepheight)"};
 cvar_t cl_movement_accelerate = {0, "cl_movement_accelerate", "10", "how fast you accelerate (should match sv_accelerate)"};
@@ -342,8 +343,6 @@ cvar_t cl_movement_wateraccelerate = {0, "cl_movement_wateraccelerate", "-1", "h
 cvar_t cl_movement_jumpvelocity = {0, "cl_movement_jumpvelocity", "270", "how fast you move upward when you begin a jump (should match the quakec code)"};
 cvar_t cl_movement_airaccel_qw = {0, "cl_movement_airaccel_qw", "1", "ratio of QW-style air control as opposed to simple acceleration (should match sv_airaccel_qw)"};
 cvar_t cl_movement_airaccel_sideways_friction = {0, "cl_movement_airaccel_sideways_friction", "0", "anti-sideways movement stabilization (should match sv_airaccel_sideways_friction)"};
-cvar_t cl_gravity = {0, "cl_gravity", "800", "how much gravity to apply in client physics (should match sv_gravity)"};
-cvar_t cl_slowmo = {0, "cl_slowmo", "1", "speed of game time (should match slowmo)"};
 
 cvar_t in_pitch_min = {0, "in_pitch_min", "-90", "how far downward you can aim (quake used -70"};
 cvar_t in_pitch_max = {0, "in_pitch_max", "90", "how far upward you can aim (quake used 80"};
@@ -984,7 +983,7 @@ void CL_ClientMovement_Physics_Walk(cl_clientmovement_state_t *s)
                        accelspeed = min(cl.movevars_accelerate * s->q.frametime * wishspeed, addspeed);
                        VectorMA(s->velocity, accelspeed, wishdir, s->velocity);
                }
-               s->velocity[2] -= cl_gravity.value * s->q.frametime;
+               s->velocity[2] -= cl.movevars_gravity * cl.movevars_entgravity * s->q.frametime;
                if (cls.protocol == PROTOCOL_QUAKEWORLD)
                        s->velocity[2] = 0;
                if (VectorLength2(s->velocity))
@@ -1027,7 +1026,7 @@ void CL_ClientMovement_Physics_Walk(cl_clientmovement_state_t *s)
                        VectorMA(vel_perpend, vel_straight, wishdir, s->velocity);
                        s->velocity[2] += vel_z;
                }
-               s->velocity[2] -= cl_gravity.value * s->q.frametime;
+               s->velocity[2] -= cl.movevars_gravity * cl.movevars_entgravity * s->q.frametime;
                CL_ClientMovement_Move(s);
        }
 }
@@ -1050,16 +1049,16 @@ void CL_UpdateMoveVars(void)
 {
        if (cls.protocol == PROTOCOL_QUAKEWORLD)
        {
-               cl.movevars_slowmo = 1;
+               cl.movevars_timescale = 1;
                cl.movevars_ticrate = 1.0 / bound(1, cl_netinputpacketspersecond.value, 100);
                // scale playback speed of demos by slowmo cvar
                if (cls.demoplayback)
-                       cl.movevars_slowmo *= slowmo.value;
+                       cl.movevars_timescale *= slowmo.value;
        }
        else if (cl.stats[STAT_MOVEVARS_TICRATE])
        {
                cl.movevars_ticrate = cl.statsf[STAT_MOVEVARS_TICRATE];
-               cl.movevars_slowmo = cl.statsf[STAT_MOVEVARS_TIMESCALE];
+               cl.movevars_timescale = cl.statsf[STAT_MOVEVARS_TIMESCALE];
                cl.movevars_gravity = cl.statsf[STAT_MOVEVARS_GRAVITY];
                cl.movevars_stopspeed = cl.statsf[STAT_MOVEVARS_STOPSPEED] ;
                cl.movevars_maxspeed = cl.statsf[STAT_MOVEVARS_MAXSPEED];
@@ -1075,15 +1074,16 @@ void CL_UpdateMoveVars(void)
                cl.movevars_airaccel_qw = cl.statsf[STAT_MOVEVARS_AIRACCEL_QW];
                cl.movevars_airaccel_sideways_friction = cl.statsf[STAT_MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION];
                cl.movevars_friction = cl.statsf[STAT_MOVEVARS_FRICTION];
+               cl.movevars_wallfriction = cl.statsf[STAT_MOVEVARS_WALLFRICTION];
                cl.movevars_waterfriction = cl.statsf[STAT_MOVEVARS_WATERFRICTION];
                // scale playback speed of demos by slowmo cvar
                if (cls.demoplayback)
-                       cl.movevars_slowmo *= slowmo.value;
+                       cl.movevars_timescale *= slowmo.value;
        }
        else
        {
                cl.movevars_ticrate = 1.0 / bound(1, cl_netinputpacketspersecond.value, 100);
-               cl.movevars_slowmo = slowmo.value;
+               cl.movevars_timescale = slowmo.value;
                cl.movevars_gravity = sv_gravity.value;
                cl.movevars_stopspeed = cl_movement_stopspeed.value;
                cl.movevars_maxspeed = cl_movement_maxspeed.value;
@@ -1092,6 +1092,7 @@ void CL_UpdateMoveVars(void)
                cl.movevars_airaccelerate = cl_movement_airaccelerate.value < 0 ? cl_movement_accelerate.value : cl_movement_airaccelerate.value;
                cl.movevars_wateraccelerate = cl_movement_wateraccelerate.value < 0 ? cl_movement_accelerate.value : cl_movement_wateraccelerate.value;
                cl.movevars_friction = cl_movement_friction.value;
+               cl.movevars_wallfriction = cl_movement_wallfriction.value;
                cl.movevars_waterfriction = cl_movement_waterfriction.value < 0 ? cl_movement_friction.value : cl_movement_waterfriction.value;
                cl.movevars_entgravity = 1;
                cl.movevars_jumpvelocity = cl_movement_jumpvelocity.value;
@@ -1657,15 +1658,16 @@ void CL_InitInput (void)
        Cvar_RegisterVariable(&cl_movement_maxairspeed);
        Cvar_RegisterVariable(&cl_movement_stopspeed);
        Cvar_RegisterVariable(&cl_movement_friction);
+       Cvar_RegisterVariable(&cl_movement_wallfriction);
+       Cvar_RegisterVariable(&cl_movement_waterfriction);
        Cvar_RegisterVariable(&cl_movement_edgefriction);
        Cvar_RegisterVariable(&cl_movement_stepheight);
-       Cvar_RegisterVariable(&cl_movement_airaccelerate);
        Cvar_RegisterVariable(&cl_movement_accelerate);
+       Cvar_RegisterVariable(&cl_movement_airaccelerate);
+       Cvar_RegisterVariable(&cl_movement_wateraccelerate);
        Cvar_RegisterVariable(&cl_movement_jumpvelocity);
        Cvar_RegisterVariable(&cl_movement_airaccel_qw);
        Cvar_RegisterVariable(&cl_movement_airaccel_sideways_friction);
-       Cvar_RegisterVariable(&cl_gravity);
-       Cvar_RegisterVariable(&cl_slowmo);
 
        Cvar_RegisterVariable(&in_pitch_min);
        Cvar_RegisterVariable(&in_pitch_max);
index 3c93a37bacfc360b9f7fb941d9cdf99acc755f29..44c7a517c5adb55645d82673e64a451b43e0d702 100644 (file)
@@ -1418,7 +1418,7 @@ void CL_ParseServerInfo (void)
                str = MSG_ReadString ();
                strlcpy (cl.levelname, str, sizeof(cl.levelname));
 
-               // get the movevars
+               // get the movevars that are defined in the qw protocol
                cl.movevars_gravity            = MSG_ReadFloat();
                cl.movevars_stopspeed          = MSG_ReadFloat();
                cl.movevars_maxspeed           = MSG_ReadFloat();
@@ -1429,14 +1429,16 @@ void CL_ParseServerInfo (void)
                cl.movevars_friction           = MSG_ReadFloat();
                cl.movevars_waterfriction      = MSG_ReadFloat();
                cl.movevars_entgravity         = MSG_ReadFloat();
+
                // other movevars not in the protocol...
-               cl.movevars_slowmo = 1;
+               cl.movevars_wallfriction = 0;
+               cl.movevars_timescale = 1;
                cl.movevars_jumpvelocity = 270;
                cl.movevars_edgefriction = 2;
                cl.movevars_maxairspeed = 30;
                cl.movevars_stepheight = 18;
-               cl.movevars_airaccel_qw = 1.0;
-               cl.movevars_airaccel_sideways_friction = 0.0;
+               cl.movevars_airaccel_qw = 1;
+               cl.movevars_airaccel_sideways_friction = 0;
 
                // seperate the printfs so the server message can have a color
                Con_Printf("\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n\n\2%s\n", str);
@@ -2865,9 +2867,9 @@ static void CL_NetworkTimeReceived(double newtime)
                        else if (fabs(cl.time - cl.mtime[1]) > 0.1)
                                cl.time += 0.5 * (cl.mtime[1] - cl.time); // fast
                        else if (cl.time > cl.mtime[1])
-                               cl.time -= 0.002 * cl.movevars_slowmo; // fall into the past by 2ms
+                               cl.time -= 0.002 * cl.movevars_timescale; // fall into the past by 2ms
                        else
-                               cl.time += 0.001 * cl.movevars_slowmo; // creep forward 1ms
+                               cl.time += 0.001 * cl.movevars_timescale; // creep forward 1ms
                }
        }
        // this packet probably contains a player entity update, so we will need
@@ -3255,6 +3257,8 @@ void CL_ParseServerMessage(void)
 
                        case qw_svc_entgravity:
                                cl.movevars_entgravity = MSG_ReadFloat();
+                               if (!cl.movevars_entgravity)
+                                       cl.movevars_entgravity = 1.0f;
                                break;
 
                        case qw_svc_setpause:
index 78392e93066097a80b317e213951818cb3e37715..76fce5bf96e08db2c5ff03e95156cc84754208dc 100644 (file)
--- a/client.h
+++ b/client.h
@@ -943,8 +943,11 @@ typedef struct client_state_s
        //qboolean qw_spectator;
 
        // movement parameters for client prediction
+       float movevars_wallfriction;
+       float movevars_waterfriction;
+       float movevars_friction;
        float movevars_ticrate;
-       float movevars_slowmo;
+       float movevars_timescale;
        float movevars_gravity;
        float movevars_stopspeed;
        float movevars_maxspeed;
@@ -952,8 +955,6 @@ typedef struct client_state_s
        float movevars_accelerate;
        float movevars_airaccelerate;
        float movevars_wateraccelerate;
-       float movevars_friction;
-       float movevars_waterfriction;
        float movevars_entgravity;
        float movevars_jumpvelocity;
        float movevars_edgefriction;
index 674221abc85f74b7ba769b9d80ef368ce04ee63c..431ec3d985c3a94bb9a89d6b9ab4b189d1a56381 100644 (file)
@@ -234,7 +234,6 @@ static void VM_CL_tracebox (void)
        VM_SetTraceGlobals(&trace);
 }
 
-extern cvar_t cl_gravity;
 trace_t CL_Trace_Toss (prvm_edict_t *tossent, prvm_edict_t *ignore)
 {
        int i;
@@ -257,7 +256,7 @@ trace_t CL_Trace_Toss (prvm_edict_t *tossent, prvm_edict_t *ignore)
                gravity = val->_float;
        else
                gravity = 1.0;
-       gravity *= cl_gravity.value * 0.05;
+       gravity *= cl.movevars_gravity * 0.05;
 
        for (i = 0;i < 200;i++) // LordHavoc: sanity check; never trace more than 10 seconds
        {
index dcd6e5b3b1278e836d92025581e1839cffd33587..fefd0f4e72a00a67dd00e17f7072c25b997e0138 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -49,8 +49,6 @@ void CL_VM_Error (const char *format, ...)    //[515]: hope it will be never execut
 //[515]: set globals before calling R_UpdateView, WEIRD CRAP
 static void CSQC_SetGlobals (void)
 {
-       //extern cvar_t sv_accelerate, sv_friction, sv_gravity, sv_stopspeed, sv_maxspeed;
-
        CSQC_BEGIN
                prog->globals.client->time = cl.time;
                prog->globals.client->frametime = max(0, cl.time - cl.oldtime);
diff --git a/host.c b/host.c
index 3e1ba42a2ae36babb0036bb75592e9c0c5576abb..de12e31f8bd158d0680bbf3c70c4986aed9530ea 100644 (file)
--- a/host.c
+++ b/host.c
@@ -52,47 +52,19 @@ client_t *host_client;
 
 jmp_buf host_abortframe;
 
-// random seed
-cvar_t sv_random_seed = {0, "sv_random_seed", "", "random seed; when set, on every map start this random seed is used to initialize the random number generator. Don't touch it unless for benchmarking or debugging"};
-
 // pretend frames take this amount of time (in seconds), 0 = realtime
 cvar_t host_framerate = {0, "host_framerate","0", "locks frame timing to this value in seconds, 0.05 is 20fps for example, note that this can easily run too fast, use cl_maxfps if you want to limit your framerate instead, or sys_ticrate to limit server speed"};
 // shows time used by certain subsystems
 cvar_t host_speeds = {0, "host_speeds","0", "reports how much time is used in server/graphics/sound"};
-// LordHavoc: framerate independent slowmo
-cvar_t slowmo = {0, "slowmo", "1.0", "controls game speed, 0.5 is half speed, 2 is double speed"};
 // LordHavoc: framerate upper cap
 cvar_t cl_maxfps = {CVAR_SAVE, "cl_maxfps", "1000", "maximum fps cap, if game is running faster than this it will wait before running another frame (useful to make cpu time available to other programs)"};
 
-// print broadcast messages in dedicated mode
-cvar_t sv_echobprint = {CVAR_SAVE, "sv_echobprint", "1", "prints gamecode bprint() calls to server console"};
-
-cvar_t sys_ticrate = {CVAR_SAVE, "sys_ticrate","0.05", "how long a server frame is in seconds, 0.05 is 20fps server rate, 0.1 is 10fps (can not be set higher than 0.1), 0 runs as many server frames as possible (makes games against bots a little smoother, overwhelms network players)"};
-cvar_t sv_fixedframeratesingleplayer = {0, "sv_fixedframeratesingleplayer", "0", "allows you to use server-style timing system in singleplayer (don't run faster than sys_ticrate)"};
-
-cvar_t fraglimit = {CVAR_NOTIFY, "fraglimit","0", "ends level if this many frags is reached by any player"};
-cvar_t timelimit = {CVAR_NOTIFY, "timelimit","0", "ends level at this time (in minutes)"};
-cvar_t teamplay = {CVAR_NOTIFY, "teamplay","0", "teamplay mode, values depend on mod but typically 0 = no teams, 1 = no team damage no self damage, 2 = team damage and self damage, some mods support 3 = no team damage but can damage self"};
-
-cvar_t samelevel = {CVAR_NOTIFY, "samelevel","0", "repeats same level if level ends (due to timelimit or someone hitting an exit)"};
-cvar_t noexit = {CVAR_NOTIFY, "noexit","0", "kills anyone attempting to use an exit"};
-
 cvar_t developer = {0, "developer","0", "prints additional debugging messages and information (recommended for modders and level designers)"};
 cvar_t developer_entityparsing = {0, "developer_entityparsing", "0", "prints detailed network entities information each time a packet is received"};
 
-cvar_t skill = {0, "skill","1", "difficulty level of game, affects monster layouts in levels, 0 = easy, 1 = normal, 2 = hard, 3 = nightmare (same layout as hard but monsters fire twice)"};
-cvar_t deathmatch = {0, "deathmatch","0", "deathmatch mode, values depend on mod but typically 0 = no deathmatch, 1 = normal deathmatch with respawning weapons, 2 = weapons stay (players can only pick up new weapons)"};
-cvar_t coop = {0, "coop","0", "coop mode, 0 = no coop, 1 = coop mode, multiple players playing through the singleplayer game (coop mode also shuts off deathmatch)"};
-
-cvar_t pausable = {0, "pausable","1", "allow players to pause or not"};
-
-cvar_t temp1 = {0, "temp1","0", "general cvar for mods to use, in stock id1 this selects which death animation to use on players (0 = random death, other values select specific death scenes)"};
-
 cvar_t timestamps = {CVAR_SAVE, "timestamps", "0", "prints timestamps on console messages"};
 cvar_t timeformat = {CVAR_SAVE, "timeformat", "[%Y-%m-%d %H:%M:%S] ", "time format to use on timestamped console messages"};
 
-cvar_t sv_checkforpacketsduringsleep = {0, "sv_checkforpacketsduringsleep", "0", "uses select() function to wait between frames which can be interrupted by packets being received, instead of Sleep()/usleep()/SDL_Sleep() functions which do not check for packets"};
-
 /*
 ================
 Host_AbortCurrentFrame
@@ -224,36 +196,15 @@ static void Host_InitLocal (void)
        Cmd_AddCommand("saveconfig", Host_SaveConfig_f, "save settings to config.cfg immediately (also automatic when quitting)");
        Cmd_AddCommand("loadconfig", Host_LoadConfig_f, "reset everything and reload configs");
 
-       Cvar_RegisterVariable (&sv_random_seed);
        Cvar_RegisterVariable (&host_framerate);
        Cvar_RegisterVariable (&host_speeds);
-       Cvar_RegisterVariable (&slowmo);
        Cvar_RegisterVariable (&cl_maxfps);
 
-       Cvar_RegisterVariable (&sv_echobprint);
-
-       Cvar_RegisterVariable (&sys_ticrate);
-       Cvar_RegisterVariable (&sv_fixedframeratesingleplayer);
-
-       Cvar_RegisterVariable (&fraglimit);
-       Cvar_RegisterVariable (&timelimit);
-       Cvar_RegisterVariable (&teamplay);
-       Cvar_RegisterVariable (&samelevel);
-       Cvar_RegisterVariable (&noexit);
-       Cvar_RegisterVariable (&skill);
        Cvar_RegisterVariable (&developer);
        Cvar_RegisterVariable (&developer_entityparsing);
-       Cvar_RegisterVariable (&deathmatch);
-       Cvar_RegisterVariable (&coop);
-
-       Cvar_RegisterVariable (&pausable);
-
-       Cvar_RegisterVariable (&temp1);
 
        Cvar_RegisterVariable (&timestamps);
        Cvar_RegisterVariable (&timeformat);
-
-       Cvar_RegisterVariable (&sv_checkforpacketsduringsleep);
 }
 
 
@@ -771,7 +722,7 @@ void Host_Main(void)
                                clframetime = cl.realframetime = 0.1;
 
                        // apply slowmo scaling
-                       clframetime *= cl.movevars_slowmo;
+                       clframetime *= cl.movevars_timescale;
 
                        // host_framerate overrides all else
                        if (host_framerate.value)
index 6b5252a339faf01a3281928969a02842b6b635bf..b686aad9ddc6fa6adb74dbec8956f20444623694 100755 (executable)
--- a/netconn.h
+++ b/netconn.h
@@ -340,6 +340,8 @@ extern int serverreplycount;
 
 extern sizebuf_t net_message;
 
+extern cvar_t sv_public;
+
 extern cvar_t cl_netlocalping;
 
 extern cvar_t cl_netport;
index ad63c3019dc8589697d9c9b3089fb3b617d3532f..65a442549dd560816446c5a8210054f927da35d8 100644 (file)
@@ -94,7 +94,8 @@ extern char engineversion[128];
 //#define STAT_TIME                    17 // FTE
 //#define STAT_VIEW2           20 // FTE
 #define STAT_VIEWZOOM          21 // DP
-#define STAT_MOVEVARS_FRICTION                                         228 // DP
+#define STAT_MOVEVARS_WALLFRICTION                                     237 // DP
+#define STAT_MOVEVARS_FRICTION                                         238 // DP
 #define STAT_MOVEVARS_WATERFRICTION                                    239 // DP
 #define STAT_MOVEVARS_TICRATE                                          240 // DP
 #define STAT_MOVEVARS_TIMESCALE                                                241 // DP
index 699b11a1be96c85625c8a8348f74bee8ed903e68..e32c35500d4b5e0386afd50678ba797c905c41ef 100644 (file)
--- a/server.h
+++ b/server.h
@@ -287,49 +287,95 @@ typedef struct client_s
 
 //============================================================================
 
-extern cvar_t teamplay;
-extern cvar_t skill;
-extern cvar_t deathmatch;
 extern cvar_t coop;
+extern cvar_t deathmatch;
 extern cvar_t fraglimit;
-extern cvar_t timelimit;
+extern cvar_t gamecfg;
+extern cvar_t noexit;
+extern cvar_t nomonsters;
 extern cvar_t pausable;
-extern cvar_t sv_maxvelocity;
-extern cvar_t sv_gravity;
-extern cvar_t sv_nostep;
-extern cvar_t sv_friction;
-extern cvar_t sv_waterfriction;
-extern cvar_t sv_edgefriction;
-extern cvar_t sv_stopspeed;
-extern cvar_t sv_maxspeed;
-extern cvar_t sv_maxairspeed;
+extern cvar_t pr_checkextension;
+extern cvar_t samelevel;
+extern cvar_t saved1;
+extern cvar_t saved2;
+extern cvar_t saved3;
+extern cvar_t saved4;
+extern cvar_t savedgamecfg;
+extern cvar_t scratch1;
+extern cvar_t scratch2;
+extern cvar_t scratch3;
+extern cvar_t scratch4;
+extern cvar_t skill;
+extern cvar_t slowmo;
 extern cvar_t sv_accelerate;
-extern cvar_t sv_airaccelerate;
-extern cvar_t sv_wateraccelerate;
-extern cvar_t sv_jumpvelocity;
+extern cvar_t sv_aim;
 extern cvar_t sv_airaccel_qw;
 extern cvar_t sv_airaccel_sideways_friction;
-extern cvar_t sv_idealpitchscale;
-extern cvar_t sv_aim;
-extern cvar_t sv_stepheight;
-extern cvar_t sv_jumpstep;
-extern cvar_t sv_public;
-extern cvar_t sv_maxrate;
-
+extern cvar_t sv_airaccelerate;
+extern cvar_t sv_allowdownloads;
+extern cvar_t sv_allowdownloads_archive;
+extern cvar_t sv_allowdownloads_config;
+extern cvar_t sv_allowdownloads_dlcache;
+extern cvar_t sv_allowdownloads_inarchive;
+extern cvar_t sv_areagrid_mingridsize;
+extern cvar_t sv_checkforpacketsduringsleep;
+extern cvar_t sv_clmovement_enable;
+extern cvar_t sv_clmovement_minping;
+extern cvar_t sv_clmovement_minping_disabletime;
+extern cvar_t sv_clmovement_waitforinput;
+extern cvar_t sv_cullentities_nevercullbmodels;
+extern cvar_t sv_cullentities_pvs;
+extern cvar_t sv_cullentities_stats;
+extern cvar_t sv_cullentities_trace;
+extern cvar_t sv_cullentities_trace_delay;
+extern cvar_t sv_cullentities_trace_enlarge;
+extern cvar_t sv_cullentities_trace_prediction;
+extern cvar_t sv_cullentities_trace_samples;
+extern cvar_t sv_cullentities_trace_samples_extra;
+extern cvar_t sv_debugmove;
+extern cvar_t sv_echobprint;
+extern cvar_t sv_edgefriction;
+extern cvar_t sv_entpatch;
+extern cvar_t sv_fixedframeratesingleplayer;
+extern cvar_t sv_freezenonclients;
+extern cvar_t sv_friction;
+extern cvar_t sv_gameplayfix_blowupfallenzombies;
+extern cvar_t sv_gameplayfix_droptofloorstartsolid;
+extern cvar_t sv_gameplayfix_findradiusdistancetobox;
 extern cvar_t sv_gameplayfix_grenadebouncedownslopes;
 extern cvar_t sv_gameplayfix_noairborncorpse;
+extern cvar_t sv_gameplayfix_qwplayerphysics;
+extern cvar_t sv_gameplayfix_setmodelrealbox;
 extern cvar_t sv_gameplayfix_stepdown;
 extern cvar_t sv_gameplayfix_stepwhilejumping;
 extern cvar_t sv_gameplayfix_swiminbmodels;
-extern cvar_t sv_gameplayfix_setmodelrealbox;
-extern cvar_t sv_gameplayfix_blowupfallenzombies;
-extern cvar_t sv_gameplayfix_findradiusdistancetobox;
-extern cvar_t sv_gameplayfix_qwplayerphysics;
 extern cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag;
-extern cvar_t sv_gameplayfix_droptofloorstartsolid;
-
+extern cvar_t sv_gravity;
+extern cvar_t sv_idealpitchscale;
+extern cvar_t sv_jumpstep;
+extern cvar_t sv_jumpvelocity;
+extern cvar_t sv_maxairspeed;
+extern cvar_t sv_maxrate;
+extern cvar_t sv_maxspeed;
+extern cvar_t sv_maxvelocity;
+extern cvar_t sv_newflymove;
+extern cvar_t sv_nostep;
+extern cvar_t sv_playerphysicsqc;
+extern cvar_t sv_progs;
+extern cvar_t sv_protocolname;
+extern cvar_t sv_random_seed;
+extern cvar_t sv_ratelimitlocalplayer;
+extern cvar_t sv_sound_land;
+extern cvar_t sv_sound_watersplash;
+extern cvar_t sv_stepheight;
+extern cvar_t sv_stopspeed;
+extern cvar_t sv_wallfriction;
+extern cvar_t sv_wateraccelerate;
+extern cvar_t sv_waterfriction;
 extern cvar_t sys_ticrate;
-extern cvar_t sv_fixedframeratesingleplayer;
+extern cvar_t teamplay;
+extern cvar_t temp1;
+extern cvar_t timelimit;
 
 extern mempool_t *sv_mempool;
 
index 0fcde551b9f25be19878fdad09eb01be3fd14511..cc13af5a1351485cb60feabcd9ca9405d9c3861c 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "quakedef.h"
 #include "libcurl.h"
 
-extern void SV_Phys_Init (void);
 static void SV_SaveEntFile_f(void);
 static void SV_StartDownload_f(void);
 static void SV_Download_f(void);
@@ -32,56 +31,98 @@ void VM_CustomStats_Clear (void);
 void VM_SV_UpdateCustomStats (client_t *client, prvm_edict_t *ent, sizebuf_t *msg, int *stats);
 void EntityFrameCSQC_WriteFrame (sizebuf_t *msg, int numstates, const entity_state_t *states);
 
-
-// select which protocol to host, this is fed to Protocol_EnumForName
-cvar_t sv_protocolname = {0, "sv_protocolname", "DP7", "selects network protocol to host for (values include QUAKE, QUAKEDP, NEHAHRAMOVIE, DP1 and up)"};
-cvar_t sv_ratelimitlocalplayer = {0, "sv_ratelimitlocalplayer", "0", "whether to apply rate limiting to the local player in a listen server (only useful for testing)"};
-cvar_t sv_maxrate = {CVAR_SAVE | CVAR_NOTIFY, "sv_maxrate", "10000", "upper limit on client rate cvar, should reflect your network connection quality"};
+cvar_t coop = {0, "coop","0", "coop mode, 0 = no coop, 1 = coop mode, multiple players playing through the singleplayer game (coop mode also shuts off deathmatch)"};
+cvar_t deathmatch = {0, "deathmatch","0", "deathmatch mode, values depend on mod but typically 0 = no deathmatch, 1 = normal deathmatch with respawning weapons, 2 = weapons stay (players can only pick up new weapons)"};
+cvar_t fraglimit = {CVAR_NOTIFY, "fraglimit","0", "ends level if this many frags is reached by any player"};
+cvar_t gamecfg = {0, "gamecfg", "0", "unused cvar in quake, can be used by mods"};
+cvar_t noexit = {CVAR_NOTIFY, "noexit","0", "kills anyone attempting to use an exit"};
+cvar_t nomonsters = {0, "nomonsters", "0", "unused cvar in quake, can be used by mods"};
+cvar_t pausable = {0, "pausable","1", "allow players to pause or not"};
+cvar_t pr_checkextension = {CVAR_READONLY, "pr_checkextension", "1", "indicates to QuakeC that the standard quakec extensions system is available (if 0, quakec should not attempt to use extensions)"};
+cvar_t samelevel = {CVAR_NOTIFY, "samelevel","0", "repeats same level if level ends (due to timelimit or someone hitting an exit)"};
+cvar_t skill = {0, "skill","1", "difficulty level of game, affects monster layouts in levels, 0 = easy, 1 = normal, 2 = hard, 3 = nightmare (same layout as hard but monsters fire twice)"};
+cvar_t slowmo = {0, "slowmo", "1.0", "controls game speed, 0.5 is half speed, 2 is double speed"};
+
+cvar_t sv_accelerate = {0, "sv_accelerate", "10", "rate at which a player accelerates to sv_maxspeed"};
+cvar_t sv_aim = {CVAR_SAVE, "sv_aim", "2", "maximum cosine angle for quake's vertical autoaim, a value above 1 completely disables the autoaim, quake used 0.93"};
+cvar_t sv_airaccel_qw = {0, "sv_airaccel_qw", "1", "ratio of QW-style air control as opposed to simple acceleration"};
+cvar_t sv_airaccel_sideways_friction = {0, "sv_airaccel_sideways_friction", "", "anti-sideways movement stabilization (reduces speed gain when zigzagging)"};
+cvar_t sv_airaccelerate = {0, "sv_airaccelerate", "-1", "rate at which a player accelerates to sv_maxairspeed while in the air, if less than 0 the sv_accelerate variable is used instead"};
 cvar_t sv_allowdownloads = {0, "sv_allowdownloads", "1", "whether to allow clients to download files from the server (does not affect http downloads)"};
-cvar_t sv_allowdownloads_inarchive = {0, "sv_allowdownloads_inarchive", "0", "whether to allow downloads from archives (pak/pk3)"};
 cvar_t sv_allowdownloads_archive = {0, "sv_allowdownloads_archive", "0", "whether to allow downloads of archives (pak/pk3)"};
 cvar_t sv_allowdownloads_config = {0, "sv_allowdownloads_config", "0", "whether to allow downloads of config files (cfg)"};
 cvar_t sv_allowdownloads_dlcache = {0, "sv_allowdownloads_dlcache", "0", "whether to allow downloads of dlcache files (dlcache/)"};
-
-extern cvar_t sv_random_seed;
-
-static cvar_t sv_cullentities_pvs = {0, "sv_cullentities_pvs", "1", "fast but loose culling of hidden entities"}; // fast but loose
-static cvar_t sv_cullentities_trace = {0, "sv_cullentities_trace", "0", "somewhat slow but very tight culling of hidden entities, minimizes network traffic and makes wallhack cheats useless"}; // tends to get false negatives, uses a timeout to keep entities visible a short time after becoming hidden
-static cvar_t sv_cullentities_trace_samples = {0, "sv_cullentities_trace_samples", "1", "number of samples to test for entity culling"};
-static cvar_t sv_cullentities_trace_samples_extra = {0, "sv_cullentities_trace_samples_extra", "2", "number of samples to test for entity culling when the entity affects its surroundings by e.g. dlight"};
-static cvar_t sv_cullentities_trace_enlarge = {0, "sv_cullentities_trace_enlarge", "0", "box enlargement for entity culling"};
-static cvar_t sv_cullentities_trace_delay = {0, "sv_cullentities_trace_delay", "1", "number of seconds until the entity gets actually culled"};
-static cvar_t sv_cullentities_trace_prediction = {0, "sv_cullentities_trace_prediction", "1", "also trace from the predicted player position"};
-static cvar_t sv_cullentities_nevercullbmodels = {0, "sv_cullentities_nevercullbmodels", "0", "if enabled the clients are always notified of moving doors and lifts and other submodels of world (warning: eats a lot of network bandwidth on some levels!)"};
-static cvar_t sv_cullentities_stats = {0, "sv_cullentities_stats", "0", "displays stats on network entities culled by various methods for each client"};
-static cvar_t sv_entpatch = {0, "sv_entpatch", "1", "enables loading of .ent files to override entities in the bsp (for example Threewave CTF server pack contains .ent patch files enabling play of CTF on id1 maps)"};
-
+cvar_t sv_allowdownloads_inarchive = {0, "sv_allowdownloads_inarchive", "0", "whether to allow downloads from archives (pak/pk3)"};
+cvar_t sv_areagrid_mingridsize = {CVAR_NOTIFY, "sv_areagrid_mingridsize", "64", "minimum areagrid cell size, smaller values work better for lots of small objects, higher values for large objects"};
+cvar_t sv_checkforpacketsduringsleep = {0, "sv_checkforpacketsduringsleep", "0", "uses select() function to wait between frames which can be interrupted by packets being received, instead of Sleep()/usleep()/SDL_Sleep() functions which do not check for packets"};
+cvar_t sv_clmovement_enable = {0, "sv_clmovement_enable", "1", "whether to allow clients to use cl_movement prediction, which can cause choppy movement on the server which may annoy other players"};
+cvar_t sv_clmovement_minping = {0, "sv_clmovement_minping", "0", "if client ping is below this time in milliseconds, then their ability to use cl_movement prediction is disabled for a while (as they don't need it)"};
+cvar_t sv_clmovement_minping_disabletime = {0, "sv_clmovement_minping_disabletime", "1000", "when client falls below minping, disable their prediction for this many milliseconds (should be at least 1000 or else their prediction may turn on/off frequently)"};
+cvar_t sv_clmovement_waitforinput = {0, "sv_clmovement_waitforinput", "16", "when a client does not send input for this many frames, force them to move anyway (unlike QuakeWorld)"};
+cvar_t sv_cullentities_nevercullbmodels = {0, "sv_cullentities_nevercullbmodels", "0", "if enabled the clients are always notified of moving doors and lifts and other submodels of world (warning: eats a lot of network bandwidth on some levels!)"};
+cvar_t sv_cullentities_pvs = {0, "sv_cullentities_pvs", "1", "fast but loose culling of hidden entities"};
+cvar_t sv_cullentities_stats = {0, "sv_cullentities_stats", "0", "displays stats on network entities culled by various methods for each client"};
+cvar_t sv_cullentities_trace = {0, "sv_cullentities_trace", "0", "somewhat slow but very tight culling of hidden entities, minimizes network traffic and makes wallhack cheats useless"};
+cvar_t sv_cullentities_trace_delay = {0, "sv_cullentities_trace_delay", "1", "number of seconds until the entity gets actually culled"};
+cvar_t sv_cullentities_trace_enlarge = {0, "sv_cullentities_trace_enlarge", "0", "box enlargement for entity culling"};
+cvar_t sv_cullentities_trace_prediction = {0, "sv_cullentities_trace_prediction", "1", "also trace from the predicted player position"};
+cvar_t sv_cullentities_trace_samples = {0, "sv_cullentities_trace_samples", "1", "number of samples to test for entity culling"};
+cvar_t sv_cullentities_trace_samples_extra = {0, "sv_cullentities_trace_samples_extra", "2", "number of samples to test for entity culling when the entity affects its surroundings by e.g. dlight"};
+cvar_t sv_debugmove = {CVAR_NOTIFY, "sv_debugmove", "0", "disables collision detection optimizations for debugging purposes"};
+cvar_t sv_echobprint = {CVAR_SAVE, "sv_echobprint", "1", "prints gamecode bprint() calls to server console"};
+cvar_t sv_edgefriction = {0, "edgefriction", "2", "how much you slow down when nearing a ledge you might fall off"};
+cvar_t sv_entpatch = {0, "sv_entpatch", "1", "enables loading of .ent files to override entities in the bsp (for example Threewave CTF server pack contains .ent patch files enabling play of CTF on id1 maps)"};
+cvar_t sv_fixedframeratesingleplayer = {0, "sv_fixedframeratesingleplayer", "0", "allows you to use server-style timing system in singleplayer (don't run faster than sys_ticrate)"};
+cvar_t sv_freezenonclients = {CVAR_NOTIFY, "sv_freezenonclients", "0", "freezes time, except for players, allowing you to walk around and take screenshots of explosions"};
+cvar_t sv_friction = {CVAR_NOTIFY, "sv_friction","4", "how fast you slow down"};
+cvar_t sv_gameplayfix_blowupfallenzombies = {0, "sv_gameplayfix_blowupfallenzombies", "1", "causes findradius to detect SOLID_NOT entities such as zombies and corpses on the floor, allowing splash damage to apply to them"};
+cvar_t sv_gameplayfix_droptofloorstartsolid = {0, "sv_gameplayfix_droptofloorstartsolid", "1", "prevents items and monsters that start in a solid area from falling out of the level (makes droptofloor treat trace_startsolid as an acceptable outcome)"};
+cvar_t sv_gameplayfix_findradiusdistancetobox = {0, "sv_gameplayfix_findradiusdistancetobox", "1", "causes findradius to check the distance to the corner of a box rather than the center of the box, makes findradius detect bmodels such as very large doors that would otherwise be unaffected by splash damage"};
 cvar_t sv_gameplayfix_grenadebouncedownslopes = {0, "sv_gameplayfix_grenadebouncedownslopes", "1", "prevents MOVETYPE_BOUNCE (grenades) from getting stuck when fired down a downward sloping surface"};
 cvar_t sv_gameplayfix_noairborncorpse = {0, "sv_gameplayfix_noairborncorpse", "1", "causes entities (corpses) sitting ontop of moving entities (players) to fall when the moving entity (player) is no longer supporting them"};
+cvar_t sv_gameplayfix_qwplayerphysics = {0, "sv_gameplayfix_qwplayerphysics", "1", "changes water jumping to make it easier to get out of water, and prevents friction on landing when bunnyhopping"};
+cvar_t sv_gameplayfix_setmodelrealbox = {0, "sv_gameplayfix_setmodelrealbox", "1", "fixes a bug in Quake that made setmodel always set the entity box to ('-16 -16 -16', '16 16 16') rather than properly checking the model box, breaks some poorly coded mods"};
 cvar_t sv_gameplayfix_stepdown = {0, "sv_gameplayfix_stepdown", "0", "attempts to step down stairs, not just up them (prevents the familiar thud..thud..thud.. when running down stairs and slopes)"};
 cvar_t sv_gameplayfix_stepwhilejumping = {0, "sv_gameplayfix_stepwhilejumping", "1", "applies step-up onto a ledge even while airborn, useful if you would otherwise just-miss the floor when running across small areas with gaps (for instance running across the moving platforms in dm2, or jumping to the megahealth and red armor in dm2 rather than using the bridge)"};
 cvar_t sv_gameplayfix_swiminbmodels = {0, "sv_gameplayfix_swiminbmodels", "1", "causes pointcontents (used to determine if you are in a liquid) to check bmodel entities as well as the world model, so you can swim around in (possibly moving) water bmodel entities"};
-cvar_t sv_gameplayfix_setmodelrealbox = {0, "sv_gameplayfix_setmodelrealbox", "1", "fixes a bug in Quake that made setmodel always set the entity box to ('-16 -16 -16', '16 16 16') rather than properly checking the model box, breaks some poorly coded mods"};
-cvar_t sv_gameplayfix_blowupfallenzombies = {0, "sv_gameplayfix_blowupfallenzombies", "1", "causes findradius to detect SOLID_NOT entities such as zombies and corpses on the floor, allowing splash damage to apply to them"};
-cvar_t sv_gameplayfix_findradiusdistancetobox = {0, "sv_gameplayfix_findradiusdistancetobox", "1", "causes findradius to check the distance to the corner of a box rather than the center of the box, makes findradius detect bmodels such as very large doors that would otherwise be unaffected by splash damage"};
-cvar_t sv_gameplayfix_qwplayerphysics = {0, "sv_gameplayfix_qwplayerphysics", "1", "changes water jumping to make it easier to get out of water, and prevents friction on landing when bunnyhopping"};
 cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag = {0, "sv_gameplayfix_upwardvelocityclearsongroundflag", "1", "prevents monsters, items, and most other objects from being stuck to the floor when pushed around by damage, and other situations in mods"};
-cvar_t sv_gameplayfix_droptofloorstartsolid = {0, "sv_gameplayfix_droptofloorstartsolid", "1", "prevents items and monsters that start in a solid area from falling out of the level (makes droptofloor treat trace_startsolid as an acceptable outcome)"};
-
+cvar_t sv_gravity = {CVAR_NOTIFY, "sv_gravity","800", "how fast you fall (512 = roughly earth gravity)"};
+cvar_t sv_idealpitchscale = {0, "sv_idealpitchscale","0.8", "how much to look up/down slopes and stairs when not using freelook"};
+cvar_t sv_jumpstep = {CVAR_NOTIFY, "sv_jumpstep", "0", "whether you can step up while jumping (sv_gameplayfix_stepwhilejumping must also be 1)"};
+cvar_t sv_jumpvelocity = {0, "sv_jumpvelocity", "270", "cvar that can be used by QuakeC code for jump velocity"};
+cvar_t sv_maxairspeed = {0, "sv_maxairspeed", "30", "maximum speed a player can accelerate to when airborn (note that it is possible to completely stop by moving the opposite direction)"};
+cvar_t sv_maxrate = {CVAR_SAVE | CVAR_NOTIFY, "sv_maxrate", "10000", "upper limit on client rate cvar, should reflect your network connection quality"};
+cvar_t sv_maxspeed = {CVAR_NOTIFY, "sv_maxspeed", "320", "maximum speed a player can accelerate to when on ground (can be exceeded by tricks)"};
+cvar_t sv_maxvelocity = {CVAR_NOTIFY, "sv_maxvelocity","2000", "universal speed limit on all entities"};
+cvar_t sv_newflymove = {CVAR_NOTIFY, "sv_newflymove", "0", "enables simpler/buggier player physics (not recommended)"};
+cvar_t sv_nostep = {CVAR_NOTIFY, "sv_nostep","0", "prevents MOVETYPE_STEP entities (monsters) from moving"};
+cvar_t sv_playerphysicsqc = {CVAR_NOTIFY, "sv_playerphysicsqc", "1", "enables QuakeC function to override player physics"};
 cvar_t sv_progs = {0, "sv_progs", "progs.dat", "selects which quakec progs.dat file to run" };
+cvar_t sv_protocolname = {0, "sv_protocolname", "DP7", "selects network protocol to host for (values include QUAKE, QUAKEDP, NEHAHRAMOVIE, DP1 and up)"};
+cvar_t sv_random_seed = {0, "sv_random_seed", "", "random seed; when set, on every map start this random seed is used to initialize the random number generator. Don't touch it unless for benchmarking or debugging"};
+cvar_t sv_ratelimitlocalplayer = {0, "sv_ratelimitlocalplayer", "0", "whether to apply rate limiting to the local player in a listen server (only useful for testing)"};
+cvar_t sv_sound_land = {0, "sv_sound_land", "demon/dland2.wav", "sound to play when MOVETYPE_STEP entity hits the ground at high speed (empty cvar disables the sound)"};
+cvar_t sv_sound_watersplash = {0, "sv_sound_watersplash", "misc/h2ohit1.wav", "sound to play when MOVETYPE_FLY/TOSS/BOUNCE/STEP entity enters or leaves water (empty cvar disables the sound)"};
+cvar_t sv_stepheight = {CVAR_NOTIFY, "sv_stepheight", "18", "how high you can step up (TW_SV_STEPCONTROL extension)"};
+cvar_t sv_stopspeed = {CVAR_NOTIFY, "sv_stopspeed","100", "how fast you come to a complete stop"};
+cvar_t sv_wallfriction = {CVAR_NOTIFY, "sv_wallfriction", "1", "how much you slow down when sliding along a wall"};
+cvar_t sv_wateraccelerate = {0, "sv_wateraccelerate", "-1", "rate at which a player accelerates to sv_maxspeed while in the air, if less than 0 the sv_accelerate variable is used instead"};
+cvar_t sv_waterfriction = {CVAR_NOTIFY, "sv_waterfriction","-1", "how fast you slow down, if less than 0 the sv_friction variable is used instead"};
+cvar_t sys_ticrate = {CVAR_SAVE, "sys_ticrate","0.05", "how long a server frame is in seconds, 0.05 is 20fps server rate, 0.1 is 10fps (can not be set higher than 0.1), 0 runs as many server frames as possible (makes games against bots a little smoother, overwhelms network players)"};
+cvar_t teamplay = {CVAR_NOTIFY, "teamplay","0", "teamplay mode, values depend on mod but typically 0 = no teams, 1 = no team damage no self damage, 2 = team damage and self damage, some mods support 3 = no team damage but can damage self"};
+cvar_t timelimit = {CVAR_NOTIFY, "timelimit","0", "ends level at this time (in minutes)"};
 
-cvar_t pr_checkextension = {CVAR_READONLY, "pr_checkextension", "1", "indicates to QuakeC that the standard quakec extensions system is available (if 0, quakec should not attempt to use extensions)"};
-cvar_t nomonsters = {0, "nomonsters", "0", "unused cvar in quake, can be used by mods"};
-cvar_t gamecfg = {0, "gamecfg", "0", "unused cvar in quake, can be used by mods"};
-cvar_t scratch1 = {0, "scratch1", "0", "unused cvar in quake, can be used by mods"};
-cvar_t scratch2 = {0,"scratch2", "0", "unused cvar in quake, can be used by mods"};
-cvar_t scratch3 = {0, "scratch3", "0", "unused cvar in quake, can be used by mods"};
-cvar_t scratch4 = {0, "scratch4", "0", "unused cvar in quake, can be used by mods"};
-cvar_t savedgamecfg = {CVAR_SAVE, "savedgamecfg", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"};
 cvar_t saved1 = {CVAR_SAVE, "saved1", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"};
 cvar_t saved2 = {CVAR_SAVE, "saved2", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"};
 cvar_t saved3 = {CVAR_SAVE, "saved3", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"};
 cvar_t saved4 = {CVAR_SAVE, "saved4", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"};
+cvar_t savedgamecfg = {CVAR_SAVE, "savedgamecfg", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"};
+cvar_t scratch1 = {0, "scratch1", "0", "unused cvar in quake, can be used by mods"};
+cvar_t scratch2 = {0,"scratch2", "0", "unused cvar in quake, can be used by mods"};
+cvar_t scratch3 = {0, "scratch3", "0", "unused cvar in quake, can be used by mods"};
+cvar_t scratch4 = {0, "scratch4", "0", "unused cvar in quake, can be used by mods"};
+cvar_t temp1 = {0, "temp1","0", "general cvar for mods to use, in stock id1 this selects which death animation to use on players (0 = random death, other values select specific death scenes)"};
+
 cvar_t nehx00 = {0, "nehx00", "0", "nehahra data storage cvar (used in singleplayer)"};
 cvar_t nehx01 = {0, "nehx01", "0", "nehahra data storage cvar (used in singleplayer)"};
 cvar_t nehx02 = {0, "nehx02", "0", "nehahra data storage cvar (used in singleplayer)"};
@@ -104,12 +145,6 @@ cvar_t nehx18 = {0, "nehx18", "0", "nehahra data storage cvar (used in singlepla
 cvar_t nehx19 = {0, "nehx19", "0", "nehahra data storage cvar (used in singleplayer)"};
 cvar_t cutscene = {0, "cutscene", "1", "enables cutscenes in nehahra, can be used by other mods"};
 
-// TODO: move these cvars here
-extern cvar_t sv_clmovement_enable;
-extern cvar_t sv_clmovement_minping;
-extern cvar_t sv_clmovement_minping_disabletime;
-extern cvar_t sv_clmovement_waitforinput;
-
 server_t sv;
 server_static_t svs;
 
@@ -260,70 +295,98 @@ void SV_Init (void)
        Cmd_AddCommand("sv_areastats", SV_AreaStats_f, "prints statistics on entity culling during collision traces");
        Cmd_AddCommand_WithClientCommand("sv_startdownload", NULL, SV_StartDownload_f, "begins sending a file to the client (network protocol use only)");
        Cmd_AddCommand_WithClientCommand("download", NULL, SV_Download_f, "downloads a specified file from the server");
-       Cvar_RegisterVariable (&sv_maxvelocity);
-       Cvar_RegisterVariable (&sv_gravity);
-       Cvar_RegisterVariable (&sv_friction);
-       Cvar_RegisterVariable (&sv_waterfriction);
-       Cvar_RegisterVariable (&sv_edgefriction);
-       Cvar_RegisterVariable (&sv_stopspeed);
-       Cvar_RegisterVariable (&sv_maxspeed);
-       Cvar_RegisterVariable (&sv_maxairspeed);
+
+       Cvar_RegisterVariable (&coop);
+       Cvar_RegisterVariable (&deathmatch);
+       Cvar_RegisterVariable (&fraglimit);
+       Cvar_RegisterVariable (&gamecfg);
+       Cvar_RegisterVariable (&noexit);
+       Cvar_RegisterVariable (&nomonsters);
+       Cvar_RegisterVariable (&pausable);
+       Cvar_RegisterVariable (&pr_checkextension);
+       Cvar_RegisterVariable (&samelevel);
+       Cvar_RegisterVariable (&skill);
+       Cvar_RegisterVariable (&slowmo);
        Cvar_RegisterVariable (&sv_accelerate);
-       Cvar_RegisterVariable (&sv_airaccelerate);
-       Cvar_RegisterVariable (&sv_wateraccelerate);
-       Cvar_RegisterVariable (&sv_jumpvelocity);
+       Cvar_RegisterVariable (&sv_aim);
        Cvar_RegisterVariable (&sv_airaccel_qw);
        Cvar_RegisterVariable (&sv_airaccel_sideways_friction);
+       Cvar_RegisterVariable (&sv_airaccelerate);
+       Cvar_RegisterVariable (&sv_allowdownloads);
+       Cvar_RegisterVariable (&sv_allowdownloads_archive);
+       Cvar_RegisterVariable (&sv_allowdownloads_config);
+       Cvar_RegisterVariable (&sv_allowdownloads_dlcache);
+       Cvar_RegisterVariable (&sv_allowdownloads_inarchive);
+       Cvar_RegisterVariable (&sv_areagrid_mingridsize);
+       Cvar_RegisterVariable (&sv_checkforpacketsduringsleep);
        Cvar_RegisterVariable (&sv_clmovement_enable);
        Cvar_RegisterVariable (&sv_clmovement_minping);
        Cvar_RegisterVariable (&sv_clmovement_minping_disabletime);
        Cvar_RegisterVariable (&sv_clmovement_waitforinput);
-       Cvar_RegisterVariable (&sv_idealpitchscale);
-       Cvar_RegisterVariable (&sv_aim);
-       Cvar_RegisterVariable (&sv_nostep);
+       Cvar_RegisterVariable (&sv_cullentities_nevercullbmodels);
        Cvar_RegisterVariable (&sv_cullentities_pvs);
+       Cvar_RegisterVariable (&sv_cullentities_stats);
        Cvar_RegisterVariable (&sv_cullentities_trace);
-       Cvar_RegisterVariable (&sv_cullentities_trace_samples);
-       Cvar_RegisterVariable (&sv_cullentities_trace_samples_extra);
-       Cvar_RegisterVariable (&sv_cullentities_trace_enlarge);
        Cvar_RegisterVariable (&sv_cullentities_trace_delay);
+       Cvar_RegisterVariable (&sv_cullentities_trace_enlarge);
        Cvar_RegisterVariable (&sv_cullentities_trace_prediction);
-       Cvar_RegisterVariable (&sv_cullentities_nevercullbmodels);
-       Cvar_RegisterVariable (&sv_cullentities_stats);
+       Cvar_RegisterVariable (&sv_cullentities_trace_samples);
+       Cvar_RegisterVariable (&sv_cullentities_trace_samples_extra);
+       Cvar_RegisterVariable (&sv_debugmove);
+       Cvar_RegisterVariable (&sv_echobprint);
+       Cvar_RegisterVariable (&sv_edgefriction);
        Cvar_RegisterVariable (&sv_entpatch);
+       Cvar_RegisterVariable (&sv_fixedframeratesingleplayer);
+       Cvar_RegisterVariable (&sv_freezenonclients);
+       Cvar_RegisterVariable (&sv_friction);
+       Cvar_RegisterVariable (&sv_gameplayfix_blowupfallenzombies);
+       Cvar_RegisterVariable (&sv_gameplayfix_droptofloorstartsolid);
+       Cvar_RegisterVariable (&sv_gameplayfix_findradiusdistancetobox);
        Cvar_RegisterVariable (&sv_gameplayfix_grenadebouncedownslopes);
        Cvar_RegisterVariable (&sv_gameplayfix_noairborncorpse);
+       Cvar_RegisterVariable (&sv_gameplayfix_qwplayerphysics);
+       Cvar_RegisterVariable (&sv_gameplayfix_setmodelrealbox);
        Cvar_RegisterVariable (&sv_gameplayfix_stepdown);
        Cvar_RegisterVariable (&sv_gameplayfix_stepwhilejumping);
        Cvar_RegisterVariable (&sv_gameplayfix_swiminbmodels);
-       Cvar_RegisterVariable (&sv_gameplayfix_setmodelrealbox);
-       Cvar_RegisterVariable (&sv_gameplayfix_blowupfallenzombies);
-       Cvar_RegisterVariable (&sv_gameplayfix_findradiusdistancetobox);
-       Cvar_RegisterVariable (&sv_gameplayfix_qwplayerphysics);
        Cvar_RegisterVariable (&sv_gameplayfix_upwardvelocityclearsongroundflag);
-       Cvar_RegisterVariable (&sv_gameplayfix_droptofloorstartsolid);
-       Cvar_RegisterVariable (&sv_protocolname);
-       Cvar_RegisterVariable (&sv_ratelimitlocalplayer);
+       Cvar_RegisterVariable (&sv_gravity);
+       Cvar_RegisterVariable (&sv_idealpitchscale);
+       Cvar_RegisterVariable (&sv_jumpstep);
+       Cvar_RegisterVariable (&sv_jumpvelocity);
+       Cvar_RegisterVariable (&sv_maxairspeed);
        Cvar_RegisterVariable (&sv_maxrate);
-       Cvar_RegisterVariable (&sv_allowdownloads);
-       Cvar_RegisterVariable (&sv_allowdownloads_inarchive);
-       Cvar_RegisterVariable (&sv_allowdownloads_archive);
-       Cvar_RegisterVariable (&sv_allowdownloads_config);
-       Cvar_RegisterVariable (&sv_allowdownloads_dlcache);
+       Cvar_RegisterVariable (&sv_maxspeed);
+       Cvar_RegisterVariable (&sv_maxvelocity);
+       Cvar_RegisterVariable (&sv_newflymove);
+       Cvar_RegisterVariable (&sv_nostep);
+       Cvar_RegisterVariable (&sv_playerphysicsqc);
        Cvar_RegisterVariable (&sv_progs);
+       Cvar_RegisterVariable (&sv_protocolname);
+       Cvar_RegisterVariable (&sv_random_seed);
+       Cvar_RegisterVariable (&sv_ratelimitlocalplayer);
+       Cvar_RegisterVariable (&sv_sound_land);
+       Cvar_RegisterVariable (&sv_sound_watersplash);
+       Cvar_RegisterVariable (&sv_stepheight);
+       Cvar_RegisterVariable (&sv_stopspeed);
+       Cvar_RegisterVariable (&sv_wallfriction);
+       Cvar_RegisterVariable (&sv_wateraccelerate);
+       Cvar_RegisterVariable (&sv_waterfriction);
+       Cvar_RegisterVariable (&sys_ticrate);
+       Cvar_RegisterVariable (&teamplay);
+       Cvar_RegisterVariable (&timelimit);
 
-       Cvar_RegisterVariable (&pr_checkextension);
-       Cvar_RegisterVariable (&nomonsters);
-       Cvar_RegisterVariable (&gamecfg);
-       Cvar_RegisterVariable (&scratch1);
-       Cvar_RegisterVariable (&scratch2);
-       Cvar_RegisterVariable (&scratch3);
-       Cvar_RegisterVariable (&scratch4);
-       Cvar_RegisterVariable (&savedgamecfg);
        Cvar_RegisterVariable (&saved1);
        Cvar_RegisterVariable (&saved2);
        Cvar_RegisterVariable (&saved3);
        Cvar_RegisterVariable (&saved4);
+       Cvar_RegisterVariable (&savedgamecfg);
+       Cvar_RegisterVariable (&scratch1);
+       Cvar_RegisterVariable (&scratch2);
+       Cvar_RegisterVariable (&scratch3);
+       Cvar_RegisterVariable (&scratch4);
+       Cvar_RegisterVariable (&temp1);
+
        // LordHavoc: Nehahra uses these to pass data around cutscene demos
        if (gamemode == GAME_NEHAHRA)
        {
@@ -350,8 +413,6 @@ void SV_Init (void)
        }
        Cvar_RegisterVariable (&cutscene); // for Nehahra but useful to other mods as well
 
-       SV_Phys_Init();
-
        sv_mempool = Mem_AllocPool("server", 0, NULL);
 }
 
index dd85b9b497bae616056be4948cea73ff4cb1c87f..8de8f7eaeac7fe72555dbb088d4d37a7fff4c4fd 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -39,39 +39,10 @@ solid_edge items only clip against bsp models.
 
 */
 
-cvar_t sv_gravity = {CVAR_NOTIFY, "sv_gravity","800", "how fast you fall (512 = roughly earth gravity)"};
-cvar_t sv_maxvelocity = {CVAR_NOTIFY, "sv_maxvelocity","2000", "universal speed limit on all entities"};
-cvar_t sv_nostep = {CVAR_NOTIFY, "sv_nostep","0", "prevents MOVETYPE_STEP entities (monsters) from moving"};
-cvar_t sv_jumpstep = {CVAR_NOTIFY, "sv_jumpstep", "0", "whether you can step up while jumping (sv_gameplayfix_stepwhilejumping must also be 1)"};
-cvar_t sv_newflymove = {CVAR_NOTIFY, "sv_newflymove", "0", "enables simpler/buggier player physics (not recommended)"};
-cvar_t sv_freezenonclients = {CVAR_NOTIFY, "sv_freezenonclients", "0", "freezes time, except for players, allowing you to walk around and take screenshots of explosions"};
-cvar_t sv_playerphysicsqc = {CVAR_NOTIFY, "sv_playerphysicsqc", "1", "enables QuakeC function to override player physics"};
-cvar_t sv_debugmove = {CVAR_NOTIFY, "sv_debugmove", "0", "disables collision detection optimizations for debugging purposes"};
-
-cvar_t sv_sound_watersplash = {0, "sv_sound_watersplash", "misc/h2ohit1.wav", "sound to play when MOVETYPE_FLY/TOSS/BOUNCE/STEP entity enters or leaves water (empty cvar disables the sound)"};
-cvar_t sv_sound_land = {0, "sv_sound_land", "demon/dland2.wav", "sound to play when MOVETYPE_STEP entity hits the ground at high speed (empty cvar disables the sound)"};
-
-// TODO: move this extern to server.h
-extern cvar_t sv_clmovement_waitforinput;
-
 #define        MOVE_EPSILON    0.01
 
 void SV_Physics_Toss (prvm_edict_t *ent);
 
-void SV_Phys_Init (void)
-{
-       Cvar_RegisterVariable(&sv_stepheight);
-       Cvar_RegisterVariable(&sv_jumpstep);
-       Cvar_RegisterVariable(&sv_wallfriction);
-       Cvar_RegisterVariable(&sv_newflymove);
-       Cvar_RegisterVariable(&sv_freezenonclients);
-       Cvar_RegisterVariable(&sv_playerphysicsqc);
-       Cvar_RegisterVariable(&sv_debugmove);
-
-       Cvar_RegisterVariable(&sv_sound_watersplash);
-       Cvar_RegisterVariable(&sv_sound_land);
-}
-
 /*
 ===============================================================================
 
index 9032cf0437d1ec8481fedf939eb97e9e08d33a12..ee039d136525a59baee3e3303eba6b3cacca8387 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -22,29 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "quakedef.h"
 #define DEBUGMOVES 0
 
-cvar_t sv_wallfriction = {CVAR_NOTIFY, "sv_wallfriction", "1", "how much you slow down when sliding along a wall"};
-cvar_t sv_stepheight = {CVAR_NOTIFY, "sv_stepheight", "18", "how high you can step up (TW_SV_STEPCONTROL extension)"};
-cvar_t sv_stopspeed = {CVAR_NOTIFY, "sv_stopspeed","100", "how fast you come to a complete stop"};
-cvar_t sv_friction = {CVAR_NOTIFY, "sv_friction","4", "how fast you slow down"};
-cvar_t sv_waterfriction = {CVAR_NOTIFY, "sv_waterfriction","-1", "how fast you slow down, if less than 0 the sv_friction variable is used instead"};
-cvar_t sv_edgefriction = {0, "edgefriction", "2", "how much you slow down when nearing a ledge you might fall off"};
-cvar_t sv_idealpitchscale = {0, "sv_idealpitchscale","0.8", "how much to look up/down slopes and stairs when not using freelook"};
-cvar_t sv_maxspeed = {CVAR_NOTIFY, "sv_maxspeed", "320", "maximum speed a player can accelerate to when on ground (can be exceeded by tricks)"};
-cvar_t sv_maxairspeed = {0, "sv_maxairspeed", "30", "maximum speed a player can accelerate to when airborn (note that it is possible to completely stop by moving the opposite direction)"};
-cvar_t sv_accelerate = {0, "sv_accelerate", "10", "rate at which a player accelerates to sv_maxspeed"};
-cvar_t sv_airaccelerate = {0, "sv_airaccelerate", "-1", "rate at which a player accelerates to sv_maxairspeed while in the air, if less than 0 the sv_accelerate variable is used instead"};
-cvar_t sv_wateraccelerate = {0, "sv_wateraccelerate", "-1", "rate at which a player accelerates to sv_maxspeed while in the air, if less than 0 the sv_accelerate variable is used instead"};
-cvar_t sv_jumpvelocity = {0, "sv_jumpvelocity", "270", "cvar that can be used by QuakeC code for jump velocity"};
-cvar_t sv_airaccel_qw = {0, "sv_airaccel_qw", "1", "ratio of QW-style air control as opposed to simple acceleration"};
-cvar_t sv_airaccel_sideways_friction = {0, "sv_airaccel_sideways_friction", "", "anti-sideways movement stabilization (reduces speed gain when zigzagging)"};
-cvar_t sv_clmovement_enable = {0, "sv_clmovement_enable", "1", "whether to allow clients to use cl_movement prediction, which can cause choppy movement on the server which may annoy other players"};
-cvar_t sv_clmovement_minping = {0, "sv_clmovement_minping", "0", "if client ping is below this time in milliseconds, then their ability to use cl_movement prediction is disabled for a while (as they don't need it)"};
-cvar_t sv_clmovement_minping_disabletime = {0, "sv_clmovement_minping_disabletime", "1000", "when client falls below minping, disable their prediction for this many milliseconds (should be at least 1000 or else their prediction may turn on/off frequently)"};
-cvar_t sv_clmovement_waitforinput = {0, "sv_clmovement_waitforinput", "16", "when a client does not send input for this many frames, force them to move anyway (unlike QuakeWorld)"};
-
 static usercmd_t cmd;
 
-
 /*
 ===============
 SV_SetIdealPitch
@@ -388,7 +367,6 @@ the move fields specify an intended velocity in pix/sec
 the angle fields specify an exact angular motion in degrees
 ===================
 */
-extern cvar_t sv_playerphysicsqc;
 void SV_ClientThink (void)
 {
        vec3_t v_angle;
index f47c05b091013258abc24df0ae97e5b2157164f8..2b936116acc1b5fbc90424019df7866b05f435e4 100644 (file)
@@ -3,7 +3,6 @@
 //============================================================================
 // Server
 
-cvar_t sv_aim = {CVAR_SAVE, "sv_aim", "2", "maximum cosine angle for quake's vertical autoaim, a value above 1 completely disables the autoaim, quake used 0.93"};
 
 
 char *vm_sv_extensions =
diff --git a/world.c b/world.c
index 07a614d66c05d39c308ab0a7bbfe01ec06a5b235..1340079650afed31b6332079979486330ed8270a 100644 (file)
--- a/world.c
+++ b/world.c
@@ -29,11 +29,8 @@ line of sight checks trace->inopen and trace->inwater, but bullets don't
 
 */
 
-cvar_t sv_areagrid_mingridsize = {CVAR_NOTIFY, "sv_areagrid_mingridsize", "64", "minimum areagrid cell size, smaller values work better for lots of small objects, higher values for large objects"};
-
 void World_Init(void)
 {
-       Cvar_RegisterVariable(&sv_areagrid_mingridsize);
        Collision_Init();
 }