RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Speed Hack Detection Help..

RaZzi

Sorceror
So is there any working Speedhack detection scripts available yet? This is a real problem on the shard where I play. And Quantos, there are cheats for UO that you can't even imagine about (show your enemys health in numbers etc).
 

Ingvarr

Wanderer
I just posted one. It stops every modern speedhack - at least, from observers point, regardless of what shacker will see (it will be a desync).
 

targetofhate

Wanderer
Ingvarr said:
Try this. This will make throttling activate almost immediately after suspicious packet, so speed boost achieved with speedhack will be so low that it will be totally negligible.
Can raise CPU utilization somewhat though.

Code:
		#region Fastwalk Prevention
		private static bool FastwalkPrevention = true; // Is fastwalk prevention enabled?
		private static TimeSpan FastwalkThreshold = TimeSpan.FromSeconds( 0.095 );

		private DateTime m_NextMovementTime;

		public virtual bool UsesFastwalkPrevention{ get{ return ( AccessLevel < AccessLevel.GameMaster ); } }

		public virtual TimeSpan ComputeMovementSpeed( Direction dir )
		{
			if ( (dir & Direction.Mask) != (this.Direction & Direction.Mask) )
				return TimeSpan.Zero;

			bool running = ( (dir & Direction.Running) != 0 );

			bool onHorse = ( this.Mount != null );

			if ( onHorse )
				return ( running ? TimeSpan.FromSeconds( 0.1 ) : TimeSpan.FromSeconds( 0.2 ) ) - TimeSpan.FromSeconds( 0.005 );

			return ( running ? TimeSpan.FromSeconds( 0.2 ) : TimeSpan.FromSeconds( 0.4 ) ) - TimeSpan.FromSeconds( 0.005 );
		}

		public static bool MovementThrottle_Callback( NetState ns )
		{
			PlayerMobile pm = ns.Mobile as PlayerMobile;

			if ( pm == null || !pm.UsesFastwalkPrevention )
				return true;

			if ( pm.m_NextMovementTime == DateTime.MinValue )
			{
				// has not yet moved
				pm.m_NextMovementTime = DateTime.Now;
				return true;
			}

			TimeSpan ts = pm.m_NextMovementTime - DateTime.Now;

			if ( ts < TimeSpan.Zero )
			{
				// been a while since we've last moved
				pm.m_NextMovementTime = DateTime.Now;
				return true;
			}

			return ( ts < FastwalkThreshold );
		}
		#endregion

where would i put this?
 

Quantos

Lord
He shows you where to put this, I highlighted it in red.

Code:
#region Fastwalk Prevention
		private static bool FastwalkPrevention = true; // Is fastwalk prevention enabled?
		[COLOR=Red]private static TimeSpan FastwalkThreshold = TimeSpan.FromSeconds( 0.095 );[/COLOR]
 

Ingvarr

Wanderer
PlayerMobile.cs

Its better to update ComputeMovementSpeed times too (there are additional
small tolerances there), or rubberbanding can sometimes be felt by honest players due to accumulation of timer errors.
 

Quantos

Lord
Ingvarr said:
PlayerMobile.cs

Its better to update ComputeMovementSpeed times too (there are additional
small tolerances there), or rubberbanding can sometimes be felt by honest players due to accumulation of timer errors.

Thanks for pointing out which script it goes in, I completely missed that :)
 
Top