From 848c96b0df5282a9089bd4259e3e6ae3620f3ec9 Mon Sep 17 00:00:00 2001 From: Treeki Date: Sat, 15 Feb 2014 10:11:57 +0100 Subject: add limiting of the amount of messages in a window --- bouncer/netcore.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bouncer/netcore.cpp') diff --git a/bouncer/netcore.cpp b/bouncer/netcore.cpp index 98f13a1..7c2305e 100644 --- a/bouncer/netcore.cpp +++ b/bouncer/netcore.cpp @@ -331,6 +331,10 @@ void NetCore::loadConfig() { for (auto §ion : sections) { if (section.title == "Header") { bouncerPassword = section.data["password"]; + + maxWindowMessageCount = atoi(section.data["maxBufferSize"].c_str()); + if (maxWindowMessageCount < 5 || maxWindowMessageCount > 2000) + maxWindowMessageCount = 1000; } if (section.title == "Server" && serverCount < SERVER_LIMIT) { @@ -351,6 +355,10 @@ void NetCore::saveConfig() { header.data["password"] = bouncerPassword; + char conv[50]; + sprintf(conv, "%d", maxWindowMessageCount); + header.data["maxWindowMessageCount"] = conv; + sections.push_back(header); for (int i = 0; i < serverCount; i++) { -- cgit v1.2.3