mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Add sv_netlimit
This commit is contained in:
parent
da778f4e66
commit
b51cc77189
|
@ -856,7 +856,7 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((Now - m_aClients[ClientID].m_TrafficSince) / time_freq() > 0 && m_aClients[ClientID].m_Traffic / ((Now - m_aClients[ClientID].m_TrafficSince) / time_freq()) > 100000)
|
||||
if ((Now - m_aClients[ClientID].m_TrafficSince) / time_freq() > 0 && m_aClients[ClientID].m_Traffic / ((Now - m_aClients[ClientID].m_TrafficSince) / time_freq()) > g_Config.m_SvNetlimit)
|
||||
{
|
||||
m_NetServer.NetBan()->BanAddr(&pPacket->m_Address, 60, "Stressing network");
|
||||
return;
|
||||
|
|
|
@ -221,4 +221,7 @@ MACRO_CONFIG_INT(SvGlobalBantime, sv_global_ban_time, 60, 0, 1440, CFGFLAG_SERVE
|
|||
|
||||
MACRO_CONFIG_INT(SvEvents, sv_events, 1, 0, 1, CFGFLAG_SERVER, "Enable triggering of server events, like the happy eyeemotes on some holidays.")
|
||||
|
||||
// netlimit
|
||||
MACRO_CONFIG_INT(SvNetlimit, sv_netlimit, 10000, 1000, 1000000, CFGFLAG_SERVER, "Netlimit: Maximum amount of traffic a client is allowed to use (in kb/s)")
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue