From ab59cd3f0e9f0261007f844f0853fbd9d29f856a Mon Sep 17 00:00:00 2001 From: thilo Date: Wed, 9 Apr 2008 23:43:30 +0000 Subject: Include #ifdef to make it easier to create a stand-alone binary. git-svn-id: svn://svn.icculus.org/quake3/trunk@1307 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/server/server.h | 2 ++ code/server/sv_ccmds.c | 6 ++++++ code/server/sv_client.c | 11 +++++++---- code/server/sv_main.c | 2 ++ 4 files changed, 17 insertions(+), 4 deletions(-) (limited to 'code/server') diff --git a/code/server/server.h b/code/server/server.h index 57a49f3..6a7612b 100644 --- a/code/server/server.h +++ b/code/server/server.h @@ -290,7 +290,9 @@ void SV_GetChallenge( netadr_t from ); void SV_DirectConnect( netadr_t from ); +#ifndef STANDALONE void SV_AuthorizeIpPacket( netadr_t from ); +#endif void SV_ExecuteClientMessage( client_t *cl, msg_t *msg ); void SV_UserinfoChanged( client_t *cl ); diff --git a/code/server/sv_ccmds.c b/code/server/sv_ccmds.c index 4e3c592..18dcfbc 100644 --- a/code/server/sv_ccmds.c +++ b/code/server/sv_ccmds.c @@ -397,6 +397,9 @@ static void SV_Kick_f( void ) { cl->lastPacketTime = svs.time; // in case there is a funny zombie } +#ifndef STANDALONE +// these functions require the auth server which of course is not available anymore for stand-alone games. + /* ================== SV_Ban_f @@ -506,6 +509,7 @@ static void SV_BanNum_f( void ) { Com_Printf("%s was banned from coming back\n", cl->name); } } +#endif /* ================== @@ -735,8 +739,10 @@ void SV_AddOperatorCommands( void ) { Cmd_AddCommand ("heartbeat", SV_Heartbeat_f); Cmd_AddCommand ("kick", SV_Kick_f); +#ifndef STANDALONE Cmd_AddCommand ("banUser", SV_Ban_f); Cmd_AddCommand ("banClient", SV_BanNum_f); +#endif Cmd_AddCommand ("clientkick", SV_KickNum_f); Cmd_AddCommand ("status", SV_Status_f); Cmd_AddCommand ("serverinfo", SV_Serverinfo_f); diff --git a/code/server/sv_client.c b/code/server/sv_client.c index 8a85bdc..5345b0e 100644 --- a/code/server/sv_client.c +++ b/code/server/sv_client.c @@ -81,6 +81,10 @@ void SV_GetChallenge( netadr_t from ) { i = oldest; } +#ifdef STANDALONE + challenge->pingTime = svs.time; + NET_OutOfBandPrint( NS_SERVER, from, "challengeResponse %i", challenge->challenge ); +#else // if they are on a lan address, send the challengeResponse immediately if ( Sys_IsLANAddress( from ) ) { challenge->pingTime = svs.time; @@ -144,8 +148,10 @@ void SV_GetChallenge( netadr_t from ) { NET_OutOfBandPrint( NS_SERVER, challenge->adr, "challengeResponse %i", challenge->challenge ); } +#endif } +#ifndef STANDALONE /* ==================== SV_AuthorizeIpPacket @@ -216,6 +222,7 @@ void SV_AuthorizeIpPacket( netadr_t from ) { // clear the challenge record so it won't timeout and let them through Com_Memset( &svs.challenges[i], 0, sizeof( svs.challenges[i] ) ); } +#endif /* ================== @@ -225,10 +232,6 @@ A "connect" OOB command has been received ================== */ -#define PB_MESSAGE "PunkBuster Anti-Cheat software must be installed " \ - "and Enabled in order to join this server. An updated game patch can be downloaded from " \ - "www.idsoftware.com" - void SV_DirectConnect( netadr_t from ) { char userinfo[MAX_INFO_STRING]; int i; diff --git a/code/server/sv_main.c b/code/server/sv_main.c index d0d7c65..0974c83 100644 --- a/code/server/sv_main.c +++ b/code/server/sv_main.c @@ -534,8 +534,10 @@ void SV_ConnectionlessPacket( netadr_t from, msg_t *msg ) { SV_GetChallenge( from ); } else if (!Q_stricmp(c, "connect")) { SV_DirectConnect( from ); +#ifndef STANDALONE } else if (!Q_stricmp(c, "ipAuthorize")) { SV_AuthorizeIpPacket( from ); +#endif } else if (!Q_stricmp(c, "rcon")) { SVC_RemoteCommand( from, msg ); } else if (!Q_stricmp(c, "disconnect")) { -- cgit v1.2.3