diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index f67bf9ad1..7ce6c6304 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -279,9 +279,6 @@ void CServer::CClient::Reset() m_Score = 0; m_NextMapChunk = 0; m_Flags = 0; - m_DDNetVersion = VERSION_NONE; - m_GotDDNetVersionPacket = false; - m_DDNetVersionSettled = false; } CServer::CServer() : @@ -984,6 +981,9 @@ int CServer::ClientRejoinCallback(int ClientID, void *pUser) pThis->m_aClients[ClientID].m_Authed = AUTHED_NO; pThis->m_aClients[ClientID].m_AuthKey = -1; pThis->m_aClients[ClientID].m_pRconCmdToSend = 0; + pThis->m_aClients[ClientID].m_DDNetVersion = VERSION_NONE; + pThis->m_aClients[ClientID].m_GotDDNetVersionPacket = false; + pThis->m_aClients[ClientID].m_DDNetVersionSettled = false; pThis->m_aClients[ClientID].Reset(); @@ -999,7 +999,6 @@ int CServer::NewClientNoAuthCallback(int ClientID, void *pUser) pThis->m_aClients[ClientID].m_DnsblState = CClient::DNSBL_STATE_NONE; pThis->m_aClients[ClientID].m_State = CClient::STATE_CONNECTING; - pThis->m_aClients[ClientID].m_SupportsMapSha256 = false; pThis->m_aClients[ClientID].m_aName[0] = 0; pThis->m_aClients[ClientID].m_aClan[0] = 0; pThis->m_aClients[ClientID].m_Country = -1; @@ -1008,6 +1007,9 @@ int CServer::NewClientNoAuthCallback(int ClientID, void *pUser) pThis->m_aClients[ClientID].m_AuthTries = 0; pThis->m_aClients[ClientID].m_pRconCmdToSend = 0; pThis->m_aClients[ClientID].m_ShowIps = false; + pThis->m_aClients[ClientID].m_DDNetVersion = VERSION_NONE; + pThis->m_aClients[ClientID].m_GotDDNetVersionPacket = false; + pThis->m_aClients[ClientID].m_DDNetVersionSettled = false; pThis->m_aClients[ClientID].Reset(); pThis->SendCapabilities(ClientID); @@ -1022,7 +1024,6 @@ int CServer::NewClientCallback(int ClientID, void *pUser, bool Sixup) { CServer *pThis = (CServer *)pUser; pThis->m_aClients[ClientID].m_State = CClient::STATE_PREAUTH; - pThis->m_aClients[ClientID].m_SupportsMapSha256 = false; pThis->m_aClients[ClientID].m_DnsblState = CClient::DNSBL_STATE_NONE; pThis->m_aClients[ClientID].m_aName[0] = 0; pThis->m_aClients[ClientID].m_aClan[0] = 0; @@ -1034,6 +1035,9 @@ int CServer::NewClientCallback(int ClientID, void *pUser, bool Sixup) pThis->m_aClients[ClientID].m_Traffic = 0; pThis->m_aClients[ClientID].m_TrafficSince = 0; pThis->m_aClients[ClientID].m_ShowIps = false; + pThis->m_aClients[ClientID].m_DDNetVersion = VERSION_NONE; + pThis->m_aClients[ClientID].m_GotDDNetVersionPacket = false; + pThis->m_aClients[ClientID].m_DDNetVersionSettled = false; memset(&pThis->m_aClients[ClientID].m_Addr, 0, sizeof(NETADDR)); pThis->m_aClients[ClientID].Reset(); @@ -1107,7 +1111,6 @@ int CServer::DelClientCallback(int ClientID, const char *pReason, void *pUser) pThis->GameServer()->OnClientDrop(ClientID, pReason); pThis->m_aClients[ClientID].m_State = CClient::STATE_EMPTY; - pThis->m_aClients[ClientID].m_SupportsMapSha256 = false; pThis->m_aClients[ClientID].m_aName[0] = 0; pThis->m_aClients[ClientID].m_aClan[0] = 0; pThis->m_aClients[ClientID].m_Country = -1; @@ -3730,6 +3733,9 @@ bool CServer::SetTimedOut(int ClientID, int OrigID) DelClientCallback(OrigID, "Timeout Protection used", this); m_aClients[ClientID].m_Authed = AUTHED_NO; m_aClients[ClientID].m_Flags = m_aClients[OrigID].m_Flags; + m_aClients[ClientID].m_DDNetVersion = m_aClients[OrigID].m_DDNetVersion; + m_aClients[ClientID].m_GotDDNetVersionPacket = m_aClients[OrigID].m_GotDDNetVersionPacket; + m_aClients[ClientID].m_DDNetVersionSettled = m_aClients[OrigID].m_DDNetVersionSettled; return true; } diff --git a/src/engine/server/server.h b/src/engine/server/server.h index 0ef2c6d8c..d1c538152 100644 --- a/src/engine/server/server.h +++ b/src/engine/server/server.h @@ -150,7 +150,6 @@ public: // connection state info int m_State; - bool m_SupportsMapSha256; int m_Latency; int m_SnapRate; diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 87db5719c..ae8c83765 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -1271,19 +1271,19 @@ void CGameContext::OnClientEnter(int ClientID) Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, ClientID); } + IServer::CClientInfo Info; + Server()->GetClientInfo(ClientID, &Info); + if(Info.m_GotDDNetVersion) + { + if(OnClientDDNetVersionKnown(ClientID)) + return; // kicked + } + if(!Server()->ClientPrevIngame(ClientID)) { if(g_Config.m_SvWelcome[0] != 0) SendChatTarget(ClientID, g_Config.m_SvWelcome); - IServer::CClientInfo Info; - Server()->GetClientInfo(ClientID, &Info); - if(Info.m_GotDDNetVersion) - { - if(OnClientDDNetVersionKnown(ClientID)) - return; // kicked - } - if(g_Config.m_SvShowOthersDefault > 0) { if(g_Config.m_SvShowOthers)