[quake3-commits] r1816 - in trunk/code: client qcommon server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Jan 24 21:04:25 EST 2011


Author: thilo
Date: 2011-01-24 21:04:25 -0500 (Mon, 24 Jan 2011)
New Revision: 1816

Modified:
   trunk/code/client/cl_main.c
   trunk/code/qcommon/q_shared.h
   trunk/code/server/server.h
   trunk/code/server/sv_init.c
Log:
Make number of supported master servers tunable via define


Modified: trunk/code/client/cl_main.c
===================================================================
--- trunk/code/client/cl_main.c	2011-01-24 18:09:20 UTC (rev 1815)
+++ trunk/code/client/cl_main.c	2011-01-25 02:04:25 UTC (rev 1816)
@@ -3717,9 +3717,9 @@
 	char		command[1024], *masteraddress;
 	char		*cmdname;
 	
-	if ((count = Cmd_Argc()) < 3 || (masterNum = atoi(Cmd_Argv(1))) < 0 || masterNum > 4)
+	if ((count = Cmd_Argc()) < 3 || (masterNum = atoi(Cmd_Argv(1))) < 0 || masterNum > MAX_MASTER_SERVERS - 1)
 	{
-		Com_Printf( "usage: globalservers <master# 0-4> <protocol> [keywords]\n");
+		Com_Printf("usage: globalservers <master# 0-%d> <protocol> [keywords]\n", MAX_MASTER_SERVERS - 1);
 		return;	
 	}
 

Modified: trunk/code/qcommon/q_shared.h
===================================================================
--- trunk/code/qcommon/q_shared.h	2011-01-24 18:09:20 UTC (rev 1815)
+++ trunk/code/qcommon/q_shared.h	2011-01-25 02:04:25 UTC (rev 1816)
@@ -48,7 +48,8 @@
 
 #define Q3_VERSION PRODUCT_NAME " " PRODUCT_VERSION
 
-#define MAX_TEAMNAME 32
+#define MAX_TEAMNAME		32
+#define MAX_MASTER_SERVERS      5	// number of supported master servers
 
 #ifdef _MSC_VER
 

Modified: trunk/code/server/server.h
===================================================================
--- trunk/code/server/server.h	2011-01-24 18:09:20 UTC (rev 1815)
+++ trunk/code/server/server.h	2011-01-25 02:04:25 UTC (rev 1816)
@@ -212,10 +212,6 @@
 	qboolean	connected;
 } challenge_t;
 
-
-#define	MAX_MASTERS	8				// max recipients for heartbeat packets
-
-
 // this structure will be cleared only when the game dll changes
 typedef struct {
 	qboolean	initialized;				// sv_init has completed
@@ -252,8 +248,6 @@
 extern	server_t		sv;					// cleared each map
 extern	vm_t			*gvm;				// game virtual machine
 
-#define	MAX_MASTER_SERVERS	5
-
 extern	cvar_t	*sv_fps;
 extern	cvar_t	*sv_timeout;
 extern	cvar_t	*sv_zombietime;

Modified: trunk/code/server/sv_init.c
===================================================================
--- trunk/code/server/sv_init.c	2011-01-24 18:09:20 UTC (rev 1815)
+++ trunk/code/server/sv_init.c	2011-01-25 02:04:25 UTC (rev 1816)
@@ -624,7 +624,10 @@
 Only called at main exe startup, not for each game
 ===============
 */
-void SV_Init (void) {
+void SV_Init (void)
+{
+	int index;
+
 	SV_AddOperatorCommands ();
 
 	// serverinfo vars
@@ -668,11 +671,11 @@
 
 	sv_allowDownload = Cvar_Get ("sv_allowDownload", "0", CVAR_SERVERINFO);
 	Cvar_Get ("sv_dlURL", "", CVAR_SERVERINFO | CVAR_ARCHIVE);
-	sv_master[0] = Cvar_Get ("sv_master1", MASTER_SERVER_NAME, 0 );
-	sv_master[1] = Cvar_Get ("sv_master2", "", CVAR_ARCHIVE );
-	sv_master[2] = Cvar_Get ("sv_master3", "", CVAR_ARCHIVE );
-	sv_master[3] = Cvar_Get ("sv_master4", "", CVAR_ARCHIVE );
-	sv_master[4] = Cvar_Get ("sv_master5", "", CVAR_ARCHIVE );
+	
+	sv_master[0] = Cvar_Get("sv_master1", MASTER_SERVER_NAME, 0);
+	for(index = 1; index < MAX_MASTER_SERVERS; index++)
+		sv_master[index] = Cvar_Get(va("sv_master%d", index + 1), "", CVAR_ARCHIVE);
+
 	sv_reconnectlimit = Cvar_Get ("sv_reconnectlimit", "3", 0);
 	sv_showloss = Cvar_Get ("sv_showloss", "0", 0);
 	sv_padPackets = Cvar_Get ("sv_padPackets", "0", 0);



More information about the quake3-commits mailing list