ModernUO/Projects/UOContent/Misc/Fastwalk.cs
Kamron Batman c3289a20ab
Changes damage packets (#299)
- [X] Changes damage packets

Bumps release version
2020-11-01 22:44:23 -08:00

34 lines
1.3 KiB
C#

namespace Server.Misc
{
// This fastwalk detection is no longer required
// As of B36 PlayerMobile implements movement packet throttling which more reliably controls movement speeds
public static class Fastwalk
{
private static readonly int MaxSteps = 4; // Maximum number of queued steps until fastwalk is detected
private static readonly bool Enabled = false; // Is fastwalk detection enabled?
private static readonly bool UOTDOverride = false; // Should UO:TD clients not be checked for fastwalk?
private static readonly AccessLevel
AccessOverride = AccessLevel.GameMaster; // Anyone with this or higher access level is not checked for fastwalk
public static void Initialize()
{
Mobile.FwdMaxSteps = MaxSteps;
Mobile.FwdEnabled = Enabled;
Mobile.FwdUOTDOverride = UOTDOverride;
Mobile.FwdAccessOverride = AccessOverride;
if (Enabled)
{
EventSink.FastWalk += OnFastWalk;
}
}
public static void OnFastWalk(FastWalkEventArgs e)
{
e.Blocked = true; // disallow this fastwalk
var state = e.NetState;
state.WriteConsole("Fast movement detected (name={0})", state.Mobile.Name);
}
}
}