From e3d825f119d3ae6d4b514d98ff84e035a699852e Mon Sep 17 00:00:00 2001 From: Jupeyy Date: Tue, 6 Jun 2023 19:05:31 +0200 Subject: [PATCH] Disallow multiple emotes in the same tick, respect high bandwidth setting --- src/game/server/gamecontext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index d8276bc38..a418b1c9d 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -2526,7 +2526,8 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID) { CNetMsg_Cl_Emoticon *pMsg = (CNetMsg_Cl_Emoticon *)pRawMsg; - if(g_Config.m_SvSpamprotection && pPlayer->m_LastEmote && pPlayer->m_LastEmote + Server()->TickSpeed() * g_Config.m_SvEmoticonDelay > Server()->Tick()) + if(g_Config.m_SvSpamprotection && pPlayer->m_LastEmote && + pPlayer->m_LastEmote + maximum(Server()->TickSpeed() * g_Config.m_SvEmoticonDelay, g_Config.m_SvHighBandwidth ? 1 : 2) > Server()->Tick()) return; pPlayer->m_LastEmote = Server()->Tick();