feat: Adds a movement throttle system. Removes Fastwalk system. (#1511)

### Summary

- Removes Fastwalk system
  - Removed the following settings:
    - `movement.enableFastWalkPrevention`
    - `movement.fastwalkExemptionLevel`
- Adds movement throttle system.
  - Adds the following settings:
    - `movement.throttleReset` - Default value is `1000` (1 second).
    - `movement.throttleThreshold` - Default value is `400` (400ms).

### Movement Throttling

This new system will trigger if a player requests 400ms (configurable) worth of movements quicker than wall clock time. When this happens, the player is throttled (all incoming packets to the server are halted) until wall clock time catches up with the requests. Upon each throttle, the player receives enough credit to handle up to 400ms of "lag" as a grace/catch-up.


### Developer Notes
We use two throttle queues to prevent an infinite loop.
This commit is contained in:
Kamron Batman 2023-09-27 20:53:22 -07:00 committed by GitHub
parent 27df6344d9
commit 146abad36e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 106 additions and 322 deletions

View file

@ -76,6 +76,10 @@ public partial class NetState : IComparable<NetState>
public GCHandle Handle => _handle;
// Speed Hack Prevention
internal long _movementCredit;
internal long _nextMovementTime;
internal enum ParserState
{
AwaitingNextPacket,