[iortcw] 165/497: All: Align the master server defines closer to ioq3

Simon McVittie smcv at debian.org
Fri Sep 8 10:36:44 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit ea0c9c6b5c487a33423cfe701bb45ebbb2e045a4
Author: M4N4T4RMS at gmail.com <M4N4T4RMS at gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date:   Wed Jul 23 20:13:15 2014 +0000

    All: Align the master server defines closer to ioq3
---
 MP/code/client/cl_main.c   |  3 +++
 MP/code/qcommon/q_shared.h | 13 +++++++++----
 MP/code/server/sv_main.c   | 19 +++++--------------
 SP/code/client/cl_main.c   |  3 +++
 SP/code/qcommon/q_shared.h | 15 ++++++++++-----
 SP/code/server/sv_main.c   | 19 +++++--------------
 6 files changed, 35 insertions(+), 37 deletions(-)

diff --git a/MP/code/client/cl_main.c b/MP/code/client/cl_main.c
index a414cb0..2150940 100644
--- a/MP/code/client/cl_main.c
+++ b/MP/code/client/cl_main.c
@@ -4847,6 +4847,9 @@ void CL_GlobalServers_f( void ) {
 				com_gamename->string, Cmd_Argv(2));
 		}
 	}
+	else if ( !Q_stricmp( com_gamename->string, LEGACY_MASTER_GAMENAME ) )
+		Com_sprintf(command, sizeof(command), "getservers %s",
+			Cmd_Argv(2));
 	else
 		Com_sprintf(command, sizeof(command), "getservers %s %s",
 			com_gamename->string, Cmd_Argv(2));
diff --git a/MP/code/qcommon/q_shared.h b/MP/code/qcommon/q_shared.h
index 6260848..ce39bd4 100644
--- a/MP/code/qcommon/q_shared.h
+++ b/MP/code/qcommon/q_shared.h
@@ -54,8 +54,6 @@ If you have questions concerning this license or the applicable additional terms
   #define HOMEPATH_NAME_MACOSX		HOMEPATH_NAME_WIN
   #define GAMENAME_FOR_MASTER		"foobar"	// must NOT contain whitespace
 // #define LEGACY_PROTOCOL	// You probably don't need this for your standalone game
-// Heartbeat for dpmaster protocol. You shouldn't change this unless you know what you're doing
-  #define HEARTBEAT_FOR_MASTER		"DarkPlaces"
 #else
   #define PRODUCT_NAME			"iortcw"
   #define OLD_PRODUCT_NAME		"Wolf"
@@ -67,10 +65,17 @@ If you have questions concerning this license or the applicable additional terms
   #define HOMEPATH_NAME_MACOSX		HOMEPATH_NAME_WIN
   #define GAMENAME_FOR_MASTER		"wolfmp"
   #define LEGACY_PROTOCOL
-  #define HEARTBEAT_GAME  "Wolfenstein-1"
-  #define HEARTBEAT_DEAD  "WolfFlatline-1"
 #endif
 
+// Heartbeat for dpmaster protocol. You shouldn't change this unless you know what you're doing
+#define HEARTBEAT_FOR_MASTER		"DarkPlaces"
+#define FLATLINE_FOR_MASTER		"WolfFlatline-1"
+
+// When com_gamename is LEGACY_MASTER_GAMENAME, use wolfenstein master protocol.
+// You shouldn't change this unless you know what you're doing
+#define LEGACY_MASTER_GAMENAME		"wolfmp"
+#define LEGACY_HEARTBEAT_FOR_MASTER	"Wolfenstein-1"
+
 #ifndef PRODUCT_VERSION
   #define PRODUCT_VERSION "1.42b"
 #endif
diff --git a/MP/code/server/sv_main.c b/MP/code/server/sv_main.c
index 071c4fd..373ba46 100644
--- a/MP/code/server/sv_main.c
+++ b/MP/code/server/sv_main.c
@@ -261,6 +261,9 @@ void SV_MasterHeartbeat(const char *message)
 	if ( svs.time < svs.nextHeartbeatTime ) 
 		return;
 
+	if ( !Q_stricmp( com_gamename->string, LEGACY_MASTER_GAMENAME ) )
+		message = LEGACY_HEARTBEAT_FOR_MASTER;
+
 	svs.nextHeartbeatTime = svs.time + HEARTBEAT_MSEC;
 
 	// send to group masters
