r738 - in trunk/code: client server unix

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu May 4 09:59:58 EDT 2006


Author: thilo
Date: 2006-05-04 09:59:58 -0400 (Thu, 04 May 2006)
New Revision: 738

Modified:
   trunk/code/client/cl_main.c
   trunk/code/server/sv_init.c
   trunk/code/unix/linux_signals.c
Log:
- Added SV_Shutdown to Linux signal handler to ensure that clients don't hang when server gets killed, as suggested by Tony J. White
- Added newline to final message sent to clients.
- Added check for whether client is running at all before CL_Shutdown runs through.


Modified: trunk/code/client/cl_main.c
===================================================================
--- trunk/code/client/cl_main.c	2006-05-02 21:20:07 UTC (rev 737)
+++ trunk/code/client/cl_main.c	2006-05-04 13:59:58 UTC (rev 738)
@@ -2564,6 +2564,10 @@
 void CL_Shutdown( void ) {
 	static qboolean recursive = qfalse;
 	
+	// check whether the client is running at all.
+	if(!(com_cl_running && com_cl_running->integer))
+		return;
+	
 	Com_Printf( "----- CL_Shutdown -----\n" );
 
 	if ( recursive ) {

Modified: trunk/code/server/sv_init.c
===================================================================
--- trunk/code/server/sv_init.c	2006-05-02 21:20:07 UTC (rev 737)
+++ trunk/code/server/sv_init.c	2006-05-04 13:59:58 UTC (rev 738)
@@ -646,7 +646,7 @@
 			if (cl->state >= CS_CONNECTED) {
 				// don't send a disconnect to a local client
 				if ( cl->netchan.remoteAddress.type != NA_LOOPBACK ) {
-					SV_SendServerCommand( cl, "print \"%s\"\n", message );
+					SV_SendServerCommand( cl, "print \"%s\n\"\n", message );
 					SV_SendServerCommand( cl, "disconnect" );
 				}
 				// force a snapshot to be sent

Modified: trunk/code/unix/linux_signals.c
===================================================================
--- trunk/code/unix/linux_signals.c	2006-05-02 21:20:07 UTC (rev 737)
+++ trunk/code/unix/linux_signals.c	2006-05-04 13:59:58 UTC (rev 738)
@@ -46,6 +46,7 @@
   // rcg08312005 Agreed: changed to CL_Shutdown...  --ryan.
   CL_Shutdown();
 #endif
+  SV_Shutdown("Signal caught");
   Sys_Exit(0); // bk010104 - abstraction NOTE TTimo send a 0 to avoid DOUBLE SIGNAL FAULT
 }
 




More information about the quake3-commits mailing list