r1245 - in trunk/code: qcommon server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Dec 31 17:35:22 EST 2007


Author: tjw
Date: 2007-12-31 17:35:22 -0500 (Mon, 31 Dec 2007)
New Revision: 1245

Modified:
   trunk/code/qcommon/common.c
   trunk/code/server/sv_init.c
Log:
* send along the reason for disconnection when sending the disconnect 
  cmd to all clients in SV_FinalMessage()
* on Com_Error(), set the cvar "com_errorCode" with the errorParm_t integer
  value for the error.  This can be used by a mod's ui to an draw error
  dialog specific for the error (e.g. Reconnect button on ERR_SERVERDISCONNECT)


Modified: trunk/code/qcommon/common.c
===================================================================
--- trunk/code/qcommon/common.c	2007-12-31 16:11:29 UTC (rev 1244)
+++ trunk/code/qcommon/common.c	2007-12-31 22:35:22 UTC (rev 1245)
@@ -244,6 +244,8 @@
 	static int	errorCount;
 	int			currentTime;
 
+	Cvar_Set( "com_errorCode", va( "%i", code ) );
+
 	// when we are running automated scripts, make sure we
 	// know if anything failed
 	if ( com_buildScript && com_buildScript->integer ) {

Modified: trunk/code/server/sv_init.c
===================================================================
--- trunk/code/server/sv_init.c	2007-12-31 16:11:29 UTC (rev 1244)
+++ trunk/code/server/sv_init.c	2007-12-31 22:35:22 UTC (rev 1245)
@@ -708,7 +708,7 @@
 				// don't send a disconnect to a local client
 				if ( cl->netchan.remoteAddress.type != NA_LOOPBACK ) {
 					SV_SendServerCommand( cl, "print \"%s\n\"\n", message );
-					SV_SendServerCommand( cl, "disconnect" );
+					SV_SendServerCommand( cl, "disconnect \"%s\"", message );
 				}
 				// force a snapshot to be sent
 				cl->nextSnapshotTime = -1;




More information about the quake3-commits mailing list