aboutsummaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-04-09 23:43:30 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-04-09 23:43:30 +0000
commitab59cd3f0e9f0261007f844f0853fbd9d29f856a (patch)
tree42e83b21a5b5903fe5dd7191ef2ff198d189290f /code
parentfd55fbe832148411137d50e2afa6ca2bc0197d0e (diff)
downloadioquake3-aero-ab59cd3f0e9f0261007f844f0853fbd9d29f856a.tar.gz
ioquake3-aero-ab59cd3f0e9f0261007f844f0853fbd9d29f856a.zip
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
Diffstat (limited to 'code')
-rw-r--r--code/client/cl_main.c5
-rw-r--r--code/qcommon/files.c6
-rw-r--r--code/qcommon/q_shared.h21
-rw-r--r--code/qcommon/qcommon.h13
-rw-r--r--code/server/server.h2
-rw-r--r--code/server/sv_ccmds.c6
-rw-r--r--code/server/sv_client.c11
-rw-r--r--code/server/sv_main.c2
8 files changed, 48 insertions, 18 deletions
diff --git a/code/client/cl_main.c b/code/client/cl_main.c
index 0d373bb..8df950b 100644
--- a/code/client/cl_main.c
+++ b/code/client/cl_main.c
@@ -1004,6 +1004,7 @@ If no response is received from the authorize server after two tries, the client
in anyway.
===================
*/
+#ifndef STANDALONE
void CL_RequestAuthorization( void ) {
char nums[64];
int i, j, l;
@@ -1047,7 +1048,7 @@ void CL_RequestAuthorization( void ) {
NET_OutOfBandPrint(NS_CLIENT, cls.authorizeServer, "getKeyAuthorize %i %s", fs->integer, nums );
}
-
+#endif
/*
======================================================================
@@ -1710,9 +1711,11 @@ void CL_CheckForResend( void ) {
switch ( cls.state ) {
case CA_CONNECTING:
// requesting a challenge .. IPv6 users always get in as authorize server supports no ipv6.
+#ifndef STANDALONE
if ( clc.serverAddress.type == NA_IP && !Sys_IsLANAddress( clc.serverAddress ) ) {
CL_RequestAuthorization();
}
+#endif
NET_OutOfBandPrint(NS_CLIENT, clc.serverAddress, "getchallenge");
break;
diff --git a/code/qcommon/files.c b/code/qcommon/files.c
index a1d3312..32a24da 100644
--- a/code/qcommon/files.c
+++ b/code/qcommon/files.c
@@ -2795,6 +2795,7 @@ static void FS_Startup( const char *gameName )
Com_Printf( "%d files in pk3 files\n", fs_packFiles );
}
+#ifndef STANDALONE
/*
===================
FS_CheckPak0
@@ -2891,6 +2892,7 @@ static void FS_CheckPak0( void )
Com_Error(ERR_FATAL, "You need to install Quake III Arena in order to play");
}
}
+#endif
/*
=====================
@@ -3262,7 +3264,9 @@ void FS_InitFilesystem( void ) {
// try to start up normally
FS_Startup( BASEGAME );
+#ifndef STANDALONE
FS_CheckPak0( );
+#endif
// if we can't find default.cfg, assume that the paths are
// busted and error out now, rather than getting an unreadable
@@ -3295,7 +3299,9 @@ void FS_Restart( int checksumFeed ) {
// try to start up normally
FS_Startup( BASEGAME );
+#ifndef STANDALONE
FS_CheckPak0( );
+#endif
// if we can't find default.cfg, assume that the paths are
// busted and error out now, rather than getting an unreadable
diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h
index 81083d1..d1f8d2a 100644
--- a/code/qcommon/q_shared.h
+++ b/code/qcommon/q_shared.h
@@ -26,8 +26,19 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// q_shared.h -- included first by ALL program modules.
// A user mod should never modify this file
-#define PRODUCT_NAME "ioq3"
-#define PRODUCT_VERSION "1.35"
+#ifdef STANDALONE
+ #define PRODUCT_NAME "iofoo3"
+ #define PRODUCT_VERSION "-1"
+ #define BASEGAME "foobar"
+ #define CLIENT_WINDOW_TITLE "changeme"
+ #define CLIENT_WINDOW_MIN_TITLE "changeme2"
+#else
+ #define PRODUCT_NAME "ioq3"
+ #define PRODUCT_VERSION "1.35"
+ #define BASEGAME "baseq3"
+ #define CLIENT_WINDOW_TITLE "ioquake3"
+ #define CLIENT_WINDOW_MIN_TITLE "ioq3"
+#endif
#ifdef SVN_VERSION
# define Q3_VERSION PRODUCT_NAME " " SVN_VERSION
@@ -35,12 +46,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# define Q3_VERSION PRODUCT_NAME " " PRODUCT_VERSION
#endif
-#define CLIENT_WINDOW_TITLE "ioquake3"
-#define CLIENT_WINDOW_MIN_TITLE "ioq3"
-// 1.32 released 7-10-2002
-
-#define BASEGAME "baseq3"
-
#define MAX_TEAMNAME 32
#ifdef _MSC_VER
diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h
index d47bb21..1bd1c3d 100644
--- a/code/qcommon/qcommon.h
+++ b/code/qcommon/qcommon.h
@@ -243,15 +243,18 @@ extern int demo_protocols[];
#ifndef MASTER_SERVER_NAME
#define MASTER_SERVER_NAME "master.quake3arena.com"
#endif
-#ifndef AUTHORIZE_SERVER_NAME
-#define AUTHORIZE_SERVER_NAME "authorize.quake3arena.com"
+
+#ifndef STANDALONE
+ #ifndef AUTHORIZE_SERVER_NAME
+ #define AUTHORIZE_SERVER_NAME "authorize.quake3arena.com"
+ #endif
+ #ifndef PORT_AUTHORIZE
+ #define PORT_AUTHORIZE 27952
+ #endif
#endif
#define PORT_MASTER 27950
#define PORT_UPDATE 27951
-#ifndef PORT_AUTHORIZE
-#define PORT_AUTHORIZE 27952
-#endif
#define PORT_SERVER 27960
#define NUM_SERVER_PORTS 4 // broadcast scan this many ports after
// PORT_SERVER so a single machine can
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")) {