summaryrefslogtreecommitdiff
path: root/source/common.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2009-02-05 12:56:45 +0000
committerAndrey Nazarov <skuller@skuller.net>2009-02-05 12:56:45 +0000
commitcb1f4461911154e547a15480ef98199832a2cbf7 (patch)
treecd3b36d543b775268c7a5a4a72ece7c14b2195f0 /source/common.c
parent5dea48daf494adbf28c75cb74e478e5bc15fbff4 (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/common.c')
-rw-r--r--source/common.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/source/common.c b/source/common.c
index 28cd816..dbb9b0b 100644
--- a/source/common.c
+++ b/source/common.c
@@ -423,14 +423,13 @@ void Com_Error( comErrorType_t code, const char *fmt, ... ) {
Com_AbortRedirect();
if( code == ERR_DISCONNECT || code == ERR_SILENT ) {
+ Com_Printf( S_COLOR_YELLOW "%s\n", com_errorMsg );
SV_Shutdown( va( "Server was killed: %s", com_errorMsg ),
KILL_DISCONNECT );
#if USE_CLIENT
CL_Disconnect( code, com_errorMsg );
#endif
- Com_Printf( S_COLOR_YELLOW "%s\n", com_errorMsg );
- recursive = qfalse;
- longjmp( abortframe, -1 );
+ goto abort;
}
if( com_debug_break && com_debug_break->integer ) {
@@ -450,8 +449,7 @@ void Com_Error( comErrorType_t code, const char *fmt, ... ) {
#if USE_CLIENT
CL_Disconnect( ERR_DROP, com_errorMsg );
#endif
- recursive = qfalse;
- longjmp( abortframe, -1 );
+ goto abort;
}
if( com_logFile ) {
@@ -465,8 +463,22 @@ void Com_Error( comErrorType_t code, const char *fmt, ... ) {
Qcommon_Shutdown();
Sys_Error( "%s", com_errorMsg );
+ // doesn't get there
+
+abort:
+ if( com_logFile ) {
+ FS_Flush( com_logFile );
+ }
+ recursive = qfalse;
+ longjmp( abortframe, -1 );
}
+#ifdef _WIN32
+void Com_AbortFrame( void ) {
+ longjmp( abortframe, -1 );
+}
+#endif
+
/*
===================
Com_LevelPrint
@@ -503,7 +515,7 @@ void Com_LevelError( comErrorType_t code, const char *str ) {
Com_Quit
Both client and server can use this, and it will
-do the apropriate things.
+do the apropriate things. This function never returns.
=============
*/
void Com_Quit( const char *reason, killtype_t type ) {