diff options
| author | oy <Tom_Adams@web.de> | 2011-07-31 13:05:12 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-07-31 13:05:12 +0200 |
| commit | 94188021509a376fc352b7707d9a324335a97eba (patch) | |
| tree | e0ad6c8d81a91217e4b035d764f3d57fb8a2c2c1 /src/engine/shared/network.h | |
| parent | 1705c90e148d680c4b8002d12ac15a7d228f6408 (diff) | |
| download | zcatch-94188021509a376fc352b7707d9a324335a97eba.tar.gz zcatch-94188021509a376fc352b7707d9a324335a97eba.zip | |
protected econ authentication against brute force
Diffstat (limited to 'src/engine/shared/network.h')
| -rw-r--r-- | src/engine/shared/network.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/engine/shared/network.h b/src/engine/shared/network.h index 94e2824c..d10c03b6 100644 --- a/src/engine/shared/network.h +++ b/src/engine/shared/network.h @@ -325,7 +325,21 @@ public: class CNetConsole { -private: + enum + { + MAX_BANS=128, + }; + + int FindBan(NETADDR Addr); + void UpdateBans(); + + struct CBanEntry + { + NETADDR m_Addr; + int m_Expires; + } m_aBans[MAX_BANS]; + int m_NumBans; + struct CSlot { CConsoleNetConnection m_Connection; @@ -356,6 +370,8 @@ public: int AcceptClient(NETSOCKET Socket, const NETADDR *pAddr); int Drop(int ClientID, const char *pReason); + bool AddBan(NETADDR Addr, int Seconds); + // status requests NETADDR ClientAddr(int ClientID) const { return m_aSlots[ClientID].m_Connection.PeerAddress(); } }; |