@@ -431,19 +434,11 @@ Informs all masters that this server is going down
 void SV_MasterShutdown( void ) {
 	// send a heartbeat right now
 	svs.nextHeartbeatTime = -9999;
-#ifdef STANDALONE
-	SV_MasterHeartbeat(HEARTBEAT_FOR_MASTER);
-#else
-	SV_MasterHeartbeat(HEARTBEAT_DEAD);
-#endif
+	SV_MasterHeartbeat(FLATLINE_FOR_MASTER);
 
 	// send it again to minimize chance of drops
 	svs.nextHeartbeatTime = -9999;
-#ifdef STANDALONE
-	SV_MasterHeartbeat(HEARTBEAT_FOR_MASTER);
-#else
-	SV_MasterHeartbeat(HEARTBEAT_DEAD);
-#endif
+	SV_MasterHeartbeat(FLATLINE_FOR_MASTER);
 
 	// when the master tries to poll the server, it won't respond, so
 	// it will be removed from the list
@@ -1434,11 +1429,7 @@ void SV_Frame( int msec ) {
 	SV_SendClientMessages();
 
 	// send a heartbeat to the master if needed
-#ifdef STANDALONE
 	SV_MasterHeartbeat(HEARTBEAT_FOR_MASTER);
-#else
-	SV_MasterHeartbeat(HEARTBEAT_GAME);
-#endif
 }
 
 /*
diff --git a/SP/code/client/cl_main.c b/SP/code/client/cl_main.c
index 48cfc51..164aff7 100644
--- a/SP/code/client/cl_main.c
+++ b/SP/code/client/cl_main.c
@@ -4425,6 +4425,9 @@ void CL_GlobalServers_f( void ) {
 				com_gamename->string, Cmd_Argv(2));
 		}
 	}
+	else if ( !Q_stricmp( com_gamename->string, LEGACY_MASTER_GAMENAME ) )
+		Com_sprintf(command, sizeof(command), "getservers %s",
+			Cmd_Argv(2));
 	else
 		Com_sprintf(command, sizeof(command), "getservers %s %s",
 			com_gamename->string, Cmd_Argv(2));
diff --git a/SP/code/qcommon/q_shared.h b/SP/code/qcommon/q_shared.h
index 1bdcdf2..0e80891 100644
--- a/SP/code/qcommon/q_shared.h
+++ b/SP/code/qcommon/q_shared.h
@@ -50,8 +50,6 @@ If you have questions concerning this license or the applicable additional terms
   #define HOMEPATH_NAME_MACOSX		HOMEPATH_NAME_WIN
   #define GAMENAME_FOR_MASTER		"foobar"	// must NOT contain whitespace
 //  #define LEGACY_PROTOCOL	// You probably don't need this for your standalone game
-// Heartbeat for dpmaster protocol. You shouldn't change this unless you know what you're doing
-  #define HEARTBEAT_FOR_MASTER		"DarkPlaces"
 #else
   #define PRODUCT_NAME			"iortcw"
   #define BASEGAME			"main"
@@ -60,12 +58,19 @@ If you have questions concerning this license or the applicable additional terms
   #define HOMEPATH_NAME_UNIX		".iortcw"
   #define HOMEPATH_NAME_WIN		"RTCW"
   #define HOMEPATH_NAME_MACOSX		HOMEPATH_NAME_WIN
-  #define GAMENAME_FOR_MASTER		"wolfmp"
+  #define GAMENAME_FOR_MASTER		"wolfsp"
   #define LEGACY_PROTOCOL
-  #define HEARTBEAT_GAME  "Wolfenstein-1"
-  #define HEARTBEAT_DEAD  "WolfFlatline-1"
 #endif
 
+// Heartbeat for dpmaster protocol. You shouldn't change this unless you know what you're doing
+#define HEARTBEAT_FOR_MASTER		"DarkPlaces"
+#define FLATLINE_FOR_MASTER		"WolfFlatline-1"
+
+// When com_gamename is LEGACY_MASTER_GAMENAME, use wolfenstein master protocol.
+// You shouldn't change this unless you know what you're doing
+#define LEGACY_MASTER_GAMENAME		"wolfsp"
+#define LEGACY_HEARTBEAT_FOR_MASTER	"Wolfenstein-1"
+
 #ifndef PRODUCT_VERSION
   #define PRODUCT_VERSION "1.42b"
 #endif
diff --git a/SP/code/server/sv_main.c b/SP/code/server/sv_main.c
index a035afe..5cd3cea 100644
--- a/SP/code/server/sv_main.c
+++ b/SP/code/server/sv_main.c
@@ -268,6 +268,9 @@ void SV_MasterHeartbeat(const char *message)
 	if ( svs.time < svs.nextHeartbeatTime )
 		return;
 
+	if ( !Q_stricmp( com_gamename->string, LEGACY_MASTER_GAMENAME ) )
+		message = LEGACY_HEARTBEAT_FOR_MASTER;
+
 	svs.nextHeartbeatTime = svs.time + HEARTBEAT_MSEC;
 
 	// send to group masters
@@ -350,19 +353,11 @@ Informs all masters that this server is going down
 void SV_MasterShutdown( void ) {
 	// send a heartbeat right now
 	svs.nextHeartbeatTime = -9999;
-#ifdef STANDALONE
-	SV_MasterHeartbeat(HEARTBEAT_FOR_MASTER);
-#else
-	SV_MasterHeartbeat(HEARTBEAT_DEAD);
-#endif
+	SV_MasterHeartbeat(FLATLINE_FOR_MASTER);
 
 	// send it again to minimize chance of drops
 	svs.nextHeartbeatTime = -9999;
-#ifdef STANDALONE
-	SV_MasterHeartbeat(HEARTBEAT_FOR_MASTER);
-#else
-	SV_MasterHeartbeat(HEARTBEAT_DEAD);
-#endif
+	SV_MasterHeartbeat(FLATLINE_FOR_MASTER);
 
 	// when the master tries to poll the server, it won't respond, so
 	// it will be removed from the list
@@ -1182,11 +1177,7 @@ void SV_Frame( int msec ) {
 	SV_SendClientMessages();
 
 	// send a heartbeat to the master if needed
-#ifdef STANDALONE
 	SV_MasterHeartbeat(HEARTBEAT_FOR_MASTER);
-#else
-	SV_MasterHeartbeat(HEARTBEAT_GAME);
-#endif
 }
 
 /*

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list