diff options
author | Tim Angus <tim@ngus.net> | 2005-12-28 02:32:43 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2005-12-28 02:32:43 +0000 |
commit | 1dc7e94283f026b17c1e793cbf7542872812ffda (patch) | |
tree | 33de56bca208626f1e7c77853255afc2b8244279 /src/server | |
parent | 4b614e63d7da358a8a30e61a89365add79ecde9c (diff) |
* Added master server to source, based on dpmaster
* Removed gametype, fraglimit and dmflags cvars
* Removed CD key authentication stuff
* Implemented a means to save and restore cmd context
* Bumped protocol version up to 69 (same as 68)
* Removed various references to punkbuster
* Maps on create server menu now sorted by name
* Fixed some warnings
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/server.h | 1 | ||||
-rw-r--r-- | src/server/sv_ccmds.c | 11 | ||||
-rw-r--r-- | src/server/sv_client.c | 140 | ||||
-rw-r--r-- | src/server/sv_init.c | 6 | ||||
-rw-r--r-- | src/server/sv_main.c | 6 | ||||
-rw-r--r-- | src/server/sv_rankings.c | 2 |
6 files changed, 12 insertions, 154 deletions
diff --git a/src/server/server.h b/src/server/server.h index 6740a82d..da8c8aae 100644 --- a/src/server/server.h +++ b/src/server/server.h @@ -242,7 +242,6 @@ extern cvar_t *sv_serverid; extern cvar_t *sv_maxRate; extern cvar_t *sv_minPing; extern cvar_t *sv_maxPing; -extern cvar_t *sv_gametype; extern cvar_t *sv_pure; extern cvar_t *sv_floodProtect; extern cvar_t *sv_lanForceRate; diff --git a/src/server/sv_ccmds.c b/src/server/sv_ccmds.c index 9128249f..fde921d1 100644 --- a/src/server/sv_ccmds.c +++ b/src/server/sv_ccmds.c @@ -154,9 +154,6 @@ static void SV_Map_f( void ) { return; } - // force latched values to get set - Cvar_Get ("g_gametype", "0", CVAR_SERVERINFO | CVAR_USERINFO | CVAR_LATCH ); - cmd = Cmd_Argv(0); if ( !Q_stricmp( cmd, "devmap" ) || !Q_stricmp( cmd, "spdevmap" ) ) { cheat = qtrue; @@ -228,7 +225,7 @@ static void SV_MapRestart_f( void ) { // check for changes in variables that can't just be restarted // check for maxclients change - if ( sv_maxclients->modified || sv_gametype->modified ) { + if ( sv_maxclients->modified ) { char mapname[MAX_QPATH]; Com_Printf( "variable change -- restarting.\n" ); @@ -400,6 +397,8 @@ static void SV_Ban_f( void ) { return; } + //FIXME: there is no auth server in Tremulous +#if 0 // look up the authorize server's IP if ( !svs.authorizeAddress.ip[0] && svs.authorizeAddress.type != NA_BAD ) { Com_Printf( "Resolving %s\n", AUTHORIZE_SERVER_NAME ); @@ -421,6 +420,7 @@ static void SV_Ban_f( void ) { cl->netchan.remoteAddress.ip[2], cl->netchan.remoteAddress.ip[3] ); Com_Printf("%s was banned from coming back\n", cl->name); } +#endif } /* @@ -454,6 +454,8 @@ static void SV_BanNum_f( void ) { return; } + //FIXME: there is no auth server in Tremulous +#if 0 // look up the authorize server's IP if ( !svs.authorizeAddress.ip[0] && svs.authorizeAddress.type != NA_BAD ) { Com_Printf( "Resolving %s\n", AUTHORIZE_SERVER_NAME ); @@ -475,6 +477,7 @@ static void SV_BanNum_f( void ) { cl->netchan.remoteAddress.ip[2], cl->netchan.remoteAddress.ip[3] ); Com_Printf("%s was banned from coming back\n", cl->name); } +#endif } /* diff --git a/src/server/sv_client.c b/src/server/sv_client.c index ba32299e..84ce86a0 100644 --- a/src/server/sv_client.c +++ b/src/server/sv_client.c @@ -77,138 +77,9 @@ void SV_GetChallenge( netadr_t from ) { i = oldest; } - // if they are on a lan address, send the challengeResponse immediately - if ( Sys_IsLANAddress( from ) ) { - challenge->pingTime = svs.time; - NET_OutOfBandPrint( NS_SERVER, from, "challengeResponse %i", challenge->challenge ); - return; - } - - // look up the authorize server's IP - if ( !svs.authorizeAddress.ip[0] && svs.authorizeAddress.type != NA_BAD ) { - Com_Printf( "Resolving %s\n", AUTHORIZE_SERVER_NAME ); - if ( !NET_StringToAdr( AUTHORIZE_SERVER_NAME, &svs.authorizeAddress ) ) { - Com_Printf( "Couldn't resolve address\n" ); - return; - } - svs.authorizeAddress.port = BigShort( PORT_AUTHORIZE ); - Com_Printf( "%s resolved to %i.%i.%i.%i:%i\n", AUTHORIZE_SERVER_NAME, - svs.authorizeAddress.ip[0], svs.authorizeAddress.ip[1], - svs.authorizeAddress.ip[2], svs.authorizeAddress.ip[3], - BigShort( svs.authorizeAddress.port ) ); - } - - // if they have been challenging for a long time and we - // haven't heard anything from the authorize server, go ahead and - // let them in, assuming the id server is down - if ( svs.time - challenge->firstTime > AUTHORIZE_TIMEOUT ) { - Com_DPrintf( "authorize server timed out\n" ); - - challenge->pingTime = svs.time; - NET_OutOfBandPrint( NS_SERVER, challenge->adr, - "challengeResponse %i", challenge->challenge ); - return; - } - - // otherwise send their ip to the authorize server - if ( svs.authorizeAddress.type != NA_BAD ) { - cvar_t *fs; - char game[1024]; - - Com_DPrintf( "sending getIpAuthorize for %s\n", NET_AdrToString( from )); - - strcpy(game, BASEGAME); - fs = Cvar_Get ("fs_game", "", CVAR_INIT|CVAR_SYSTEMINFO ); - if (fs && fs->string[0] != 0) { - strcpy(game, fs->string); - } - - // the 0 is for backwards compatibility with obsolete sv_allowanonymous flags - // getIpAuthorize <challenge> <IP> <game> 0 <auth-flag> - NET_OutOfBandPrint( NS_SERVER, svs.authorizeAddress, - "getIpAuthorize %i %i.%i.%i.%i %s 0 %s", svs.challenges[i].challenge, - from.ip[0], from.ip[1], from.ip[2], from.ip[3], game, "0" ); - } -} - -/* -==================== -SV_AuthorizeIpPacket - -A packet has been returned from the authorize server. -If we have a challenge adr for that ip, send the -challengeResponse to it -==================== -*/ -void SV_AuthorizeIpPacket( netadr_t from ) { - int challenge; - int i; - char *s; - char *r; - char ret[1024]; - - if ( !NET_CompareBaseAdr( from, svs.authorizeAddress ) ) { - Com_Printf( "SV_AuthorizeIpPacket: not from authorize server\n" ); - return; - } - - challenge = atoi( Cmd_Argv( 1 ) ); - - for (i = 0 ; i < MAX_CHALLENGES ; i++) { - if ( svs.challenges[i].challenge == challenge ) { - break; - } - } - if ( i == MAX_CHALLENGES ) { - Com_Printf( "SV_AuthorizeIpPacket: challenge not found\n" ); - return; - } - - // send a packet back to the original client - svs.challenges[i].pingTime = svs.time; - s = Cmd_Argv( 2 ); - r = Cmd_Argv( 3 ); // reason - - if ( !Q_stricmp( s, "demo" ) ) { - if ( Cvar_VariableValue( "fs_restrict" ) ) { - // a demo client connecting to a demo server - NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, - "challengeResponse %i", svs.challenges[i].challenge ); - return; - } - // they are a demo client trying to connect to a real server - NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, "print\nServer is not a demo server\n" ); - // clear the challenge record so it won't timeout and let them through - Com_Memset( &svs.challenges[i], 0, sizeof( svs.challenges[i] ) ); - return; - } - if ( !Q_stricmp( s, "accept" ) ) { - NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, - "challengeResponse %i", svs.challenges[i].challenge ); - return; - } - if ( !Q_stricmp( s, "unknown" ) ) { - if (!r) { - NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, "print\nAwaiting CD key authorization\n" ); - } else { - sprintf(ret, "print\n%s\n", r); - NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, ret ); - } - // clear the challenge record so it won't timeout and let them through - Com_Memset( &svs.challenges[i], 0, sizeof( svs.challenges[i] ) ); - return; - } - - // authorization failed - if (!r) { - NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, "print\nSomeone is using this CD Key\n" ); - } else { - sprintf(ret, "print\n%s\n", r); - NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, ret ); - } - - // clear the challenge record so it won't timeout and let them through - Com_Memset( &svs.challenges[i], 0, sizeof( svs.challenges[i] ) ); + // send the challengeResponse + challenge->pingTime = svs.time; + NET_OutOfBandPrint( NS_SERVER, from, "challengeResponse %i", challenge->challenge ); } /* @@ -218,11 +89,6 @@ SV_DirectConnect 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/src/server/sv_init.c b/src/server/sv_init.c index e484edcc..3d08b6ea 100644 --- a/src/server/sv_init.c +++ b/src/server/sv_init.c @@ -442,9 +442,6 @@ void SV_SpawnServer( char *server, qboolean killBots ) { // load and spawn all other entities SV_InitGameProgs(); - // don't allow a map_restart if game is modified - sv_gametype->modified = qfalse; - // run a few frames to allow everything to settle for (i = 0;i < 3; i++) { @@ -572,10 +569,7 @@ void SV_Init (void) { SV_AddOperatorCommands (); // serverinfo vars - Cvar_Get ("dmflags", "0", CVAR_SERVERINFO); - Cvar_Get ("fraglimit", "20", CVAR_SERVERINFO); Cvar_Get ("timelimit", "0", CVAR_SERVERINFO); - sv_gametype = Cvar_Get ("g_gametype", "0", CVAR_SERVERINFO | CVAR_LATCH ); Cvar_Get ("sv_keywords", "", CVAR_SERVERINFO); Cvar_Get ("protocol", va("%i", PROTOCOL_VERSION), CVAR_SERVERINFO | CVAR_ROM); sv_mapname = Cvar_Get ("mapname", "nomap", CVAR_SERVERINFO | CVAR_ROM); diff --git a/src/server/sv_main.c b/src/server/sv_main.c index 6f96ac7f..1d658a60 100644 --- a/src/server/sv_main.c +++ b/src/server/sv_main.c @@ -48,7 +48,6 @@ cvar_t *sv_serverid; cvar_t *sv_maxRate; cvar_t *sv_minPing; cvar_t *sv_maxPing; -cvar_t *sv_gametype; cvar_t *sv_pure; cvar_t *sv_floodProtect; cvar_t *sv_lanForceRate; // dedicated 1 (LAN) server forces local client rates to 99999 (bug #491) @@ -220,7 +219,7 @@ but not on every player enter or exit. ================ */ #define HEARTBEAT_MSEC 300*1000 -#define HEARTBEAT_GAME "QuakeArena-1" +#define HEARTBEAT_GAME "Tremulous" void SV_MasterHeartbeat( void ) { static netadr_t adr[MAX_MASTER_SERVERS]; int i; @@ -400,7 +399,6 @@ void SVC_Info( netadr_t from ) { Info_SetValueForKey( infostring, "clients", va("%i", count) ); Info_SetValueForKey( infostring, "sv_maxclients", va("%i", sv_maxclients->integer - sv_privateClients->integer ) ); - Info_SetValueForKey( infostring, "gametype", va("%i", sv_gametype->integer ) ); Info_SetValueForKey( infostring, "pure", va("%i", sv_pure->integer ) ); if( sv_minPing->integer ) { @@ -531,8 +529,6 @@ void SV_ConnectionlessPacket( netadr_t from, msg_t *msg ) { SV_GetChallenge( from ); } else if (!Q_stricmp(c, "connect")) { SV_DirectConnect( from ); - } else if (!Q_stricmp(c, "ipAuthorize")) { - SV_AuthorizeIpPacket( from ); } else if (!Q_stricmp(c, "rcon")) { SVC_RemoteCommand( from, msg ); } else if (!Q_stricmp(c, "disconnect")) { diff --git a/src/server/sv_rankings.c b/src/server/sv_rankings.c index 023a7a2a..20d24fd4 100644 --- a/src/server/sv_rankings.c +++ b/src/server/sv_rankings.c @@ -86,7 +86,7 @@ void SV_RankBegin( char *gamekey ) assert( !s_rankings_active ); assert( s_ranked_players == NULL ); - if( sv_enableRankings->integer == 0 || Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER ) + if( sv_enableRankings->integer == 0 ) { s_rankings_active = qfalse; if( sv_rankingsActive->integer == 1 ) |