diff options
Diffstat (limited to '')
-rw-r--r-- | source/ClientHandle.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source/ClientHandle.h b/source/ClientHandle.h index 4568f1a58..cd0ca1ee6 100644 --- a/source/ClientHandle.h +++ b/source/ClientHandle.h @@ -56,7 +56,10 @@ public: #endif static const int MAX_VIEW_DISTANCE = 10; static const int MIN_VIEW_DISTANCE = 4; - + + /// How many ticks should be checked for a running average of explosions, for limiting purposes + static const int NUM_CHECK_EXPLOSIONS_TICKS = 20; + cClientHandle(const cSocket * a_Socket, int a_ViewDistance); virtual ~cClientHandle(); @@ -258,6 +261,17 @@ private: /// If set to true during csDownloadingWorld, the tick thread calls CheckIfWorldDownloaded() bool m_ShouldCheckDownloaded; + /// Stores the recent history of the number of explosions per tick + int m_NumExplosionsPerTick[NUM_CHECK_EXPLOSIONS_TICKS]; + + /// Points to the current tick in the m_NumExplosionsPerTick[] array + int m_CurrentExplosionTick; + + /// Running sum of m_NumExplosionsPerTick[] + int m_RunningSumExplosions; + + + /// Returns true if the rate block interactions is within a reasonable limit (bot protection) bool CheckBlockInteractionsRate(void); |