diff options
author | Thilo Schulz <arny@ats.s.bawue.de> | 2011-07-29 13:46:50 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-10 22:55:15 +0000 |
commit | 7f1fee44e5cd45cff829951757f5c6460c06cbe8 (patch) | |
tree | 1e6f6bcf78ded45a20f2b9e7b0652fbc143a0724 /src/server | |
parent | e7c06719510940898e1f7f8215f4137202611308 (diff) |
- Switch master server protocol to dpmaster for better game separation. Based partly on patch by Zack Middleton - Get rid of ugly cvars sv_heartbeat and cl_gamename and replace with single com_gamename - Remove sv_flatline. Flatlines are ignored by dpmaster and are considered to be insecure because flatlines can be udp-spoofed.
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/server.h | 4 | ||||
-rw-r--r-- | src/server/sv_client.c | 4 | ||||
-rw-r--r-- | src/server/sv_init.c | 3 | ||||
-rw-r--r-- | src/server/sv_main.c | 12 |
4 files changed, 8 insertions, 15 deletions
diff --git a/src/server/server.h b/src/server/server.h index de4ecc27..f97782f3 100644 --- a/src/server/server.h +++ b/src/server/server.h @@ -281,9 +281,7 @@ extern cvar_t *sv_minPing; extern cvar_t *sv_maxPing; extern cvar_t *sv_pure; extern cvar_t *sv_lanForceRate; -extern cvar_t *sv_dequeuePeriod; -extern cvar_t *sv_heartbeat; -extern cvar_t *sv_flatline; +extern cvar_t *sv_banFile; #ifdef USE_VOIP extern cvar_t *sv_voip; diff --git a/src/server/sv_client.c b/src/server/sv_client.c index 094ed98f..f3d190de 100644 --- a/src/server/sv_client.c +++ b/src/server/sv_client.c @@ -66,10 +66,10 @@ void SV_GetChallenge(netadr_t from) if(gameName && *gameName) { // reject client if the heartbeat string sent by the client doesn't match ours - if(strcmp(gameName, sv_heartbeat->string)) + if(strcmp(gameName, com_gamename->string)) { NET_OutOfBandPrint(NS_SERVER, from, "print\nGame mismatch: This is a %s server\n", - sv_heartbeat->string); + com_gamename->string); return; } } diff --git a/src/server/sv_init.c b/src/server/sv_init.c index d2326db5..45c87895 100644 --- a/src/server/sv_init.c +++ b/src/server/sv_init.c @@ -671,9 +671,6 @@ void SV_Init (void) sv_killserver = Cvar_Get ("sv_killserver", "0", 0); sv_mapChecksum = Cvar_Get ("sv_mapChecksum", "", CVAR_ROM); sv_lanForceRate = Cvar_Get ("sv_lanForceRate", "1", CVAR_ARCHIVE ); - sv_dequeuePeriod = Cvar_Get ("sv_dequeuePeriod", "500", CVAR_ARCHIVE ); - sv_heartbeat = Cvar_Get("sv_heartbeat", HEARTBEAT_FOR_MASTER, CVAR_INIT); - sv_flatline = Cvar_Get("sv_flatline", FLATLINE_FOR_MASTER, CVAR_INIT); } diff --git a/src/server/sv_main.c b/src/server/sv_main.c index fdd7127b..c6ee8304 100644 --- a/src/server/sv_main.c +++ b/src/server/sv_main.c @@ -56,10 +56,7 @@ cvar_t *sv_minPing; cvar_t *sv_maxPing; cvar_t *sv_pure; cvar_t *sv_lanForceRate; // dedicated 1 (LAN) server forces local client rates to 99999 (bug #491) -cvar_t *sv_dequeuePeriod; -cvar_t *sv_heartbeat; // Heartbeat string that is sent to the master -cvar_t *sv_flatline; // If the master server supports it we can send a flatline - // when server is killed +cvar_t *sv_banFile; /* ============================================================================= @@ -323,11 +320,11 @@ Informs all masters that this server is going down void SV_MasterShutdown( void ) { // send a hearbeat right now svs.nextHeartbeatTime = -9999; - SV_MasterHeartbeat(sv_flatline->string); + SV_MasterHeartbeat(HEARTBEAT_FOR_MASTER); // send it again to minimize chance of drops svs.nextHeartbeatTime = -9999; - SV_MasterHeartbeat(sv_flatline->string); + SV_MasterHeartbeat(HEARTBEAT_FOR_MASTER); // when the master tries to poll the server, it won't respond, so // it will be removed from the list @@ -649,6 +646,7 @@ void SVC_Info( netadr_t from ) { Info_SetValueForKey( infostring, "challenge", Cmd_Argv(1) ); Info_SetValueForKey( infostring, "protocol", va("%i", PROTOCOL_VERSION) ); + Info_SetValueForKey( infostring, "gamename", com_gamename->string ); Info_SetValueForKey( infostring, "hostname", sv_hostname->string ); Info_SetValueForKey( infostring, "mapname", sv_mapname->string ); Info_SetValueForKey( infostring, "clients", va("%i", count) ); @@ -1137,7 +1135,7 @@ void SV_Frame( int msec ) { SV_SendClientMessages(); // send a heartbeat to the master if needed - SV_MasterHeartbeat(sv_heartbeat->string); + SV_MasterHeartbeat(HEARTBEAT_FOR_MASTER); } /* |