public void Handle(WorldClient client, MoveCharacterPacket packet) { if (_teleportationManager.IsTeleporting) { return; } if (_speedManager.Immobilize) { _logger.LogWarning("Character {id} is moving during stun. Probably cheating?", _gameSession.CharId); return; } var distance = MathExtensions.Distance(_movementManager.PosX, packet.X, _movementManager.PosZ, packet.Z); if ((distance > 6 && !_skillsManager.ChargeUsedLastTime.HasValue) || (distance > 6 && DateTime.UtcNow.Subtract(_skillsManager.ChargeUsedLastTime.Value).TotalSeconds > 2)) { _logger.LogWarning("Character {id} is moving too fast. Probably cheating?", _gameSession.CharId); return; } _movementManager.PosX = packet.X; _movementManager.PosY = packet.Y; _movementManager.PosZ = packet.Z; _movementManager.Angle = packet.Angle; _movementManager.RaisePositionChanged(); }
public static void Movement(MartialClient c, InPacket p) { if (c.getAccount().activeCharacter == null) { Logger.LogCheat(Logger.HackTypes.NullActive, c, "Hooked Movement with null of activeCharacter"); c.Close(); return; } Character chr = c.getAccount().activeCharacter; p.Skip(4); byte[] locationToX = p.ReadBytes(4); byte[] locationToY = p.ReadBytes(4); p.Skip(1); byte movingMode = p.ReadByte(); MoveCharacterPacket.HandleMovement(chr, locationToX, locationToY, movingMode); }
private void HandleMove(MoveCharacterPacket packet) { UpdatePosition(packet.X, packet.Y, packet.Z, packet.Angle, packet.MovementType == MovementType.Stopped); }