From b0dc35080e467bfdb73892020f72ee86e04a1223 Mon Sep 17 00:00:00 2001 From: def Date: Tue, 13 May 2014 20:26:59 +0200 Subject: [PATCH] Fix: Only allow dummy connect every 5 seconds (Thanks Monsta) --- src/engine/client/client.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 02e53df86..3ffdea78f 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -693,7 +693,7 @@ bool CClient::DummyConnected() void CClient::DummyConnect() { - if(m_LastDummyConnectTime > GameTick()) + if(m_LastDummyConnectTime + GameTickSpeed() * 5 > GameTick()) return; if(m_NetClient[0].State() != NET_CONNSTATE_ONLINE && m_NetClient[0].State() != NET_CONNSTATE_PENDING) @@ -744,7 +744,7 @@ void CClient::DummyDisconnect(const char *pReason) m_NetClient[1].Disconnect(pReason); g_Config.m_ClDummy = 0; m_RconAuthed[1] = 0; - m_DummyConnected = 0; + m_DummyConnected = false; GameClient()->OnDummyDisconnect(); } @@ -1751,6 +1751,7 @@ void CClient::ProcessServerPacketDummy(CNetChunk *pPacket) { //GameClient()->OnConnected(); m_DummyConnected = true; + m_LastDummyConnectTime = GameTick(); g_Config.m_ClDummy = 1; } else if(Msg == NETMSG_SNAP || Msg == NETMSG_SNAPSINGLE || Msg == NETMSG_SNAPEMPTY)