- 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.
This commit is contained in:
parent
23f6fd1633
commit
ba385fa43c
9 changed files with 41 additions and 45 deletions
|
@ -61,9 +61,6 @@ cvar_t *sv_lanForceRate; // dedicated 1 (LAN) server forces local client rates t
|
|||
cvar_t *sv_strictAuth;
|
||||
#endif
|
||||
cvar_t *sv_banFile;
|
||||
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
|
||||
|
||||
serverBan_t serverBans[SERVER_MAXBANS];
|
||||
int serverBansCount = 0;
|
||||
|
@ -338,11 +335,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
|
||||
|
@ -644,6 +641,8 @@ void SVC_Info( netadr_t from ) {
|
|||
// to prevent timed spoofed reply packets that add ghost servers
|
||||
Info_SetValueForKey( infostring, "challenge", Cmd_Argv(1) );
|
||||
|
||||
Info_SetValueForKey( infostring, "gamename", com_gamename->string );
|
||||
|
||||
#ifdef LEGACY_PROTOCOL
|
||||
if(com_legacyprotocol->integer > 0)
|
||||
Info_SetValueForKey(infostring, "protocol", va("%i", com_legacyprotocol->integer));
|
||||
|
@ -1154,7 +1153,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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue