about summary refs log tree commit diff
path: root/src/engine/shared/network_server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/shared/network_server.cpp')
-rw-r--r--src/engine/shared/network_server.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/engine/shared/network_server.cpp b/src/engine/shared/network_server.cpp
index add51c9b..bdc10935 100644
--- a/src/engine/shared/network_server.cpp
+++ b/src/engine/shared/network_server.cpp
@@ -69,11 +69,17 @@ int CNetServer::Drop(int ClientID, const char *pReason)
 
 int CNetServer::Update()
 {
+	int64 Now = time_get();
 	for(int i = 0; i < MaxClients(); i++)
 	{
 		m_aSlots[i].m_Connection.Update();
 		if(m_aSlots[i].m_Connection.State() == NET_CONNSTATE_ERROR)
-			Drop(i, m_aSlots[i].m_Connection.ErrorString());
+		{
+			if(Now - m_aSlots[i].m_Connection.ConnectTime() < time_freq()/2 && NetBan())
+				NetBan()->BanAddr(ClientAddr(i), 60, "Stressing network");
+			else
+				Drop(i, m_aSlots[i].m_Connection.ErrorString());
+		}
 	}
 
 	return 0;