|
|
@ -42,49 +42,51 @@ CVAR_DEFINE_AUTO( cl_logofile, "lambda", FCVAR_ARCHIVE, "player logo name" ); |
|
|
|
CVAR_DEFINE_AUTO( cl_logocolor, "orange", FCVAR_ARCHIVE, "player logo color" ); |
|
|
|
CVAR_DEFINE_AUTO( cl_logocolor, "orange", FCVAR_ARCHIVE, "player logo color" ); |
|
|
|
CVAR_DEFINE_AUTO( cl_logoext, "bmp", FCVAR_ARCHIVE, "temporary cvar to tell engine which logo must be packed" ); |
|
|
|
CVAR_DEFINE_AUTO( cl_logoext, "bmp", FCVAR_ARCHIVE, "temporary cvar to tell engine which logo must be packed" ); |
|
|
|
CVAR_DEFINE_AUTO( cl_test_bandwidth, "1", FCVAR_ARCHIVE, "test network bandwith before connection" ); |
|
|
|
CVAR_DEFINE_AUTO( cl_test_bandwidth, "1", FCVAR_ARCHIVE, "test network bandwith before connection" ); |
|
|
|
convar_t *rcon_address; |
|
|
|
|
|
|
|
convar_t *cl_timeout; |
|
|
|
CVAR_DEFINE( cl_draw_particles, "r_drawparticles", "1", FCVAR_CHEAT, "render particles" ); |
|
|
|
convar_t *cl_nopred; |
|
|
|
CVAR_DEFINE( cl_draw_tracers, "r_drawtracers", "1", FCVAR_CHEAT, "render tracers" ); |
|
|
|
convar_t *cl_nodelta; |
|
|
|
CVAR_DEFINE( cl_draw_beams, "r_drawbeams", "1", FCVAR_CHEAT, "render beams" ); |
|
|
|
convar_t *cl_crosshair; |
|
|
|
|
|
|
|
convar_t *cl_cmdbackup; |
|
|
|
static CVAR_DEFINE_AUTO( rcon_address, "", FCVAR_PRIVILEGED, "remote control address" ); |
|
|
|
convar_t *cl_showerror; |
|
|
|
CVAR_DEFINE_AUTO( cl_timeout, "60", 0, "connect timeout (in-seconds)" ); |
|
|
|
convar_t *cl_bmodelinterp; |
|
|
|
CVAR_DEFINE_AUTO( cl_nopred, "0", FCVAR_ARCHIVE|FCVAR_USERINFO, "disable client movement prediction" ); |
|
|
|
convar_t *cl_draw_particles; |
|
|
|
CVAR_DEFINE_AUTO( cl_nodelta, "0", 0, "disable delta-compression for server messages" ); |
|
|
|
convar_t *cl_draw_tracers; |
|
|
|
CVAR_DEFINE( cl_crosshair, "crosshair", "1", FCVAR_ARCHIVE, "show weapon chrosshair" ); |
|
|
|
convar_t *cl_lightstyle_lerping; |
|
|
|
static CVAR_DEFINE_AUTO( cl_cmdbackup, "10", FCVAR_ARCHIVE, "how many additional history commands are sent" ); |
|
|
|
convar_t *cl_idealpitchscale; |
|
|
|
CVAR_DEFINE_AUTO( cl_showerror, "0", FCVAR_ARCHIVE, "show prediction error" ); |
|
|
|
convar_t *cl_nosmooth; |
|
|
|
CVAR_DEFINE_AUTO( cl_bmodelinterp, "1", FCVAR_ARCHIVE, "enable bmodel interpolation" ); |
|
|
|
convar_t *cl_smoothtime; |
|
|
|
CVAR_DEFINE_AUTO( cl_lightstyle_lerping, "0", FCVAR_ARCHIVE, "enables animated light lerping (perfomance option)" ); |
|
|
|
convar_t *cl_clockreset; |
|
|
|
CVAR_DEFINE_AUTO( cl_idealpitchscale, "0.8", 0, "how much to look up/down slopes and stairs when not using freelook" ); |
|
|
|
convar_t *cl_fixtimerate; |
|
|
|
CVAR_DEFINE_AUTO( cl_nosmooth, "0", FCVAR_ARCHIVE, "disable smooth up stair climbing" ); |
|
|
|
convar_t *hud_fontscale; |
|
|
|
CVAR_DEFINE_AUTO( cl_smoothtime, "0.1", FCVAR_ARCHIVE, "time to smooth up" ); |
|
|
|
convar_t *hud_scale; |
|
|
|
CVAR_DEFINE_AUTO( cl_clockreset, "0.1", FCVAR_ARCHIVE, "frametime delta maximum value before reset" ); |
|
|
|
convar_t *cl_solid_players; |
|
|
|
CVAR_DEFINE_AUTO( cl_fixtimerate, "7.5", FCVAR_ARCHIVE, "time in msec to client clock adjusting" ); |
|
|
|
convar_t *cl_draw_beams; |
|
|
|
CVAR_DEFINE_AUTO( hud_fontscale, "1.0", FCVAR_ARCHIVE|FCVAR_LATCH, "scale hud font texture" ); |
|
|
|
convar_t *cl_updaterate; |
|
|
|
CVAR_DEFINE_AUTO( hud_scale, "0", FCVAR_ARCHIVE|FCVAR_LATCH, "scale hud at current resolution" ); |
|
|
|
convar_t *cl_showevents; |
|
|
|
CVAR_DEFINE_AUTO( cl_solid_players, "1", 0, "Make all players not solid (can't traceline them)" ); |
|
|
|
convar_t *cl_cmdrate; |
|
|
|
CVAR_DEFINE_AUTO( cl_updaterate, "20", FCVAR_USERINFO|FCVAR_ARCHIVE, "refresh rate of server messages" ); |
|
|
|
convar_t *cl_interp; |
|
|
|
CVAR_DEFINE_AUTO( cl_showevents, "0", FCVAR_ARCHIVE, "show events playback" ); |
|
|
|
convar_t *cl_nointerp; |
|
|
|
CVAR_DEFINE_AUTO( cl_cmdrate, "60", FCVAR_ARCHIVE, "Max number of command packets sent to server per second" ); |
|
|
|
convar_t *cl_dlmax; |
|
|
|
CVAR_DEFINE( cl_interp, "ex_interp", "0.1", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "Interpolate object positions starting this many seconds in past" ); |
|
|
|
convar_t *cl_upmax; |
|
|
|
CVAR_DEFINE_AUTO( cl_nointerp, "0", FCVAR_CLIENTDLL, "disable interpolation of entities and players" ); |
|
|
|
|
|
|
|
static CVAR_DEFINE_AUTO( cl_dlmax, "0", FCVAR_USERINFO|FCVAR_ARCHIVE, "max allowed outcoming fragment size" ); |
|
|
|
convar_t *cl_lw; |
|
|
|
static CVAR_DEFINE_AUTO( cl_upmax, "1200", FCVAR_ARCHIVE, "max allowed incoming fragment size" ); |
|
|
|
convar_t *cl_charset; |
|
|
|
|
|
|
|
convar_t *cl_trace_messages; |
|
|
|
CVAR_DEFINE_AUTO( cl_lw, "1", FCVAR_ARCHIVE|FCVAR_USERINFO, "enable client weapon predicting" ); |
|
|
|
convar_t *cl_nat; |
|
|
|
CVAR_DEFINE_AUTO( cl_charset, "utf-8", FCVAR_ARCHIVE, "1-byte charset to use (iconv style)" ); |
|
|
|
convar_t *hud_utf8; |
|
|
|
CVAR_DEFINE_AUTO( cl_trace_messages, "0", FCVAR_ARCHIVE|FCVAR_CHEAT, "enable message names tracing (good for developers)"); |
|
|
|
convar_t *ui_renderworld; |
|
|
|
static CVAR_DEFINE_AUTO( cl_nat, "0", 0, "show servers running under NAT" ); |
|
|
|
|
|
|
|
CVAR_DEFINE_AUTO( hud_utf8, "0", FCVAR_ARCHIVE, "Use utf-8 encoding for hud text" ); |
|
|
|
|
|
|
|
CVAR_DEFINE_AUTO( ui_renderworld, "0", FCVAR_ARCHIVE, "render world when UI is visible" ); |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// userinfo
|
|
|
|
// userinfo
|
|
|
|
//
|
|
|
|
//
|
|
|
|
convar_t *name; |
|
|
|
static CVAR_DEFINE_AUTO( name, "player", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_PRINTABLEONLY, "player name" ); |
|
|
|
convar_t *model; |
|
|
|
static CVAR_DEFINE_AUTO( model, "", FCVAR_USERINFO|FCVAR_ARCHIVE, "player model ('player' is a singleplayer model)" ); |
|
|
|
convar_t *topcolor; |
|
|
|
static CVAR_DEFINE_AUTO( topcolor, "0", FCVAR_USERINFO|FCVAR_ARCHIVE, "player top color" ); |
|
|
|
convar_t *bottomcolor; |
|
|
|
static CVAR_DEFINE_AUTO( bottomcolor, "0", FCVAR_USERINFO|FCVAR_ARCHIVE, "player bottom color" ); |
|
|
|
convar_t *rate; |
|
|
|
CVAR_DEFINE_AUTO( rate, "3500", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE, "player network rate" ); |
|
|
|
|
|
|
|
|
|
|
|
client_t cl; |
|
|
|
client_t cl; |
|
|
|
client_static_t cls; |
|
|
|
client_static_t cls; |
|
|
@ -203,7 +205,7 @@ int CL_GetFragmentSize( void *unused, fragsize_t mode ) |
|
|
|
if( Netchan_IsLocal( &cls.netchan )) |
|
|
|
if( Netchan_IsLocal( &cls.netchan )) |
|
|
|
return FRAGMENT_LOCAL_SIZE; |
|
|
|
return FRAGMENT_LOCAL_SIZE; |
|
|
|
|
|
|
|
|
|
|
|
return cl_upmax->value; |
|
|
|
return cl_upmax.value; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
@ -262,10 +264,10 @@ static float CL_LerpPoint( void ) |
|
|
|
return 1.0f; |
|
|
|
return 1.0f; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if( cl_interp->value <= 0.001 ) |
|
|
|
if( cl_interp.value <= 0.001 ) |
|
|
|
return 1.0f; |
|
|
|
return 1.0f; |
|
|
|
|
|
|
|
|
|
|
|
frac = ( cl.time - cl.mtime[0] ) / cl_interp->value; |
|
|
|
frac = ( cl.time - cl.mtime[0] ) / cl_interp.value; |
|
|
|
|
|
|
|
|
|
|
|
return frac; |
|
|
|
return frac; |
|
|
|
} |
|
|
|
} |
|
|
@ -312,13 +314,13 @@ void CL_ComputeClientInterpolationAmount( usercmd_t *cmd ) |
|
|
|
float max_interp = MAX_EX_INTERP; |
|
|
|
float max_interp = MAX_EX_INTERP; |
|
|
|
float interpolation_time; |
|
|
|
float interpolation_time; |
|
|
|
|
|
|
|
|
|
|
|
if( cl_updaterate->value < MIN_UPDATERATE ) |
|
|
|
if( cl_updaterate.value < MIN_UPDATERATE ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Con_Printf( "cl_updaterate minimum is %f, resetting to default (20)\n", MIN_UPDATERATE ); |
|
|
|
Con_Printf( "cl_updaterate minimum is %f, resetting to default (20)\n", MIN_UPDATERATE ); |
|
|
|
Cvar_Reset( "cl_updaterate" ); |
|
|
|
Cvar_Reset( "cl_updaterate" ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if( cl_updaterate->value > MAX_UPDATERATE ) |
|
|
|
if( cl_updaterate.value > MAX_UPDATERATE ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Con_Printf( "cl_updaterate clamped at maximum (%f)\n", MAX_UPDATERATE ); |
|
|
|
Con_Printf( "cl_updaterate clamped at maximum (%f)\n", MAX_UPDATERATE ); |
|
|
|
Cvar_SetValue( "cl_updaterate", MAX_UPDATERATE ); |
|
|
|
Cvar_SetValue( "cl_updaterate", MAX_UPDATERATE ); |
|
|
@ -327,15 +329,15 @@ void CL_ComputeClientInterpolationAmount( usercmd_t *cmd ) |
|
|
|
if( cls.spectator ) |
|
|
|
if( cls.spectator ) |
|
|
|
max_interp = 0.2f; |
|
|
|
max_interp = 0.2f; |
|
|
|
|
|
|
|
|
|
|
|
min_interp = 1.0f / cl_updaterate->value; |
|
|
|
min_interp = 1.0f / cl_updaterate.value; |
|
|
|
interpolation_time = cl_interp->value * 1000.0; |
|
|
|
interpolation_time = cl_interp.value * 1000.0; |
|
|
|
|
|
|
|
|
|
|
|
if( (cl_interp->value + epsilon) < min_interp ) |
|
|
|
if( (cl_interp.value + epsilon) < min_interp ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Con_Printf( "ex_interp forced up to %.1f msec\n", min_interp * 1000.f ); |
|
|
|
Con_Printf( "ex_interp forced up to %.1f msec\n", min_interp * 1000.f ); |
|
|
|
Cvar_SetValue( "ex_interp", min_interp ); |
|
|
|
Cvar_SetValue( "ex_interp", min_interp ); |
|
|
|
} |
|
|
|
} |
|
|
|
else if( (cl_interp->value - epsilon) > max_interp ) |
|
|
|
else if( (cl_interp.value - epsilon) > max_interp ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Con_Printf( "ex_interp forced down to %.1f msec\n", max_interp * 1000.f ); |
|
|
|
Con_Printf( "ex_interp forced down to %.1f msec\n", max_interp * 1000.f ); |
|
|
|
Cvar_SetValue( "ex_interp", max_interp ); |
|
|
|
Cvar_SetValue( "ex_interp", max_interp ); |
|
|
@ -707,17 +709,17 @@ void CL_WritePacket( void ) |
|
|
|
MSG_Init( &buf, "ClientData", data, sizeof( data )); |
|
|
|
MSG_Init( &buf, "ClientData", data, sizeof( data )); |
|
|
|
|
|
|
|
|
|
|
|
// Determine number of backup commands to send along
|
|
|
|
// Determine number of backup commands to send along
|
|
|
|
numbackup = bound( 0, cl_cmdbackup->value, cls.legacymode ? MAX_LEGACY_BACKUP_CMDS : MAX_BACKUP_COMMANDS ); |
|
|
|
numbackup = bound( 0, cl_cmdbackup.value, cls.legacymode ? MAX_LEGACY_BACKUP_CMDS : MAX_BACKUP_COMMANDS ); |
|
|
|
if( cls.state == ca_connected ) numbackup = 0; |
|
|
|
if( cls.state == ca_connected ) numbackup = 0; |
|
|
|
|
|
|
|
|
|
|
|
// clamp cmdrate
|
|
|
|
// clamp cmdrate
|
|
|
|
if( cl_cmdrate->value < 10.0f ) |
|
|
|
if( cl_cmdrate.value < 10.0f ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Cvar_SetValue( "cl_cmdrate", 10.0f ); |
|
|
|
Cvar_DirectSet( &cl_cmdrate, "10" ); |
|
|
|
} |
|
|
|
} |
|
|
|
else if( cl_cmdrate->value > 100.0f ) |
|
|
|
else if( cl_cmdrate.value > 100.0f ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Cvar_SetValue( "cl_cmdrate", 100.0f ); |
|
|
|
Cvar_DirectSet( &cl_cmdrate, "100" ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Check to see if we can actually send this command
|
|
|
|
// Check to see if we can actually send this command
|
|
|
@ -748,20 +750,20 @@ void CL_WritePacket( void ) |
|
|
|
if(( host.realtime - cls.netchan.last_received ) > CONNECTION_PROBLEM_TIME ) |
|
|
|
if(( host.realtime - cls.netchan.last_received ) > CONNECTION_PROBLEM_TIME ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Con_NPrintf( 1, "^3Warning:^1 Connection Problem^7\n" ); |
|
|
|
Con_NPrintf( 1, "^3Warning:^1 Connection Problem^7\n" ); |
|
|
|
Con_NPrintf( 2, "^1Auto-disconnect in %.1f seconds^7", cl_timeout->value - ( host.realtime - cls.netchan.last_received )); |
|
|
|
Con_NPrintf( 2, "^1Auto-disconnect in %.1f seconds^7", cl_timeout.value - ( host.realtime - cls.netchan.last_received )); |
|
|
|
cl.validsequence = 0; |
|
|
|
cl.validsequence = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if( cl_nodelta->value ) |
|
|
|
if( cl_nodelta.value ) |
|
|
|
cl.validsequence = 0; |
|
|
|
cl.validsequence = 0; |
|
|
|
|
|
|
|
|
|
|
|
if( send_command ) |
|
|
|
if( send_command ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int outgoing_sequence; |
|
|
|
int outgoing_sequence; |
|
|
|
|
|
|
|
|
|
|
|
if( cl_cmdrate->value > 0 ) // clamped between 10 and 100 fps
|
|
|
|
if( cl_cmdrate.value > 0 ) // clamped between 10 and 100 fps
|
|
|
|
cls.nextcmdtime = host.realtime + bound( 0.1f, ( 1.0f / cl_cmdrate->value ), 0.01f ); |
|
|
|
cls.nextcmdtime = host.realtime + bound( 0.1f, ( 1.0f / cl_cmdrate.value ), 0.01f ); |
|
|
|
else cls.nextcmdtime = host.realtime; // always able to send right away
|
|
|
|
else cls.nextcmdtime = host.realtime; // always able to send right away
|
|
|
|
|
|
|
|
|
|
|
|
if( cls.lastoutgoingcommand == -1 ) |
|
|
|
if( cls.lastoutgoingcommand == -1 ) |
|
|
@ -1033,10 +1035,10 @@ void CL_SendConnectPacket( void ) |
|
|
|
if( cls.legacymode ) |
|
|
|
if( cls.legacymode ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// set related userinfo keys
|
|
|
|
// set related userinfo keys
|
|
|
|
if( cl_dlmax->value >= 40000 || cl_dlmax->value < 100 ) |
|
|
|
if( cl_dlmax.value >= 40000 || cl_dlmax.value < 100 ) |
|
|
|
Info_SetValueForKey( cls.userinfo, "cl_maxpacket", "1400", sizeof( cls.userinfo ) ); |
|
|
|
Info_SetValueForKey( cls.userinfo, "cl_maxpacket", "1400", sizeof( cls.userinfo ) ); |
|
|
|
else |
|
|
|
else |
|
|
|
Info_SetValueForKey( cls.userinfo, "cl_maxpacket", cl_dlmax->string, sizeof( cls.userinfo ) ); |
|
|
|
Info_SetValueForKey( cls.userinfo, "cl_maxpacket", cl_dlmax.string, sizeof( cls.userinfo ) ); |
|
|
|
|
|
|
|
|
|
|
|
if( !*Info_ValueForKey( cls.userinfo,"cl_maxpayload") ) |
|
|
|
if( !*Info_ValueForKey( cls.userinfo,"cl_maxpayload") ) |
|
|
|
Info_SetValueForKey( cls.userinfo, "cl_maxpayload", "1000", sizeof( cls.userinfo ) ); |
|
|
|
Info_SetValueForKey( cls.userinfo, "cl_maxpayload", "1000", sizeof( cls.userinfo ) ); |
|
|
@ -1051,7 +1053,7 @@ void CL_SendConnectPacket( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int extensions = NET_EXT_SPLITSIZE; |
|
|
|
int extensions = NET_EXT_SPLITSIZE; |
|
|
|
|
|
|
|
|
|
|
|
if( cl_dlmax->value > FRAGMENT_MAX_SIZE || cl_dlmax->value < FRAGMENT_MIN_SIZE ) |
|
|
|
if( cl_dlmax.value > FRAGMENT_MAX_SIZE || cl_dlmax.value < FRAGMENT_MIN_SIZE ) |
|
|
|
Cvar_SetValue( "cl_dlmax", FRAGMENT_DEFAULT_SIZE ); |
|
|
|
Cvar_SetValue( "cl_dlmax", FRAGMENT_DEFAULT_SIZE ); |
|
|
|
|
|
|
|
|
|
|
|
Info_RemoveKey( cls.userinfo, "cl_maxpacket" ); |
|
|
|
Info_RemoveKey( cls.userinfo, "cl_maxpacket" ); |
|
|
@ -1246,7 +1248,7 @@ void CL_Connect_f( void ) |
|
|
|
|
|
|
|
|
|
|
|
// if running a local server, kill it and reissue
|
|
|
|
// if running a local server, kill it and reissue
|
|
|
|
if( SV_Active( )) Host_ShutdownServer(); |
|
|
|
if( SV_Active( )) Host_ShutdownServer(); |
|
|
|
NET_Config( true, !CVAR_TO_BOOL( cl_nat )); // allow remote
|
|
|
|
NET_Config( true, !cl_nat.value ); // allow remote
|
|
|
|
|
|
|
|
|
|
|
|
Con_Printf( "server %s\n", server ); |
|
|
|
Con_Printf( "server %s\n", server ); |
|
|
|
CL_Disconnect(); |
|
|
|
CL_Disconnect(); |
|
|
@ -1311,13 +1313,13 @@ void CL_Rcon_f( void ) |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( !COM_CheckString( rcon_address->string )) |
|
|
|
if( !COM_CheckString( rcon_address.string )) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Con_Printf( "You must either be connected or set the 'rcon_address' cvar to issue rcon commands\n" ); |
|
|
|
Con_Printf( "You must either be connected or set the 'rcon_address' cvar to issue rcon commands\n" ); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
NET_StringToAdr( rcon_address->string, &to ); |
|
|
|
NET_StringToAdr( rcon_address.string, &to ); |
|
|
|
if( to.port == 0 ) to.port = MSG_BigShort( PORT_SERVER ); |
|
|
|
if( to.port == 0 ) to.port = MSG_BigShort( PORT_SERVER ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1410,12 +1412,12 @@ int CL_GetSplitSize( void ) |
|
|
|
if( !(cls.extensions & NET_EXT_SPLITSIZE) ) |
|
|
|
if( !(cls.extensions & NET_EXT_SPLITSIZE) ) |
|
|
|
return 1400; |
|
|
|
return 1400; |
|
|
|
|
|
|
|
|
|
|
|
splitsize = cl_dlmax->value; |
|
|
|
splitsize = cl_dlmax.value; |
|
|
|
|
|
|
|
|
|
|
|
if( splitsize < FRAGMENT_MIN_SIZE || splitsize > FRAGMENT_MAX_SIZE ) |
|
|
|
if( splitsize < FRAGMENT_MIN_SIZE || splitsize > FRAGMENT_MAX_SIZE ) |
|
|
|
Cvar_SetValue( "cl_dlmax", FRAGMENT_DEFAULT_SIZE ); |
|
|
|
Cvar_SetValue( "cl_dlmax", FRAGMENT_DEFAULT_SIZE ); |
|
|
|
|
|
|
|
|
|
|
|
return cl_dlmax->value; |
|
|
|
return cl_dlmax.value; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
@ -1439,7 +1441,7 @@ void CL_Reconnect( qboolean setup_netchan ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// only enable incoming split for legacy mode
|
|
|
|
// only enable incoming split for legacy mode
|
|
|
|
cls.netchan.split = true; |
|
|
|
cls.netchan.split = true; |
|
|
|
Con_Reportf( "^2NET_EXT_SPLIT enabled^7 (packet sizes is %d/%d)\n", (int)cl_dlmax->value, 65536 ); |
|
|
|
Con_Reportf( "^2NET_EXT_SPLIT enabled^7 (packet sizes is %d/%d)\n", (int)cl_dlmax.value, 65536 ); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
@ -1448,7 +1450,7 @@ void CL_Reconnect( qboolean setup_netchan ) |
|
|
|
|
|
|
|
|
|
|
|
if( cls.extensions & NET_EXT_SPLITSIZE ) |
|
|
|
if( cls.extensions & NET_EXT_SPLITSIZE ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Con_Reportf( "^2NET_EXT_SPLITSIZE enabled^7 (packet size is %d)\n", (int)cl_dlmax->value ); |
|
|
|
Con_Reportf( "^2NET_EXT_SPLITSIZE enabled^7 (packet size is %d)\n", (int)cl_dlmax.value ); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1604,7 +1606,7 @@ void CL_InternetServers_f( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
char fullquery[512]; |
|
|
|
char fullquery[512]; |
|
|
|
size_t len; |
|
|
|
size_t len; |
|
|
|
qboolean nat = cl_nat->value != 0.0f; |
|
|
|
qboolean nat = cl_nat.value != 0.0f; |
|
|
|
|
|
|
|
|
|
|
|
len = CL_BuildMasterServerScanRequest( fullquery, sizeof( fullquery ), nat ); |
|
|
|
len = CL_BuildMasterServerScanRequest( fullquery, sizeof( fullquery ), nat ); |
|
|
|
|
|
|
|
|
|
|
@ -2365,7 +2367,7 @@ void CL_ReadPackets( void ) |
|
|
|
// check timeout
|
|
|
|
// check timeout
|
|
|
|
if( cls.state >= ca_connected && cls.state != ca_cinematic && !cls.demoplayback ) |
|
|
|
if( cls.state >= ca_connected && cls.state != ca_cinematic && !cls.demoplayback ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( host.realtime - cls.netchan.last_received > cl_timeout->value ) |
|
|
|
if( host.realtime - cls.netchan.last_received > cl_timeout.value ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Con_Printf( "\nServer connection timed out.\n" ); |
|
|
|
Con_Printf( "\nServer connection timed out.\n" ); |
|
|
|
CL_Disconnect(); |
|
|
|
CL_Disconnect(); |
|
|
@ -2859,55 +2861,56 @@ void CL_InitLocal( void ) |
|
|
|
VGui_RegisterCvars(); |
|
|
|
VGui_RegisterCvars(); |
|
|
|
|
|
|
|
|
|
|
|
// register our variables
|
|
|
|
// register our variables
|
|
|
|
cl_crosshair = Cvar_Get( "crosshair", "1", FCVAR_ARCHIVE, "show weapon chrosshair" ); |
|
|
|
Cvar_RegisterVariable( &cl_crosshair ); |
|
|
|
cl_nodelta = Cvar_Get ("cl_nodelta", "0", 0, "disable delta-compression for server messages" ); |
|
|
|
Cvar_RegisterVariable( &cl_nodelta ); |
|
|
|
cl_idealpitchscale = Cvar_Get( "cl_idealpitchscale", "0.8", 0, "how much to look up/down slopes and stairs when not using freelook" ); |
|
|
|
Cvar_RegisterVariable( &cl_idealpitchscale ); |
|
|
|
cl_solid_players = Cvar_Get( "cl_solid_players", "1", 0, "Make all players not solid (can't traceline them)" ); |
|
|
|
Cvar_RegisterVariable( &cl_solid_players ); |
|
|
|
cl_interp = Cvar_Get( "ex_interp", "0.1", FCVAR_ARCHIVE | FCVAR_FILTERABLE, "Interpolate object positions starting this many seconds in past" ); |
|
|
|
Cvar_RegisterVariable( &cl_interp ); |
|
|
|
cl_timeout = Cvar_Get( "cl_timeout", "60", 0, "connect timeout (in-seconds)" ); |
|
|
|
Cvar_RegisterVariable( &cl_timeout ); |
|
|
|
cl_charset = Cvar_Get( "cl_charset", "utf-8", FCVAR_ARCHIVE, "1-byte charset to use (iconv style)" ); |
|
|
|
Cvar_RegisterVariable( &cl_charset ); |
|
|
|
hud_utf8 = Cvar_Get( "hud_utf8", "0", FCVAR_ARCHIVE, "Use utf-8 encoding for hud text" ); |
|
|
|
Cvar_RegisterVariable( &hud_utf8 ); |
|
|
|
|
|
|
|
|
|
|
|
rcon_address = Cvar_Get( "rcon_address", "", FCVAR_PRIVILEGED, "remote control address" ); |
|
|
|
Cvar_RegisterVariable( &rcon_address ); |
|
|
|
|
|
|
|
|
|
|
|
cl_trace_messages = Cvar_Get( "cl_trace_messages", "0", FCVAR_ARCHIVE|FCVAR_CHEAT, "enable message names tracing (good for developers)"); |
|
|
|
Cvar_RegisterVariable( &cl_trace_messages ); |
|
|
|
|
|
|
|
|
|
|
|
// userinfo
|
|
|
|
// userinfo
|
|
|
|
cl_nopred = Cvar_Get( "cl_nopred", "0", FCVAR_ARCHIVE|FCVAR_USERINFO, "disable client movement prediction" ); |
|
|
|
Cvar_RegisterVariable( &cl_nopred ); |
|
|
|
name = Cvar_Get( "name", Sys_GetCurrentUser(), FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_PRINTABLEONLY, "player name" ); |
|
|
|
Cvar_RegisterVariable( &name ); |
|
|
|
model = Cvar_Get( "model", "", FCVAR_USERINFO|FCVAR_ARCHIVE, "player model ('player' is a singleplayer model)" ); |
|
|
|
Cvar_DirectSet( &name, Sys_GetCurrentUser( )); |
|
|
|
cl_updaterate = Cvar_Get( "cl_updaterate", "20", FCVAR_USERINFO|FCVAR_ARCHIVE, "refresh rate of server messages" ); |
|
|
|
Cvar_RegisterVariable( &model ); |
|
|
|
cl_dlmax = Cvar_Get( "cl_dlmax", "0", FCVAR_USERINFO|FCVAR_ARCHIVE, "max allowed outcoming fragment size" ); |
|
|
|
Cvar_RegisterVariable( &cl_updaterate ); |
|
|
|
cl_upmax = Cvar_Get( "cl_upmax", "1200", FCVAR_ARCHIVE, "max allowed incoming fragment size" ); |
|
|
|
Cvar_RegisterVariable( &cl_dlmax ); |
|
|
|
cl_nat = Cvar_Get( "cl_nat", "0", 0, "show servers running under NAT" ); |
|
|
|
Cvar_RegisterVariable( &cl_upmax ); |
|
|
|
rate = Cvar_Get( "rate", "3500", FCVAR_USERINFO|FCVAR_ARCHIVE|FCVAR_FILTERABLE, "player network rate" ); |
|
|
|
Cvar_RegisterVariable( &cl_nat ); |
|
|
|
topcolor = Cvar_Get( "topcolor", "0", FCVAR_USERINFO|FCVAR_ARCHIVE, "player top color" ); |
|
|
|
Cvar_RegisterVariable( &rate ); |
|
|
|
bottomcolor = Cvar_Get( "bottomcolor", "0", FCVAR_USERINFO|FCVAR_ARCHIVE, "player bottom color" ); |
|
|
|
Cvar_RegisterVariable( &topcolor ); |
|
|
|
cl_lw = Cvar_Get( "cl_lw", "1", FCVAR_ARCHIVE|FCVAR_USERINFO, "enable client weapon predicting" ); |
|
|
|
Cvar_RegisterVariable( &bottomcolor ); |
|
|
|
|
|
|
|
Cvar_RegisterVariable( &cl_lw ); |
|
|
|
Cvar_Get( "cl_lc", "1", FCVAR_ARCHIVE|FCVAR_USERINFO, "enable lag compensation" ); |
|
|
|
Cvar_Get( "cl_lc", "1", FCVAR_ARCHIVE|FCVAR_USERINFO, "enable lag compensation" ); |
|
|
|
Cvar_Get( "password", "", FCVAR_USERINFO, "server password" ); |
|
|
|
Cvar_Get( "password", "", FCVAR_USERINFO, "server password" ); |
|
|
|
Cvar_Get( "team", "", FCVAR_USERINFO, "player team" ); |
|
|
|
Cvar_Get( "team", "", FCVAR_USERINFO, "player team" ); |
|
|
|
Cvar_Get( "skin", "", FCVAR_USERINFO, "player skin" ); |
|
|
|
Cvar_Get( "skin", "", FCVAR_USERINFO, "player skin" ); |
|
|
|
|
|
|
|
|
|
|
|
cl_nosmooth = Cvar_Get( "cl_nosmooth", "0", FCVAR_ARCHIVE, "disable smooth up stair climbing" ); |
|
|
|
Cvar_RegisterVariable( &cl_nosmooth ); |
|
|
|
cl_nointerp = Cvar_Get( "cl_nointerp", "0", FCVAR_CLIENTDLL, "disable interpolation of entities and players" ); |
|
|
|
Cvar_RegisterVariable( &cl_nointerp ); |
|
|
|
cl_smoothtime = Cvar_Get( "cl_smoothtime", "0.1", FCVAR_ARCHIVE, "time to smooth up" ); |
|
|
|
Cvar_RegisterVariable( &cl_smoothtime ); |
|
|
|
cl_cmdbackup = Cvar_Get( "cl_cmdbackup", "10", FCVAR_ARCHIVE, "how many additional history commands are sent" ); |
|
|
|
Cvar_RegisterVariable( &cl_cmdbackup ); |
|
|
|
cl_cmdrate = Cvar_Get( "cl_cmdrate", "60", FCVAR_ARCHIVE, "Max number of command packets sent to server per second" ); |
|
|
|
Cvar_RegisterVariable( &cl_cmdrate ); |
|
|
|
cl_draw_particles = Cvar_Get( "r_drawparticles", "1", FCVAR_CHEAT, "render particles" ); |
|
|
|
Cvar_RegisterVariable( &cl_draw_particles ); |
|
|
|
cl_draw_tracers = Cvar_Get( "r_drawtracers", "1", FCVAR_CHEAT, "render tracers" ); |
|
|
|
Cvar_RegisterVariable( &cl_draw_tracers ); |
|
|
|
cl_draw_beams = Cvar_Get( "r_drawbeams", "1", FCVAR_CHEAT, "render beams" ); |
|
|
|
Cvar_RegisterVariable( &cl_draw_beams ); |
|
|
|
cl_lightstyle_lerping = Cvar_Get( "cl_lightstyle_lerping", "0", FCVAR_ARCHIVE, "enables animated light lerping (perfomance option)" ); |
|
|
|
Cvar_RegisterVariable( &cl_lightstyle_lerping ); |
|
|
|
cl_showerror = Cvar_Get( "cl_showerror", "0", FCVAR_ARCHIVE, "show prediction error" ); |
|
|
|
Cvar_RegisterVariable( &cl_showerror ); |
|
|
|
cl_bmodelinterp = Cvar_Get( "cl_bmodelinterp", "1", FCVAR_ARCHIVE, "enable bmodel interpolation" ); |
|
|
|
Cvar_RegisterVariable( &cl_bmodelinterp ); |
|
|
|
cl_clockreset = Cvar_Get( "cl_clockreset", "0.1", FCVAR_ARCHIVE, "frametime delta maximum value before reset" ); |
|
|
|
Cvar_RegisterVariable( &cl_clockreset ); |
|
|
|
cl_fixtimerate = Cvar_Get( "cl_fixtimerate", "7.5", FCVAR_ARCHIVE, "time in msec to client clock adjusting" ); |
|
|
|
Cvar_RegisterVariable( &cl_fixtimerate ); |
|
|
|
hud_fontscale = Cvar_Get( "hud_fontscale", "1.0", FCVAR_ARCHIVE|FCVAR_LATCH, "scale hud font texture" ); |
|
|
|
Cvar_RegisterVariable( &hud_fontscale ); |
|
|
|
hud_scale = Cvar_Get( "hud_scale", "0", FCVAR_ARCHIVE|FCVAR_LATCH, "scale hud at current resolution" ); |
|
|
|
Cvar_RegisterVariable( &hud_scale ); |
|
|
|
Cvar_Get( "cl_background", "0", FCVAR_READ_ONLY, "indicate what background map is running" ); |
|
|
|
Cvar_Get( "cl_background", "0", FCVAR_READ_ONLY, "indicate what background map is running" ); |
|
|
|
cl_showevents = Cvar_Get( "cl_showevents", "0", FCVAR_ARCHIVE, "show events playback" ); |
|
|
|
Cvar_RegisterVariable( &cl_showevents ); |
|
|
|
Cvar_Get( "lastdemo", "", FCVAR_ARCHIVE, "last played demo" ); |
|
|
|
Cvar_Get( "lastdemo", "", FCVAR_ARCHIVE, "last played demo" ); |
|
|
|
ui_renderworld = Cvar_Get( "ui_renderworld", "0", FCVAR_ARCHIVE, "render world when UI is visible" ); |
|
|
|
Cvar_RegisterVariable( &ui_renderworld ); |
|
|
|
|
|
|
|
|
|
|
|
// these two added to shut up CS 1.5 about 'unknown' commands
|
|
|
|
// these two added to shut up CS 1.5 about 'unknown' commands
|
|
|
|
Cvar_Get( "lightgamma", "1", FCVAR_ARCHIVE, "ambient lighting level (legacy, unused)" ); |
|
|
|
Cvar_Get( "lightgamma", "1", FCVAR_ARCHIVE, "ambient lighting level (legacy, unused)" ); |
|
|
@ -2987,10 +2990,10 @@ to smooth lag effect |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void CL_AdjustClock( void ) |
|
|
|
void CL_AdjustClock( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( cl.timedelta == 0.0f || !cl_fixtimerate->value ) |
|
|
|
if( cl.timedelta == 0.0f || !cl_fixtimerate.value ) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if( cl_fixtimerate->value < 0.0f ) |
|
|
|
if( cl_fixtimerate.value < 0.0f ) |
|
|
|
Cvar_SetValue( "cl_fixtimerate", 7.5f ); |
|
|
|
Cvar_SetValue( "cl_fixtimerate", 7.5f ); |
|
|
|
|
|
|
|
|
|
|
|
if( fabs( cl.timedelta ) >= 0.001f ) |
|
|
|
if( fabs( cl.timedelta ) >= 0.001f ) |
|
|
@ -3000,7 +3003,7 @@ void CL_AdjustClock( void ) |
|
|
|
|
|
|
|
|
|
|
|
msec = ( cl.timedelta * 1000.0 ); |
|
|
|
msec = ( cl.timedelta * 1000.0 ); |
|
|
|
sign = ( msec < 0 ) ? 1.0 : -1.0; |
|
|
|
sign = ( msec < 0 ) ? 1.0 : -1.0; |
|
|
|
msec = Q_min( cl_fixtimerate->value, fabs( msec )); |
|
|
|
msec = Q_min( cl_fixtimerate.value, fabs( msec )); |
|
|
|
adjust = sign * ( msec / 1000.0 ); |
|
|
|
adjust = sign * ( msec / 1000.0 ); |
|
|
|
|
|
|
|
|
|
|
|
if( fabs( adjust ) < fabs( cl.timedelta )) |
|
|
|
if( fabs( adjust ) < fabs( cl.timedelta )) |
|
|
|