add a simple DOS protection system

This commit is contained in:
Igor
2024-03-29 10:56:05 +03:00
committed by Lion Kortlepel
parent a9385c47e1
commit 2c05a442ee
2 changed files with 73 additions and 3 deletions

View File

@@ -27,6 +27,14 @@
struct TConnection;
class WatchingConnecting{
public:
bool IsConnectionAllowed(const std::string& clientAddress);
private:
void BlockIP(const std::string& clientAddress);
bool IsIPBlocked(const std::string& clientAddress);
};
class TNetwork {
public:
TNetwork(TServer& Server, TPPSMonitor& PPSMonitor, TResourceManager& ResourceManager);
@@ -48,7 +56,6 @@ public:
private:
void UDPServerMain();
void TCPServerMain();
TServer& mServer;
TPPSMonitor& mPPSMonitor;
ip::udp::socket mUDPSock;