PSO2SERVER/Server/Protocol/Handlers/04-ObjectHandler/04-71-MovementEndHandler.cs

44 lines
1.4 KiB
C#
Raw Normal View History

2024-09-16 02:56:02 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PSO2SERVER.Protocol.Packets;
2024-09-16 02:56:02 +08:00
namespace PSO2SERVER.Protocol.Handlers
2024-09-16 02:56:02 +08:00
{
[PacketHandlerAttr(0x04, 0x71)]
public class MovementEndHandler : PacketHandler
{
#region implemented abstract members of PacketHandler
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
PacketReader reader = new PacketReader(data);
MovementPacket.FullMovementData movData = reader.ReadStruct<MovementPacket.FullMovementData>();
if (movData.entity1.ID == 0 && movData.entity2.ID != 0)
movData.entity1 = movData.entity2;
movData.timestamp = 0;
2024-12-08 11:33:06 +08:00
//Logger.WriteInternal("[移动] 玩家 {0} 停止移动 (坐标:{1}, {2}, {3})", context.Character.name,
2024-09-16 02:56:02 +08:00
// Helper.FloatFromHalfPrecision(movData.currentPos.x), Helper.FloatFromHalfPrecision(movData.currentPos.y),
// Helper.FloatFromHalfPrecision(movData.currentPos.z));
foreach (var c in Server.Instance.Clients)
{
if (c == context || c.Character == null || c.CurrentZone != context.CurrentZone)
continue;
2024-12-06 00:31:51 +08:00
c.SendPacket(new MovementEndPacket(movData));
2024-09-16 02:56:02 +08:00
}
}
#endregion
}
}