summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorheinrich5991 <heinrich5991@gmail.com>2018-10-12 22:08:51 +0200
committerheinrich5991 <heinrich5991@gmail.com>2018-10-12 22:08:51 +0200
commitaea78ef68ee416a2e6e72da24e8a9eb6b0039e9c (patch)
treec07064c8fcdf5360cf556bbf1decd74990b67cf5
parent52059b5cdb42bf5d3e0938adfd50ccfa765424a6 (diff)
Revert "added a simple challenge response mechanism for connecting clients"
This reverts commit 4c00063b2fd9c25998f3d308723e1ae65c20548d.
-rw-r--r--src/engine/server/server.cpp42
-rw-r--r--src/engine/server/server.h9
-rw-r--r--src/engine/shared/config_variables.h1
3 files changed, 1 insertions, 51 deletions
diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp
index 8b3d9d53a..6c459257f 100644
--- a/src/engine/server/server.cpp
+++ b/src/engine/server/server.cpp
@@ -268,16 +268,6 @@ void CServer::CClient::Reset()
m_Score = 0;
}
-bool CServer::CClient::CRCheck()
-{
- if(m_CRSuccess || (m_CRCounter == m_CRCheckVal))
- {
- m_CRSuccess = true;
- return true;
- }
- return false;
-}
-
CServer::CServer() : m_DemoRecorder(&m_SnapshotDelta)
{
m_TickSpeed = SERVER_TICK_SPEED;
@@ -700,9 +690,6 @@ int CServer::NewClientCallback(int ClientID, void *pUser)
{
CServer *pThis = (CServer *)pUser;
pThis->m_aClients[ClientID].m_State = CClient::STATE_AUTH;
- pThis->m_aClients[ClientID].m_CRCounter = 0;
- pThis->m_aClients[ClientID].m_CRCheckVal = rand()%CClient::CR_MAXVAL;
- pThis->m_aClients[ClientID].m_CRSuccess = false;
pThis->m_aClients[ClientID].m_aName[0] = 0;
pThis->m_aClients[ClientID].m_aClan[0] = 0;
pThis->m_aClients[ClientID].m_Country = -1;
@@ -809,17 +796,6 @@ void CServer::UpdateClientRconCommands()
}
}
-void CServer::CRAuthentification(int ClientID)
-{
- if((g_Config.m_SvCRFailBantime >= 0) && (!m_aClients[ClientID].CRCheck()))
- {
- if(g_Config.m_SvCRFailBantime == 0)
- m_NetServer.Drop(ClientID, "Failed challenge response");
- else
- m_ServerBan.BanAddr(m_NetServer.ClientAddr(ClientID), g_Config.m_SvCRFailBantime * 60, "Failed challenge response");
- }
-}
-
void CServer::ProcessClientPacket(CNetChunk *pPacket)
{
int ClientID = pPacket->m_ClientID;
@@ -860,14 +836,6 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
}
m_aClients[ClientID].m_State = CClient::STATE_CONNECTING;
-
- // send challenge response (via ping requests)
- for (int i = 0; i < m_aClients[ClientID].m_CRCheckVal; ++i)
- {
- CMsgPacker CRMsg(NETMSG_PING);
- SendMsgEx(&CRMsg, 0, ClientID, true);
- }
-
SendMap(ClientID);
}
}
@@ -876,9 +844,6 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
if((pPacket->m_Flags&NET_CHUNKFLAG_VITAL) == 0 || m_aClients[ClientID].m_State < CClient::STATE_CONNECTING)
return;
- // check challenge response
- CRAuthentification(ClientID);
-
int Chunk = Unpacker.GetInt();
unsigned int ChunkSize = 1024-128;
unsigned int Offset = Chunk * ChunkSize;
@@ -915,9 +880,6 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
{
if((pPacket->m_Flags&NET_CHUNKFLAG_VITAL) != 0 && m_aClients[ClientID].m_State == CClient::STATE_CONNECTING)
{
- // check challenge response
- CRAuthentification(ClientID);
-
char aAddrStr[NETADDR_MAXSTRSIZE];
net_addr_str(m_NetServer.ClientAddr(ClientID), aAddrStr, sizeof(aAddrStr), true);
@@ -1082,10 +1044,6 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
CMsgPacker Msg(NETMSG_PING_REPLY);
SendMsgEx(&Msg, 0, ClientID, true);
}
- else if(Msg == NETMSG_PING_REPLY)
- {
- m_aClients[ClientID].m_CRCounter++;
- }
else
{
if(g_Config.m_Debug)
diff --git a/src/engine/server/server.h b/src/engine/server/server.h
index 0bddf1def..c3c1794dc 100644
--- a/src/engine/server/server.h
+++ b/src/engine/server/server.h
@@ -92,9 +92,7 @@ public:
SNAPRATE_INIT=0,
SNAPRATE_FULL,
- SNAPRATE_RECOVER,
-
- CR_MAXVAL=128,
+ SNAPRATE_RECOVER
};
class CInput
@@ -106,9 +104,6 @@ public:
// connection state info
int m_State;
- int m_CRCounter;
- int m_CRCheckVal;
- int m_CRSuccess;
int m_Latency;
int m_SnapRate;
@@ -130,7 +125,6 @@ public:
const IConsole::CCommandInfo *m_pRconCmdToSend;
void Reset();
- bool CRCheck();
};
CClient m_aClients[MAX_CLIENTS];
@@ -210,7 +204,6 @@ public:
void SendRconCmdAdd(const IConsole::CCommandInfo *pCommandInfo, int ClientID);
void SendRconCmdRem(const IConsole::CCommandInfo *pCommandInfo, int ClientID);
void UpdateClientRconCommands();
- void CRAuthentification(int ClientID);
void ProcessClientPacket(CNetChunk *pPacket);
diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h
index ed20d42d3..025a9cf38 100644
--- a/src/engine/shared/config_variables.h
+++ b/src/engine/shared/config_variables.h
@@ -91,7 +91,6 @@ MACRO_CONFIG_STR(SvRconPassword, sv_rcon_password, 32, "", CFGFLAG_SERVER, "Remo
MACRO_CONFIG_STR(SvRconModPassword, sv_rcon_mod_password, 32, "", CFGFLAG_SERVER, "Remote console password for moderators (limited access)")
MACRO_CONFIG_INT(SvRconMaxTries, sv_rcon_max_tries, 3, 0, 100, CFGFLAG_SERVER, "Maximum number of tries for remote console authentication")
MACRO_CONFIG_INT(SvRconBantime, sv_rcon_bantime, 5, 0, 1440, CFGFLAG_SERVER, "The time a client gets banned if remote console authentication fails. 0 makes it just use kick")
-MACRO_CONFIG_INT(SvCRFailBantime, sv_crfail_bantime, 3, -1, 1440, CFGFLAG_SERVER, "The time a client gets banned if challenge response authentification fails. 0 makes it just use kick. -1 disables it")
MACRO_CONFIG_INT(SvAutoDemoRecord, sv_auto_demo_record, 0, 0, 1, CFGFLAG_SERVER, "Automatically record demos")
MACRO_CONFIG_INT(SvAutoDemoMax, sv_auto_demo_max, 10, 0, 1000, CFGFLAG_SERVER, "Maximum number of automatically recorded demos (0 = no limit)")