[iortcw] 108/152: All: Add build option to enable / disable use of auth server
Simon McVittie
smcv at debian.org
Fri Sep 8 10:40:19 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to annotated tag 1.5a
in repository iortcw.
commit 041444759206880d47109d7733f833abf9b4b1a9
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date: Sun Sep 11 18:44:36 2016 -0400
All: Add build option to enable / disable use of auth server
idSoftware's auth servers have been decommissioned
---
MP/Makefile | 8 ++++++++
MP/code/client/cl_main.c | 4 ++++
MP/code/qcommon/qcommon.h | 4 +++-
MP/code/server/sv_ccmds.c | 4 ++++
MP/code/server/sv_client.c | 4 ++++
MP/code/server/sv_main.c | 2 ++
SP/Makefile | 8 ++++++++
SP/code/client/cl_main.c | 4 ++++
SP/code/qcommon/qcommon.h | 2 ++
SP/code/server/sv_ccmds.c | 4 ++++
SP/code/server/sv_client.c | 4 ++++
SP/code/server/sv_main.c | 2 ++
12 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/MP/Makefile b/MP/Makefile
index d9c737c..d60f8ab 100644
--- a/MP/Makefile
+++ b/MP/Makefile
@@ -285,6 +285,10 @@ ifndef USE_PBMD5
USE_PBMD5=1
endif
+ifndef USE_AUTHORIZE_SERVER
+USE_AUTHORIZE_SERVER=0
+endif
+
#############################################################################
@@ -1140,6 +1144,10 @@ ifeq ($(BUILD_STANDALONE),1)
BASE_CFLAGS += -DSTANDALONE
endif
+ifeq ($(USE_AUTHORIZE_SERVER),1)
+ BASE_CFLAGS += -DUSE_AUTHORIZE_SERVER
+endif
+
ifeq ($(GENERATE_DEPENDENCIES),1)
DEPEND_CFLAGS = -MMD
else
diff --git a/MP/code/client/cl_main.c b/MP/code/client/cl_main.c
index 752fd2e..3b3320f 100644
--- a/MP/code/client/cl_main.c
+++ b/MP/code/client/cl_main.c
@@ -1686,6 +1686,7 @@ in anyway.
===================
*/
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
void CL_RequestAuthorization( void ) {
char nums[64];
int i, j, l;
@@ -1730,6 +1731,7 @@ void CL_RequestAuthorization( void ) {
NET_OutOfBandPrint(NS_CLIENT, cls.authorizeServer, "getKeyAuthorize %i %s", fs->integer, nums );
}
#endif
+#endif
/*
======================================================================
@@ -2506,9 +2508,11 @@ void CL_CheckForResend( void ) {
case CA_CONNECTING:
// requesting a challenge .. IPv6 users always get in as authorize server supports no ipv6.
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
if (!com_standalone->integer && clc.serverAddress.type == NA_IP && !Sys_IsLANAddress( clc.serverAddress ) )
CL_RequestAuthorization();
#endif
+#endif
// The challenge request shall be followed by a client challenge so no malicious server can hijack this connection.
// Add the gamename so the server knows we're running the correct game or can reject the client
diff --git a/MP/code/qcommon/qcommon.h b/MP/code/qcommon/qcommon.h
index 50cb5e9..4be7ba2 100644
--- a/MP/code/qcommon/qcommon.h
+++ b/MP/code/qcommon/qcommon.h
@@ -306,13 +306,15 @@ extern int demo_protocols[];
#endif
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
#ifndef AUTHORIZE_SERVER_NAME
- #define AUTHORIZE_SERVER_NAME "wolfauthorize.idsoftware.com"
+ #define AUTHORIZE_SERVER_NAME "wolfauthorize.idsoftware.com" // Decommissioned
#endif
#ifndef PORT_AUTHORIZE
#define PORT_AUTHORIZE 27952
#endif
#endif
+#endif
//#define AUTOUPDATE_SERVER_NAME "foobar"
diff --git a/MP/code/server/sv_ccmds.c b/MP/code/server/sv_ccmds.c
index 69c9e29..bcfe70f 100644
--- a/MP/code/server/sv_ccmds.c
+++ b/MP/code/server/sv_ccmds.c
@@ -697,6 +697,7 @@ static void SV_KickNum_f( void ) {
}
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
// these functions require the auth server which of course is not available anymore for stand-alone games.
/*
@@ -809,6 +810,7 @@ static void SV_BanNum_f( void ) {
}
}
#endif
+#endif
/*
==================
@@ -1618,12 +1620,14 @@ void SV_AddOperatorCommands( void ) {
Cmd_AddCommand( "heartbeat", SV_Heartbeat_f );
Cmd_AddCommand( "kick", SV_Kick_f );
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
if(!com_standalone->integer)
{
Cmd_AddCommand ("banUser", SV_Ban_f);
Cmd_AddCommand ("banClient", SV_BanNum_f);
}
#endif
+#endif
Cmd_AddCommand ("kickbots", SV_KickBots_f);
Cmd_AddCommand ("kickall", SV_KickAll_f);
Cmd_AddCommand ("kicknum", SV_KickNum_f);
diff --git a/MP/code/server/sv_client.c b/MP/code/server/sv_client.c
index 74684b5..6d03c24 100644
--- a/MP/code/server/sv_client.c
+++ b/MP/code/server/sv_client.c
@@ -151,6 +151,7 @@ void SV_GetChallenge( netadr_t from )
challenge->time = svs.time;
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
// Drop the authorize stuff if this client is coming in via v6 as the auth server does not support ipv6.
// Drop also for addresses coming in on local LAN and for stand-alone games independent from id's assets.
if(challenge->adr.type == NA_IP && !com_standalone->integer && !Sys_IsLANAddress(from))
@@ -204,6 +205,7 @@ void SV_GetChallenge( netadr_t from )
}
}
#endif
+#endif
challenge->pingTime = svs.time;
NET_OutOfBandPrint(NS_SERVER, challenge->adr, "challengeResponse %d %d %d %d",
@@ -212,6 +214,7 @@ void SV_GetChallenge( netadr_t from )
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
/*
====================
SV_AuthorizeIpPacket
@@ -286,6 +289,7 @@ void SV_AuthorizeIpPacket( netadr_t from ) {
Com_Memset( challengeptr, 0, sizeof(*challengeptr) );
}
#endif
+#endif
/*
==================
diff --git a/MP/code/server/sv_main.c b/MP/code/server/sv_main.c
index 6ddda3f..7f94e3c 100644
--- a/MP/code/server/sv_main.c
+++ b/MP/code/server/sv_main.c
@@ -1050,9 +1050,11 @@ static void SV_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
} else if ( !Q_stricmp( c,"connect" ) ) {
SV_DirectConnect( from );
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
} else if ( !Q_stricmp( c,"ipAuthorize" ) ) {
SV_AuthorizeIpPacket( from );
#endif
+#endif
} else if ( !Q_stricmp( c, "rcon" ) ) {
SVC_RemoteCommand( from, msg );
// DHM - Nerve
diff --git a/SP/Makefile b/SP/Makefile
index 4316045..94d85f6 100644
--- a/SP/Makefile
+++ b/SP/Makefile
@@ -274,6 +274,10 @@ ifndef RASPBERRY_PI
RASPBERRY_PI=0
endif
+ifndef USE_AUTHORIZE_SERVER
+USE_AUTHORIZE_SERVER=0
+endif
+
#############################################################################
@@ -1125,6 +1129,10 @@ ifeq ($(BUILD_STANDALONE),1)
BASE_CFLAGS += -DSTANDALONE
endif
+ifeq ($(USE_AUTHORIZE_SERVER),1)
+ BASE_CFLAGS += -DUSE_AUTHORIZE_SERVER
+endif
+
ifeq ($(GENERATE_DEPENDENCIES),1)
DEPEND_CFLAGS = -MMD
else
diff --git a/SP/code/client/cl_main.c b/SP/code/client/cl_main.c
index af10013..6e56793 100644
--- a/SP/code/client/cl_main.c
+++ b/SP/code/client/cl_main.c
@@ -1614,6 +1614,7 @@ in anyway.
===================
*/
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
void CL_RequestAuthorization( void ) {
char nums[64];
int i, j, l;
@@ -1658,6 +1659,7 @@ void CL_RequestAuthorization( void ) {
NET_OutOfBandPrint(NS_CLIENT, cls.authorizeServer, "getKeyAuthorize %i %s", fs->integer, nums );
}
#endif
+#endif
/*
======================================================================
@@ -2361,9 +2363,11 @@ void CL_CheckForResend( void ) {
case CA_CONNECTING:
// requesting a challenge .. IPv6 users always get in as authorize server supports no ipv6.
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
if (!com_standalone->integer && clc.serverAddress.type == NA_IP && !Sys_IsLANAddress( clc.serverAddress ) )
CL_RequestAuthorization();
#endif
+#endif
// The challenge request shall be followed by a client challenge so no malicious server can hijack this connection.
// Add the gamename so the server knows we're running the correct game or can reject the client
diff --git a/SP/code/qcommon/qcommon.h b/SP/code/qcommon/qcommon.h
index 570efe1..707fcd6 100644
--- a/SP/code/qcommon/qcommon.h
+++ b/SP/code/qcommon/qcommon.h
@@ -294,6 +294,7 @@ extern int demo_protocols[];
#endif
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
#ifndef AUTHORIZE_SERVER_NAME
#define AUTHORIZE_SERVER_NAME "authorize.gmistudios.com"
#endif
@@ -301,6 +302,7 @@ extern int demo_protocols[];
#define PORT_AUTHORIZE 27952
#endif
#endif
+#endif
#define PORT_MASTER 27950
#define PORT_UPDATE 27951
diff --git a/SP/code/server/sv_ccmds.c b/SP/code/server/sv_ccmds.c
index ab67154..078bd41 100644
--- a/SP/code/server/sv_ccmds.c
+++ b/SP/code/server/sv_ccmds.c
@@ -714,6 +714,7 @@ static void SV_KickNum_f( void ) {
}
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
// these functions require the auth server which of course is not available anymore for stand-alone games.
/*
@@ -826,6 +827,7 @@ static void SV_BanNum_f( void ) {
}
}
#endif
+#endif
/*
==================
@@ -1624,12 +1626,14 @@ void SV_AddOperatorCommands( void ) {
Cmd_AddCommand( "heartbeat", SV_Heartbeat_f );
Cmd_AddCommand( "kick", SV_Kick_f );
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
if(!com_standalone->integer)
{
Cmd_AddCommand ("banUser", SV_Ban_f);
Cmd_AddCommand ("banClient", SV_BanNum_f);
}
#endif
+#endif
Cmd_AddCommand ("kickbots", SV_KickBots_f);
Cmd_AddCommand ("kickall", SV_KickAll_f);
Cmd_AddCommand ("kicknum", SV_KickNum_f);
diff --git a/SP/code/server/sv_client.c b/SP/code/server/sv_client.c
index 39e7425..5c73f9f 100644
--- a/SP/code/server/sv_client.c
+++ b/SP/code/server/sv_client.c
@@ -152,6 +152,7 @@ void SV_GetChallenge(netadr_t from)
challenge->time = svs.time;
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
// Drop the authorize stuff if this client is coming in via v6 as the auth server does not support ipv6.
// Drop also for addresses coming in on local LAN and for stand-alone games independent from id's assets.
if(challenge->adr.type == NA_IP && !com_standalone->integer && !Sys_IsLANAddress(from))
@@ -203,6 +204,7 @@ void SV_GetChallenge(netadr_t from)
}
}
#endif
+#endif
challenge->pingTime = svs.time;
NET_OutOfBandPrint(NS_SERVER, challenge->adr, "challengeResponse %d %d %d",
@@ -210,6 +212,7 @@ void SV_GetChallenge(netadr_t from)
}
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
/*
====================
SV_AuthorizeIpPacket
@@ -284,6 +287,7 @@ void SV_AuthorizeIpPacket( netadr_t from ) {
Com_Memset( challengeptr, 0, sizeof(*challengeptr) );
}
#endif
+#endif
/*
==================
diff --git a/SP/code/server/sv_main.c b/SP/code/server/sv_main.c
index c478a54..0f29b65 100644
--- a/SP/code/server/sv_main.c
+++ b/SP/code/server/sv_main.c
@@ -820,9 +820,11 @@ static void SV_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
} else if ( !Q_stricmp( c,"connect" ) ) {
SV_DirectConnect( from );
#ifndef STANDALONE
+#ifdef USE_AUTHORIZE_SERVER
} else if ( !Q_stricmp( c,"ipAuthorize" ) ) {
SV_AuthorizeIpPacket( from );
#endif
+#endif
} else if ( !Q_stricmp( c, "rcon" ) ) {
SVC_RemoteCommand( from, msg );
} else if ( !Q_stricmp( c,"disconnect" ) ) {
--
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