about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChoupom <andycootlapin@hotmail.fr>2010-11-01 11:42:43 +0100
committeroy <Tom_Adams@web.de>2010-11-17 19:11:28 +0100
commit4383e1093398816a925794c1778974e29a35983c (patch)
tree63d8b95b4c6ab72cdc6245f6b2d0bf6e2e9a07f0
parentc45dc374ff585732b51e5a72b8fdf7ce2293c991 (diff)
downloadzcatch-4383e1093398816a925794c1778974e29a35983c.tar.gz
zcatch-4383e1093398816a925794c1778974e29a35983c.zip
clients are now dropped if they don't act as normal clients (fixes #235)
-rw-r--r--src/engine/shared/network_conn.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/engine/shared/network_conn.cpp b/src/engine/shared/network_conn.cpp
index b9757500..aaab7369 100644
--- a/src/engine/shared/network_conn.cpp
+++ b/src/engine/shared/network_conn.cpp
@@ -194,7 +194,6 @@ void CNetConnection::Disconnect(const char *pReason)
 int CNetConnection::Feed(CNetPacketConstruct *pPacket, NETADDR *pAddr)
 {
 	int64 Now = time_get();
-	m_LastRecvTime = Now;
 	
 	// check if resend is requested
 	if(pPacket->m_Flags&NET_PACKETFLAG_RESEND)
@@ -256,27 +255,20 @@ int CNetConnection::Feed(CNetPacketConstruct *pPacket, NETADDR *pAddr)
 				// connection made
 				if(CtrlMsg == NET_CTRLMSG_CONNECTACCEPT)
 				{
+					m_LastRecvTime = Now;
 					SendControl(NET_CTRLMSG_ACCEPT, 0, 0);
 					m_State = NET_CONNSTATE_ONLINE;
 					if(g_Config.m_Debug)
 						dbg_msg("connection", "got connect+accept, sending accept. connection online");
 				}
 			}
-			else if(State() == NET_CONNSTATE_ONLINE)
-			{
-				// connection made
-				/*
-				if(ctrlmsg == NET_CTRLMSG_CONNECTACCEPT)
-				{
-					
-				}*/
-			}
 		}
 	}
 	else
 	{
 		if(State() == NET_CONNSTATE_PENDING)
 		{
+			m_LastRecvTime = Now;
 			m_State = NET_CONNSTATE_ONLINE;
 			if(g_Config.m_Debug)
 				dbg_msg("connection", "connecting online");
@@ -285,6 +277,7 @@ int CNetConnection::Feed(CNetPacketConstruct *pPacket, NETADDR *pAddr)
 	
 	if(State() == NET_CONNSTATE_ONLINE)
 	{
+		m_LastRecvTime = Now;
 		AckChunks(pPacket->m_Ack);
 	}