Theres lots of puzzles, time-based, MMOs and what not,
That avoiding speed hack by checking OS time.
I wonder,
Is it possible to enable speed hack in a game AND at the same time enable speed hack to the OS time? (I wonder in generally if it possible to speedhack OS time, or just spoof it..).
public class SpeedWatchDog extends EventDispatcher
{
protected var _tolerance:Number;
protected var _prevDate:Number;
protected var _prevTimer:int;
protected var _interval:uint;
public function init(interval:int = 1000, tolerance:Number = 0.35):void
{
_tolerance = tolerance;
_prevTimer = getTimer();
_prevDate = new Date().time;
this.interval = interval;
}
public function stop():void
{
clearInterval(_interval);
}
public function get tolerance():Number
{
return _tolerance;
}
public function set tolerance(value:Number):void
{
_tolerance = value;
}
public function get interval():uint
{
return _interval;
}
public function set interval(value:uint):void
{
clearInterval(_interval);
_interval = setInterval(check, value);
}
protected function check():void
{
var date:Number = new Date().time - _prevDate;
var timer:Number = getTimer() - _prevTimer;
var t:Number = date * _tolerance;
if (timer > date + t || timer < date - t)
{
dispatchEvent(new SecurityErrorEvent(SecurityErrorEvent.SECURITY_ERROR));
}
_prevTimer = getTimer();
_prevDate = new Date().time;
}
}
Its usage
Code:
var wd:SpeedWatchDog = new SpeedWatchDog();
//Check every 2 seconds with a tolerance of 40%
wd.init(2000, 0.4);
wd.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSpeedHack;
function onSpeedHack(e:Event):void
{
trace("speedhack detected");
}
_________________
I'm rusty and getting older, help me re-learn lua.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum