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:
parent
27df6344d9
commit
146abad36e
11 changed files with 106 additions and 322 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue