diff --git a/src/engine/server.h b/src/engine/server.h index 25be9e6c8..fb1192f19 100644 --- a/src/engine/server.h +++ b/src/engine/server.h @@ -223,6 +223,8 @@ public: virtual int* GetIdMap(int ClientID) = 0; virtual bool DnsblWhite(int ClientID) = 0; + virtual bool DnsblPending(int ClientID) = 0; + virtual bool DnsblBlack(int ClientID) = 0; virtual const char *GetAnnouncementLine(char const *FileName) = 0; virtual bool ClientPrevIngame(int ClientID) = 0; virtual const char *GetNetErrorString(int ClientID) = 0; diff --git a/src/engine/server/server.h b/src/engine/server/server.h index 198cff6f2..4e8fc87c9 100644 --- a/src/engine/server/server.h +++ b/src/engine/server/server.h @@ -442,6 +442,14 @@ public: return m_aClients[ClientID].m_DnsblState == CClient::DNSBL_STATE_NONE || m_aClients[ClientID].m_DnsblState == CClient::DNSBL_STATE_WHITELISTED; } + bool DnsblPending(int ClientID) + { + return m_aClients[ClientID].m_DnsblState == CClient::DNSBL_STATE_PENDING; + } + bool DnsblBlack(int ClientID) + { + return m_aClients[ClientID].m_DnsblState == CClient::DNSBL_STATE_BLACKLISTED; + } void AuthRemoveKey(int KeySlot); bool ClientPrevIngame(int ClientID) { return m_aPrevStates[ClientID] == CClient::STATE_INGAME; }; diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index d3087740b..fe6132825 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -3894,11 +3894,18 @@ bool CGameContext::RateLimitPlayerVote(int ClientID) return true; } - if (g_Config.m_SvDnsblVote && !m_pServer->DnsblWhite(ClientID) && Server()->DistinctClientCount() > 1) + if(g_Config.m_SvDnsblVote && Server()->DistinctClientCount() > 1) { - // blacklisted by dnsbl - SendChatTarget(ClientID, "You are not allowed to vote due to DNSBL."); - return true; + if(m_pServer->DnsblPending(ClientID)) + { + SendChatTarget(ClientID, "You are not allowed to vote due to pending DNSBL request. Try again in ~30 seconds."); + return true; + } + else if(m_pServer->DnsblBlack(ClientID)) + { + SendChatTarget(ClientID, "You are not allowed to vote due to DNSBL. Try connecting without a VPN."); + return true; + } } if(g_Config.m_SvSpamprotection && pPlayer->m_LastVoteTry && pPlayer->m_LastVoteTry + TickSpeed * 3 > Now)