feat: Adds robust speed hack detection and movement throttling#2266
feat: Adds robust speed hack detection and movement throttling#2266kamronbatman wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the existing movement throttle mechanism by implementing a token-bucket-based throttle system and adds logging for detecting potential speed hacks.
- Implements a token bucket algorithm that accumulates credit over time (capped at 2 seconds)
- Adds detection and logging for consecutive movement throttles to identify suspicious activity
- Updates configuration parameters to use more descriptive names with a
movementThrottle.prefix
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Projects/Server/Network/NetState/NetState.cs | Adds initialization for movement throttle fields including _nextMovementTime, _lastSuspiciousActivityLog, and _consecutiveMovementThrottles |
| Projects/Server/Network/MovementThrottle.cs | Reimplements the throttle algorithm using a token bucket approach, adds suspicious activity logging, and updates configuration parameter names |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This version has an issue where credit only restores when packets arrive late (delta > 0), Credit drains but never refills. If there were enough people doing this at the same time... Other than that it seems to function as we discussed. |
3a355ad to
bcb99b0
Compare
1d49614 to
9672a6d
Compare
3e37852 to
c8e4416
Compare
a3bfed3 to
2b8e529
Compare
2b8e529 to
dfc96eb
Compare
Summary
Server-side movement throttle that prevents speed hacking while accurately identifying cheaters with detection of lagging connections.
Key features:
How It Works
Throttle (prevention): Movements arriving too early either consume credit or get queued. The queue drains at
correct intervals, so speed hackers can't move faster regardless of what they send.
Detection (identification): Combines multiple signals to identify cheaters:
RTT-Aware Logic:
Configuration
{ "movementThrottle.maxCredit": 200, "movementThrottle.softQueueLimit": 6, "movementThrottle.hardQueueLimit": 10, "movementThrottle.debugLogging": false }Test Plan