From eac5a91923234ae44b51a3ca67b1a2d2a2f312fb Mon Sep 17 00:00:00 2001 From: XXLTomate Date: Sun, 3 Nov 2013 21:25:22 +0100 Subject: [PATCH] Added spamprotection for chat commands --- src/game/server/gamecontext.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index a41725157e..d8a003d4da 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -804,6 +804,13 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID) } if(pMsg->m_pMessage[0]=='/') { + if(ProcessSpamProtection(ClientID)) + { + SendChatTarget(ClientID, "Muted text:"); + SendChatTarget(ClientID, pMsg->m_pMessage); + return; + } + m_ChatResponseTargetID = ClientID; Console()->SetFlagMask(CFGFLAG_CHAT);