diff options
author | Andrey Nazarov <skuller@skuller.net> | 2009-02-05 12:56:45 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2009-02-05 12:56:45 +0000 |
commit | cb1f4461911154e547a15480ef98199832a2cbf7 (patch) | |
tree | cd3b36d543b775268c7a5a4a72ece7c14b2195f0 /source/cl_main.c | |
parent | 5dea48daf494adbf28c75cb74e478e5bc15fbff4 (diff) |
Report download size/done percentage in the output of ‘status d’ command.
Fixed a small memory leak possible when client was requesting another download without stopping the previous one.
Properly exit dedicated server running as Win32 service given a ‘quit’ command.
No longer assume ‘portalopen’ array indices to be mapped directly into ‘areaportals’ array.
No longer error out when CM_SetAreaPortalState is called on the areaportal inside MAX_MAP_AREAPORTALS range but not referenced anywhere on the map.
Flush server logfile on Com_Error.
Changed default value of ‘uf’ cvar to include UF_LOCALFOV (from 0 to 4).
Added ‘cl_lag’ macro expanding to server to client packetloss percentage.
Diffstat (limited to 'source/cl_main.c')
-rw-r--r-- | source/cl_main.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/cl_main.c b/source/cl_main.c index 636be69..55fee6e 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -2210,6 +2210,11 @@ static size_t CL_Fps_m( char *buffer, size_t size ) { static size_t CL_Ping_m( char *buffer, size_t size ) { return Q_scnprintf( buffer, size, "%i", cls.ping ); } +static size_t CL_Lag_m( char *buffer, size_t size ) { + return Q_scnprintf( buffer, size, "%.2f%%", cls.netchan ? + ( (float)cls.netchan->total_dropped / + cls.netchan->total_received ) * 100.0f : 0 ); +} static size_t CL_Health_m( char *buffer, size_t size ) { return Q_scnprintf( buffer, size, "%i", cl.frame.ps.stats[STAT_HEALTH] ); } @@ -2493,7 +2498,7 @@ static void CL_InitLocal ( void ) { info_fov = Cvar_Get( "fov", "90", CVAR_USERINFO | CVAR_ARCHIVE ); info_gender = Cvar_Get( "gender", "male", CVAR_USERINFO | CVAR_ARCHIVE ); info_gender->modified = qfalse; // clear this so we know when user sets it manually - info_uf = Cvar_Get( "uf", "0", CVAR_USERINFO ); + info_uf = Cvar_Get( "uf", va( "%d", UF_LOCALFOV ), CVAR_USERINFO ); // @@ -2505,6 +2510,7 @@ static void CL_InitLocal ( void ) { Cmd_AddMacro( "cl_ups", CL_Ups_m ); Cmd_AddMacro( "cl_fps", CL_Fps_m ); Cmd_AddMacro( "cl_ping", CL_Ping_m ); + Cmd_AddMacro( "cl_lag", CL_Lag_m ); Cmd_AddMacro( "cl_health", CL_Health_m ); Cmd_AddMacro( "cl_ammo", CL_Ammo_m ); Cmd_AddMacro( "cl_armor", CL_Armor_m ); @@ -2960,7 +2966,7 @@ static void CL_WriteConfig( void ) { =============== CL_Shutdown -FIXME: this is a callback from Sys_Quit and Com_Error. It would be better +FIXME: this is a callback from Com_Quit and Com_Error. It would be better to run quit through here before the final handoff to the sys code. =============== */ |