02 Aug 2008
This commit is contained in:
parent
89286b5444
commit
8e0617c350
|
@ -219,8 +219,8 @@ void CL_ParseFrame( sizebuf_t *msg )
|
|||
frame_t *old;
|
||||
|
||||
memset( &cl.frame, 0, sizeof(cl.frame));
|
||||
cl.frame.serverframe = MSG_ReadLong (msg);
|
||||
cl.frame.deltaframe = MSG_ReadLong (msg);
|
||||
cl.frame.serverframe = MSG_ReadLong( msg );
|
||||
cl.frame.deltaframe = MSG_ReadLong( msg );
|
||||
cl.frame.servertime = cl.frame.serverframe * Host_FrameTime();
|
||||
cl.surpressCount = MSG_ReadByte( msg );
|
||||
|
||||
|
@ -320,10 +320,10 @@ void CL_AddPacketEntities( frame_t *frame )
|
|||
uint effects, renderfx;
|
||||
|
||||
// bonus items rotate at a fixed rate
|
||||
autorotate = anglemod(cl.time/10);
|
||||
autorotate = anglemod( cl.time / 10 );
|
||||
|
||||
// brush models can auto animate their frames
|
||||
autoanim = 2 * cl.time/1000;
|
||||
autoanim = 2 * cl.time / 1000;
|
||||
|
||||
memset( &refent, 0, sizeof(refent));
|
||||
|
||||
|
@ -344,7 +344,7 @@ void CL_AddPacketEntities( frame_t *frame )
|
|||
|
||||
// copy state to render
|
||||
refent.prev.frame = ent->priv.cl->prev.model.frame;
|
||||
refent.backlerp = 1.0 - cl.lerpfrac;
|
||||
refent.backlerp = 1.0f - cl.lerpfrac;
|
||||
refent.alpha = s1->renderamt;
|
||||
refent.body = s1->model.body;
|
||||
refent.sequence = s1->model.sequence;
|
||||
|
@ -480,11 +480,7 @@ void CL_CalcViewValues( void )
|
|||
cl.time = cl.frame.servertime - Host_FrameTime();
|
||||
cl.lerpfrac = 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
cl.lerpfrac = 1.0 - (cl.frame.servertime - cl.time) * 0.01f;
|
||||
//Msg("cl.lerpfrac %g\n", cl.lerpfrac );
|
||||
}
|
||||
else cl.lerpfrac = 1.0 - (cl.frame.servertime - cl.time) * 0.01f;
|
||||
|
||||
// find the previous frame to interpolate from
|
||||
ps = &cl.frame.ps;
|
||||
|
|
|
@ -62,13 +62,13 @@ void CL_RunLightStyles (void)
|
|||
clightstyle_t *ls;
|
||||
int i;
|
||||
|
||||
ofs = cl.time / Host_FrameTime();
|
||||
ofs = cl.time / 100;
|
||||
if( ofs == lastofs ) return;
|
||||
lastofs = ofs;
|
||||
|
||||
for( i = 0, ls = cl_lightstyle; i < MAX_LIGHTSTYLES; i++, ls++)
|
||||
{
|
||||
if (!ls->length)
|
||||
if( !ls->length )
|
||||
{
|
||||
ls->value[0] = ls->value[1] = ls->value[2] = 1.0;
|
||||
continue;
|
||||
|
@ -81,8 +81,8 @@ void CL_RunLightStyles (void)
|
|||
|
||||
void CL_SetLightstyle( int i )
|
||||
{
|
||||
char *s;
|
||||
int j, k;
|
||||
char *s;
|
||||
int j, k;
|
||||
|
||||
s = cl.configstrings[i+CS_LIGHTS];
|
||||
j = com.strlen( s );
|
||||
|
|
|
@ -413,17 +413,17 @@ void V_RenderView( void )
|
|||
|
||||
// never let it sit exactly on a node line, because a water plane can
|
||||
// dissapear when viewed with the eye exactly on it.
|
||||
// the server protocol only specifies to 1/8 pixel, so add 1/16 in each axis
|
||||
cl.refdef.vieworg[0] += 1.0/16;
|
||||
cl.refdef.vieworg[1] += 1.0/16;
|
||||
cl.refdef.vieworg[2] += 1.0/16;
|
||||
// the server protocol only specifies to 1/16 pixel, so add 1/32 in each axis
|
||||
cl.refdef.vieworg[0] += 1.0 / 32;
|
||||
cl.refdef.vieworg[1] += 1.0 / 32;
|
||||
cl.refdef.vieworg[2] += 1.0 / 32;
|
||||
|
||||
cl.refdef.x = scr_vrect.x;
|
||||
cl.refdef.y = scr_vrect.y;
|
||||
cl.refdef.width = scr_vrect.width;
|
||||
cl.refdef.height = scr_vrect.height;
|
||||
cl.refdef.fov_y = V_CalcFov (cl.refdef.fov_x, cl.refdef.width, cl.refdef.height);
|
||||
cl.refdef.time = cl.time * 0.001f; // render use realtime now
|
||||
cl.refdef.time = cls.realtime * 0.001f; // render use realtime now
|
||||
|
||||
cl.refdef.areabits = cl.frame.areabits;
|
||||
|
||||
|
|
|
@ -1919,6 +1919,11 @@ static void Cvar_LookupBitInfo(const char *name, const char *string, const char
|
|||
Info_SetValueForKey((char *)info, (char *)name, (char *)string);
|
||||
}
|
||||
|
||||
static void Cvar_LookupLatched( const char *name, const char *string, const char *latched, void *unused )
|
||||
{
|
||||
Cvar_SetLatched( name, string );
|
||||
}
|
||||
|
||||
char *Cvar_Userinfo (void)
|
||||
{
|
||||
sv_info[0] = 0; // clear previous calls
|
||||
|
|
|
@ -30,13 +30,14 @@ cvar_t *host_frametime;
|
|||
cvar_t *host_cheats;
|
||||
cvar_t *host_maxfps;
|
||||
cvar_t *host_maxclients;
|
||||
cvar_t *host_registered;
|
||||
cvar_t *r_fullscreen;
|
||||
cvar_t *r_xpos; // X coordinate of window position
|
||||
cvar_t *r_ypos; // Y coordinate of window position
|
||||
cvar_t *vid_gamma;
|
||||
|
||||
// these cvars will be duplicated on each client across network
|
||||
int Host_FrameTime( void ) { return (int)(bound( 1, Cvar_VariableValue( "host_frametime" ) * 1000, 100 )); }
|
||||
int Host_FrameTime( void ) { return (int)(bound( 10, Cvar_VariableValue( "host_frametime" ) * 1000, 100 )); }
|
||||
int Host_ServerState( void ) { return (int)Cvar_VariableValue( "host_serverstate" ); }
|
||||
int Host_MaxClients( void ) { return (int)bound( 1, Cvar_VariableValue( "host_maxclients" ), 255 ); }
|
||||
|
||||
|
@ -744,11 +745,12 @@ void Host_Init( int argc, char **argv)
|
|||
Cmd_AddCommand ("crash", Host_Crash_f, "a way to force a bus error for development reasons");
|
||||
}
|
||||
|
||||
host_cheats = Cvar_Get("host_cheats", "1", CVAR_SYSTEMINFO, "allow cheat variables to enable" );
|
||||
host_cheats = Cvar_Get( "host_cheats", "1", CVAR_SYSTEMINFO, "allow cheat variables to enable" );
|
||||
host_maxfps = Cvar_Get( "host_maxfps", "100", CVAR_ARCHIVE, "host fps upper limit" );
|
||||
host_frametime = Cvar_Get ("host_frametime", "0.1", CVAR_SERVERINFO, "host frametime" );
|
||||
host_maxclients = Cvar_Get ("host_maxclients", "1", CVAR_SERVERINFO|CVAR_LATCH, "server maxplayers limit" );
|
||||
host_serverstate = Cvar_Get ("host_serverstate", "0", CVAR_SERVERINFO, "displays current server state" );
|
||||
host_frametime = Cvar_Get("host_frametime", "0.1", CVAR_SERVERINFO, "host frametime (only for test!)" );
|
||||
host_maxclients = Cvar_Get("host_maxclients", "1", CVAR_SERVERINFO|CVAR_LATCH, "server maxplayers limit" );
|
||||
host_serverstate = Cvar_Get("host_serverstate", "0", CVAR_SERVERINFO, "displays current server state" );
|
||||
host_registered = Cvar_Get( "registered", "1", CVAR_SYSTEMINFO, "indicate shareware version of game" );
|
||||
timescale = Cvar_Get ("timescale", "1", 0, "physics world timescale" );
|
||||
|
||||
s = va("^1Xash %g ^3%s", GI->version, buildstring );
|
||||
|
|
|
@ -77,7 +77,6 @@ typedef struct server_s
|
|||
|
||||
float time; // always sv.framenum * 50 msec
|
||||
float frametime;
|
||||
dword timeleft;
|
||||
int framenum;
|
||||
|
||||
char name[MAX_QPATH]; // map name, or cinematic name
|
||||
|
@ -217,6 +216,7 @@ typedef struct
|
|||
{
|
||||
bool initialized; // sv_init has completed
|
||||
dword realtime; // always increasing, no clamping, etc
|
||||
dword timeleft;
|
||||
|
||||
string mapcmd; // ie: *intro.cin+base
|
||||
string comment; // map name, e.t.c.
|
||||
|
|
|
@ -95,7 +95,7 @@ void SV_DirectConnect( netadr_t from )
|
|||
if( cl->state == cs_free ) continue;
|
||||
if( NET_CompareBaseAdr(from, cl->netchan.remote_address) && (cl->netchan.qport == qport || from.port == cl->netchan.remote_address.port))
|
||||
{
|
||||
if(( svs.realtime - cl->lastconnect ) < (sv_reconnect_limit->integer * 1000 ))
|
||||
if(!NET_IsLocalAddress( from ) && (svs.realtime - cl->lastconnect) < (sv_reconnect_limit->integer * 1000))
|
||||
{
|
||||
MsgDev( D_INFO, "%s:reconnect rejected : too soon\n", NET_AdrToString( from ));
|
||||
return;
|
||||
|
@ -248,6 +248,8 @@ void SV_DropClient( sv_client_t *drop )
|
|||
|
||||
if( drop->state == cs_zombie ) return; // already dropped
|
||||
|
||||
SV_VM_Begin();
|
||||
|
||||
// add the disconnect
|
||||
MSG_WriteByte( &drop->netchan.message, svc_disconnect );
|
||||
|
||||
|
@ -1013,10 +1015,10 @@ void SV_ApplyClientMove( sv_client_t *cl, usercmd_t *cmd )
|
|||
|
||||
// set the edict fields
|
||||
ent->progs.sv->button0 = cmd->buttons & 1;
|
||||
ent->progs.sv->button2 = (cmd->buttons & 2)>>1;
|
||||
ent->progs.sv->button1 = (cmd->upmove < 0) ? 1 : 0;
|
||||
ent->progs.sv->button2 = (cmd->upmove > 0) ? 1 : 0;
|
||||
if( cmd->impulse ) ent->progs.sv->impulse = cmd->impulse;
|
||||
// only send the impulse to qc once
|
||||
cmd->impulse = 0;
|
||||
cmd->impulse = 0; // only send the impulse to qc once
|
||||
|
||||
// circularly clamp the angles with deltas
|
||||
for( i = 0; i < 3; i++ )
|
||||
|
@ -1280,7 +1282,7 @@ void SV_ClientThink( sv_client_t *cl, usercmd_t *cmd )
|
|||
vec3_t v_angle;
|
||||
|
||||
cl->cmd = *cmd;
|
||||
//cl->skipframes = 0;
|
||||
cl->skipframes = 0;
|
||||
|
||||
// may have been kicked during the last usercmd
|
||||
if( sv_paused->integer ) return;
|
||||
|
|
|
@ -157,7 +157,7 @@ void SV_SpawnServer( char *server, char *savename, sv_state_t serverstate )
|
|||
// wipe the entire per-level structure
|
||||
memset (&sv, 0, sizeof(sv));
|
||||
svs.realtime = 0;
|
||||
sv.timeleft = 0;
|
||||
svs.timeleft = 0;
|
||||
|
||||
// save name for levels that don't set message
|
||||
com.strcpy (sv.configstrings[CS_NAME], server);
|
||||
|
@ -267,6 +267,7 @@ void SV_InitGame( void )
|
|||
CL_Drop();
|
||||
}
|
||||
|
||||
Cmd_ExecuteString( "latch\n" );
|
||||
svs.initialized = true;
|
||||
|
||||
if (Cvar_VariableValue ("coop") && Cvar_VariableValue ("deathmatch"))
|
||||
|
|
|
@ -45,7 +45,7 @@ SV_CalcPings
|
|||
Updates the cl->ping variables
|
||||
===================
|
||||
*/
|
||||
void SV_CalcPings (void)
|
||||
void SV_CalcPings( void )
|
||||
{
|
||||
int i, j;
|
||||
sv_client_t *cl;
|
||||
|
@ -126,10 +126,6 @@ void SV_PacketEvent( netadr_t from, sizebuf_t *msg )
|
|||
break;
|
||||
}
|
||||
if( i != Host_MaxClients()) return;
|
||||
|
||||
// if we received a sequenced packet from an address we don't recognize,
|
||||
// send an out of band disconnect packet to it
|
||||
Netchan_OutOfBandPrint( NS_SERVER, from, "disconnect\n" );
|
||||
SV_VM_End();
|
||||
}
|
||||
|
||||
|
@ -157,14 +153,12 @@ void SV_CheckTimeouts( void )
|
|||
zombiepoint = svs.realtime - 1000 * zombietime->value;
|
||||
|
||||
if( host_frametime->modified )
|
||||
Cvar_SetValue( "host_frametime", bound( 0.001f, host_frametime->value, 0.1f ));
|
||||
Cvar_SetValue( "host_frametime", bound( 0.01f, host_frametime->value, 0.1f ));
|
||||
|
||||
for( i = 0, cl = svs.clients; i < Host_MaxClients(); i++, cl++ )
|
||||
{
|
||||
// message times may be wrong across a changelevel
|
||||
if( cl->lastmessage > svs.realtime )
|
||||
cl->lastmessage = svs.realtime;
|
||||
|
||||
if( cl->lastmessage > svs.realtime ) cl->lastmessage = svs.realtime;
|
||||
if( cl->state == cs_zombie && cl->lastmessage < zombiepoint )
|
||||
{
|
||||
cl->state = cs_free; // can now be reused
|
||||
|
@ -172,7 +166,7 @@ void SV_CheckTimeouts( void )
|
|||
}
|
||||
if(( cl->state == cs_connected || cl->state == cs_spawned) && cl->lastmessage < droppoint )
|
||||
{
|
||||
SV_BroadcastPrintf (PRINT_CONSOLE, "%s timed out\n", cl->name );
|
||||
SV_BroadcastPrintf( PRINT_CONSOLE, "%s timed out\n", cl->name );
|
||||
SV_DropClient( cl );
|
||||
cl->state = cs_free; // don't bother with zombie state
|
||||
}
|
||||
|
@ -190,6 +184,8 @@ void SV_RunGameFrame (void)
|
|||
if( sv_paused->integer && Host_MaxClients() == 1 )
|
||||
return;
|
||||
|
||||
if( sv.state != ss_active ) return;
|
||||
|
||||
// we always need to bump framenum, even if we
|
||||
// don't run the world, otherwise the delta
|
||||
// compression can get confused when a client
|
||||
|
@ -219,18 +215,14 @@ void SV_Frame( dword time )
|
|||
// if server is not active, do nothing
|
||||
if( !svs.initialized ) return;
|
||||
svs.realtime += time;
|
||||
svs.timeleft += sv_paused->integer ? 0 : time;
|
||||
|
||||
// keep the random time dependent
|
||||
rand ();
|
||||
|
||||
// setup the VM frame
|
||||
SV_VM_Begin();
|
||||
|
||||
// check timeouts
|
||||
SV_CheckTimeouts ();
|
||||
|
||||
if( !sv_playersonly->integer ) pe->Frame( sv.frametime );
|
||||
|
||||
// move autonomous things around if enough time has passed
|
||||
if( svs.realtime < (sv.time * 1000))
|
||||
{
|
||||
|
@ -242,10 +234,12 @@ void SV_Frame( dword time )
|
|||
}
|
||||
|
||||
NET_Sleep((sv.time*1000) - svs.realtime);
|
||||
SV_VM_End(); //end frame
|
||||
return;
|
||||
}
|
||||
|
||||
// setup the VM frame
|
||||
SV_VM_Begin();
|
||||
|
||||
// update ping based on the last known frame from all clients
|
||||
SV_CalcPings ();
|
||||
|
||||
|
@ -360,10 +354,10 @@ void SV_Init (void)
|
|||
Cvar_Get ("timelimit", "0", CVAR_SERVERINFO, "multiplayer timelimit" );
|
||||
Cvar_Get ("protocol", va("%i", PROTOCOL_VERSION), CVAR_SERVERINFO|CVAR_INIT, "displays server protocol version" );
|
||||
|
||||
sv_fps = Cvar_Get( "sv_fps", "60", CVAR_ARCHIVE, "running server at" );
|
||||
sv_fps = Cvar_Get( "sv_fps", "60", CVAR_ARCHIVE, "running physics engine at" );
|
||||
sv_stepheight = Cvar_Get( "sv_stepheight", "18", CVAR_ARCHIVE|CVAR_LATCH, "how high you can step up" );
|
||||
sv_playersonly = Cvar_Get( "playersonly", "0", 0, "freezes time, except for players" );
|
||||
hostname = Cvar_Get ("hostname", "unnamed", CVAR_SERVERINFO | CVAR_ARCHIVE, "host name" );
|
||||
hostname = Cvar_Get ("sv_hostname", "unnamed", CVAR_SERVERINFO | CVAR_ARCHIVE, "host name" );
|
||||
timeout = Cvar_Get ("timeout", "125", 0, "connection timeout" );
|
||||
zombietime = Cvar_Get ("zombietime", "2", 0, "timeout for clients-zombie (who died but not respawned)" );
|
||||
sv_paused = Cvar_Get ("paused", "0", 0, "server pause" );
|
||||
|
|
|
@ -1751,6 +1751,8 @@ void SV_Physics( void )
|
|||
{
|
||||
int i;
|
||||
edict_t *ent;
|
||||
int frametime = 1000 / sv_fps->integer;
|
||||
int num_physframes = 0;
|
||||
|
||||
// let the progs know that a new frame has started
|
||||
prog->globals.sv->pev = PRVM_EDICT_TO_PROG(prog->edicts);
|
||||
|
@ -1770,6 +1772,13 @@ void SV_Physics( void )
|
|||
else if(!sv_playersonly->integer)SV_Physics_Entity( ent );
|
||||
}
|
||||
|
||||
// let everything in the world think and move
|
||||
while( svs.timeleft >= frametime )
|
||||
{
|
||||
svs.timeleft -= frametime;
|
||||
pe->Frame( frametime * 0.001f );
|
||||
num_physframes++;
|
||||
}
|
||||
prog->globals.sv->pev = PRVM_EDICT_TO_PROG(prog->edicts);
|
||||
prog->globals.sv->other = PRVM_EDICT_TO_PROG(prog->edicts);
|
||||
prog->globals.sv->time = sv.time;
|
||||
|
|
|
@ -1645,29 +1645,30 @@ void PF_tracebox( void )
|
|||
mask = (int)PRVM_G_FLOAT(OFS_PARM4);
|
||||
ent = PRVM_G_EDICT(OFS_PARM5);
|
||||
|
||||
if(mask == 1) mask = MASK_SOLID;
|
||||
else if(mask == 2) mask = MASK_SHOT;
|
||||
else if(mask == 3) mask = MASK_MONSTERSOLID;
|
||||
else if(mask == 4) mask = MASK_WATER;
|
||||
if( mask == 1 ) mask = MASK_SOLID;
|
||||
else if( mask == 2 ) mask = MASK_SHOT;
|
||||
else if( mask == 3 ) mask = MASK_MONSTERSOLID;
|
||||
else if( mask == 4 ) mask = MASK_PLAYERSOLID;
|
||||
else if( mask == 5 ) mask = MASK_WATER;
|
||||
else mask = MASK_ALL;
|
||||
|
||||
if (IS_NAN(v1[0]) || IS_NAN(v1[1]) || IS_NAN(v1[2]) || IS_NAN(v2[0]) || IS_NAN(v1[2]) || IS_NAN(v2[2]))
|
||||
PRVM_ERROR("%s: NAN errors detected in tracebox('%f %f %f', '%f %f %f', '%f %f %f', '%f %f %f', %i, entity %i)\n",
|
||||
PRVM_NAME, v1[0], v1[1], v1[2], m1[0], m1[1], m1[2], m2[0], m2[1], m2[2], v2[0], v2[1], v2[2], mask, PRVM_EDICT_TO_PROG(ent));
|
||||
|
||||
trace = SV_Trace (v1, m1, m2, v2, MOVE_NORMAL, ent, mask );
|
||||
trace = SV_Trace( v1, m1, m2, v2, MOVE_NORMAL, ent, mask );
|
||||
|
||||
prog->globals.sv->trace_allsolid = trace.allsolid;
|
||||
prog->globals.sv->trace_startsolid = trace.startsolid;
|
||||
prog->globals.sv->trace_fraction = trace.fraction;
|
||||
prog->globals.sv->trace_contents = trace.contents;
|
||||
|
||||
VectorCopy (trace.endpos, prog->globals.sv->trace_endpos);
|
||||
VectorCopy (trace.plane.normal, prog->globals.sv->trace_plane_normal);
|
||||
VectorCopy( trace.endpos, prog->globals.sv->trace_endpos );
|
||||
VectorCopy( trace.plane.normal, prog->globals.sv->trace_plane_normal );
|
||||
prog->globals.sv->trace_plane_dist = trace.plane.dist;
|
||||
|
||||
if (trace.ent) prog->globals.sv->trace_ent = PRVM_EDICT_TO_PROG(trace.ent);
|
||||
else prog->globals.sv->trace_ent = PRVM_EDICT_TO_PROG(prog->edicts);
|
||||
if( trace.ent ) prog->globals.sv->trace_ent = PRVM_EDICT_TO_PROG( trace.ent );
|
||||
else prog->globals.sv->trace_ent = PRVM_EDICT_TO_PROG( prog->edicts );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -122,7 +122,7 @@ void Cvar_LookupVars( int checkbit, char *buffer, void *ptr, cvarcmd_t callback
|
|||
for( cvar = cvar_vars; cvar; cvar = cvar->next )
|
||||
{
|
||||
if(checkbit && !(cvar->flags & checkbit)) continue;
|
||||
if(buffer) callback( cvar->name, cvar->string, buffer, ptr );
|
||||
if( buffer ) callback( cvar->name, cvar->string, buffer, ptr );
|
||||
else callback( cvar->name, cvar->string, cvar->description, ptr );
|
||||
}
|
||||
}
|
||||
|
@ -292,13 +292,13 @@ cvar_t *Cvar_Set2 (const char *var_name, const char *value, bool force)
|
|||
MsgDev(D_INFO, "%s is system variable.\n", var_name);
|
||||
return var;
|
||||
}
|
||||
if (var->flags & CVAR_LATCH)
|
||||
if( var->flags & CVAR_LATCH )
|
||||
{
|
||||
if (var->latched_string)
|
||||
if( var->latched_string )
|
||||
{
|
||||
if (!com_strcmp(value, var->latched_string))
|
||||
if(!com_strcmp(value, var->latched_string))
|
||||
return var;
|
||||
Mem_Free (var->latched_string);
|
||||
Mem_Free( var->latched_string );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -311,15 +311,15 @@ cvar_t *Cvar_Set2 (const char *var_name, const char *value, bool force)
|
|||
var->modificationCount++;
|
||||
return var;
|
||||
}
|
||||
if ( (var->flags & CVAR_CHEAT) && !Cvar_VariableInteger("host_cheats"))
|
||||
if((var->flags & CVAR_CHEAT) && !Cvar_VariableInteger("host_cheats"))
|
||||
{
|
||||
MsgDev(D_INFO, "%s is cheat protected.\n", var_name);
|
||||
MsgDev( D_INFO, "%s is cheat protected.\n", var_name );
|
||||
return var;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (var->latched_string)
|
||||
if( var->latched_string )
|
||||
{
|
||||
Mem_Free(var->latched_string);
|
||||
var->latched_string = NULL;
|
||||
|
@ -358,7 +358,7 @@ Cvar_SetLatched
|
|||
*/
|
||||
void Cvar_SetLatched( const char *var_name, const char *value )
|
||||
{
|
||||
Cvar_Set2 (var_name, value, false);
|
||||
Cvar_Set2( var_name, value, false );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -379,7 +379,7 @@ void Cvar_FullSet( char *var_name, char *value, int flags )
|
|||
}
|
||||
var->modified = true;
|
||||
|
||||
if (var->flags & CVAR_USERINFO)
|
||||
if( var->flags & CVAR_USERINFO )
|
||||
{
|
||||
// transmit at next oportunity
|
||||
com.userinfo_modified = true;
|
||||
|
@ -727,6 +727,36 @@ void Cvar_Restart_f( void )
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
Cvar_Latched_f
|
||||
|
||||
Now all latched strings is valid
|
||||
============
|
||||
*/
|
||||
void Cvar_Latched_f( void )
|
||||
{
|
||||
cvar_t *var;
|
||||
cvar_t **prev;
|
||||
|
||||
prev = &cvar_vars;
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
var = *prev;
|
||||
if( !var ) break;
|
||||
|
||||
if ( var->flags & CVAR_LATCH && var->latched_string )
|
||||
{
|
||||
Msg("set %s = %s\n", var->name, var->latched_string );
|
||||
Cvar_FullSet( var->name, var->latched_string, var->flags );
|
||||
Mem_Free( var->latched_string );
|
||||
var->latched_string = NULL;
|
||||
}
|
||||
prev = &var->next;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
Cvar_Init
|
||||
|
@ -743,6 +773,7 @@ void Cvar_Init (void)
|
|||
Cmd_AddCommand ("setc", Cvar_SetC_f, "create or change the value of a systeminfo variable");
|
||||
Cmd_AddCommand ("seta", Cvar_SetA_f, "create or change the value of a console variable that will be saved to vars.rc");
|
||||
Cmd_AddCommand ("reset", Cvar_Reset_f, "reset any type variable to initial value" );
|
||||
Cmd_AddCommand ("latch", Cvar_Latched_f, "apply latched values" );
|
||||
Cmd_AddCommand ("cvarlist", Cvar_List_f, "display all console variables beginning with the specified prefix" );
|
||||
Cmd_AddCommand ("unsetall", Cvar_Restart_f, "reset all console variables to their default values" );
|
||||
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
#=============================
|
||||
# Makefile to build xash utils
|
||||
# Author: Unkle Mike <xash.ru>
|
||||
#
|
||||
# Please associate .nmake files as NMAKE.EXE "/f" "%1" for build this file
|
||||
#=============================
|
||||
|
||||
!include <win32.mak>
|
||||
|
||||
MAINTARGET = xash
|
||||
OBJS = $(MAINTARGET).obj
|
||||
RES = $(MAINTARGET).rc
|
||||
|
||||
default: $(MAINTARGET).exe
|
||||
|
||||
$(MAINTARGET).exe: $(MAINTARGET).obj xash.res
|
||||
$(link) $(OBJS) xash.res /out:"xash.exe" /subsystem:windows /opt:nowin98 /nodefaultlib:"libc.lib"
|
||||
@del $(MAINTARGET).obj $(MAINTARGET).lib $(MAINTARGET).exp $(MAINTARGET).res > nul
|
||||
@copy $(MAINTARGET).exe D:\Xash3D\sdk_main\tools\#xash.exe
|
||||
@del $(MAINTARGET).exe
|
||||
@echo ‘ª®¯¨à®¢ ® ä ©«®¢: 1.
|
||||
clean:
|
||||
|
||||
.cpp.obj:
|
||||
$(CC) $(CFLAGS) /c $<
|
||||
|
||||
xash.res : xash.rc
|
||||
$(RC) $(RCFLAGS) /r xash.rc
|
|
@ -1,7 +0,0 @@
|
|||
//=======================================================================
|
||||
// Copyright (C) XashXT Group 2007
|
||||
//=======================================================================
|
||||
|
||||
#include "../rundll.h"
|
||||
|
||||
Run32( dedicated );
|
Binary file not shown.
Before Width: | Height: | Size: 13 KiB |
|
@ -1,28 +0,0 @@
|
|||
#include <winver.h>
|
||||
|
||||
#define IDI_ICON1 101
|
||||
|
||||
#define VER_FILEVERSION 0,48
|
||||
#define VER_FILEVERSION_STR "0.48"
|
||||
#define VER_PRODUCTVERSION 0,48
|
||||
#define VER_PRODUCTVERSION_STR "0.48"
|
||||
|
||||
#define VER_FILEFLAGSMASK VS_FF_PRERELEASE | VS_FF_PATCHED
|
||||
#define VER_FILEFLAGS VS_FF_PRERELEASE
|
||||
#define VER_FILEOS VOS__WINDOWS32
|
||||
#define VER_FILETYPE VFT_DLL
|
||||
#define VER_FILESUBTYPE VFT2_UNKNOWN
|
||||
|
||||
#define VER_COMPANYNAME_STR "XashXT Group"
|
||||
#define VER_LEGALCOPYRIGHT_STR "XashXT 2007"
|
||||
#define VER_PRODUCTNAME_STR "Xash3D Dedicated Server"
|
||||
|
||||
#define VER_ANSICP
|
||||
|
||||
#define VER_FILEDESCRIPTION_STR "Xash3D Dedicated Server"
|
||||
#define VER_ORIGINALFILENAME_STR "#xash.exe"
|
||||
#define VER_INTERNALNAME_STR "_xash"
|
||||
|
||||
#include <common.ver>
|
||||
|
||||
IDI_ICON1 ICON DISCARDABLE "xash.ico"
|
|
@ -245,6 +245,7 @@ physbody_t *Phys_CreatePlayer( sv_edict_t *ed, cmodel_t *mod, matrix4x3 transfor
|
|||
matrix4x4 trans;
|
||||
vec3_t radius, mins, maxs, upDirection;
|
||||
|
||||
Msg("Phys_CreatePlayer: %d\n", cm_physics_model->integer );
|
||||
if( !cm_physics_model->integer )
|
||||
return NULL;
|
||||
|
||||
|
|
|
@ -37,9 +37,9 @@ bool InitPhysics( void )
|
|||
|
||||
cm_noareas = Cvar_Get( "cm_noareas", "0", 0, "ignore clipmap areas" );
|
||||
cm_use_triangles = Cvar_Get("cm_convert_polygons", "1", CVAR_SYSTEMINFO, "convert bsp polygons to triangles, slowly but more safety way" );
|
||||
cm_solver_model = Cvar_Get("cm_solver", "0", CVAR_SYSTEMINFO, "change solver model: 0 - precision, 1 - adaptive, 2 - fast. (changes need restart server to take effect)" );
|
||||
cm_friction_model = Cvar_Get("cm_friction", "0", CVAR_SYSTEMINFO, "change solver model: 0 - precision, 1 - adaptive. (changes need restart server to take effect)" );
|
||||
cm_physics_model = Cvar_Get("cm_physic", "1", CVAR_ARCHIVE, "change physic model: 0 - Classic Quake Physic, 1 - Physics Engine" );
|
||||
cm_solver_model = Cvar_Get("cm_solver", "0", CVAR_ARCHIVE|CVAR_LATCH, "change solver model: 0 - precision, 1 - adaptive, 2 - fast. (changes need restart server to take effect)" );
|
||||
cm_friction_model = Cvar_Get("cm_friction", "0", CVAR_ARCHIVE|CVAR_LATCH, "change solver model: 0 - precision, 1 - adaptive. (changes need restart server to take effect)" );
|
||||
cm_physics_model = Cvar_Get("cm_physic", "1", CVAR_ARCHIVE|CVAR_LATCH, "change physic model: 0 - Classic Quake Physic, 1 - Physics Engine" );
|
||||
cm_debugdraw = Cvar_Get( "cm_debugdraw", "0", CVAR_ARCHIVE, "draw physics hulls" );
|
||||
|
||||
return true;
|
||||
|
|
Reference in New Issue