r584 - trunk/code/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Feb 23 18:10:54 EST 2006


Author: tma
Date: 2006-02-23 18:10:54 -0500 (Thu, 23 Feb 2006)
New Revision: 584

Modified:
   trunk/code/server/sv_init.c
   trunk/code/server/sv_main.c
Log:
* Fix to a bug where servers with long uptimes (~27 days) would consume 100%
  CPU if the running game did not set the nextmap cvar. This patch instead uses
  the mapname server cvar, which is guaranteed to be defined. 


Modified: trunk/code/server/sv_init.c
===================================================================
--- trunk/code/server/sv_init.c	2006-02-23 20:43:34 UTC (rev 583)
+++ trunk/code/server/sv_init.c	2006-02-23 23:10:54 UTC (rev 584)
@@ -671,7 +671,7 @@
 		return;
 	}
 
-	Com_Printf( "----- Server Shutdown -----\n" );
+	Com_Printf( "----- Server Shutdown (%s) -----\n", finalmsg );
 
 	if ( svs.clients && !com_errorEntered ) {
 		SV_FinalMessage( finalmsg );

Modified: trunk/code/server/sv_main.c
===================================================================
--- trunk/code/server/sv_main.c	2006-02-23 20:43:34 UTC (rev 583)
+++ trunk/code/server/sv_main.c	2006-02-23 23:10:54 UTC (rev 584)
@@ -808,13 +808,13 @@
 	// 2giga-milliseconds = 23 days, so it won't be too often
 	if ( svs.time > 0x70000000 ) {
 		SV_Shutdown( "Restarting server due to time wrapping" );
-		Cbuf_AddText( "vstr nextmap\n" );
+		Cbuf_AddText( va( "map %s\n", Cvar_VariableString( "mapname" ) ) );
 		return;
 	}
 	// this can happen considerably earlier when lots of clients play and the map doesn't change
 	if ( svs.nextSnapshotEntities >= 0x7FFFFFFE - svs.numSnapshotEntities ) {
 		SV_Shutdown( "Restarting server due to numSnapshotEntities wrapping" );
-		Cbuf_AddText( "vstr nextmap\n" );
+		Cbuf_AddText( va( "map %s\n", Cvar_VariableString( "mapname" ) ) );
 		return;
 	}
 




More information about the quake3-commits mailing list