public override void Validate(BasePacket packet) { ValidationInfo info; _info.TryGetValue(packet.SessionToken, out info); if (info == null) { BaseResponse.Throw(packet.ToString(), ECGeneral.SessionError); return; } info.AssertAction(packet); }
private void AssertDistance(BasePacket packet, double dist) { double ms = DateTime.Now.Subtract(_lastMoveTime).TotalMilliseconds; if (ms/_lastPlayerSpeed/dist < DIST_DIFF_THRESH) { BaseResponse.Throw(packet.ToString(), ECGeneral.ActionIsImposible); } }