PSO2SERVER/Server/Packets/Handlers/04-ObjectHandler/04-3C-ActionUpdateHandler.cs

37 lines
1.3 KiB
C#
Raw Normal View History

2024-09-16 02:56:02 +08:00
using PSO2SERVER.Models;
2024-09-18 01:50:29 +08:00
using PSO2SERVER.Packets.PSOPackets;
2024-09-16 02:56:02 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSO2SERVER.Packets.Handlers
{
[PacketHandlerAttr(0x04, 0x3C)]
public class ActionUpdateHandler : PacketHandler
{
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
PacketReader reader = new PacketReader(data);
reader.ReadStruct<ObjectHeader>(); // Read the blank
ObjectHeader actor = reader.ReadStruct<ObjectHeader>(); // Read the actor
byte[] rest = reader.ReadBytes(32); // TODO Map this out and do stuff with it!
foreach (var c in Server.Instance.Clients)
{
if (c == context || c.Character == null || c.CurrentZone != context.CurrentZone)
continue;
2024-09-18 01:50:29 +08:00
//PacketWriter writer = new PacketWriter();
2024-09-20 21:58:37 +08:00
//writer.WriteStruct(new ObjectHeader((uint)c._account.AccountId, EntityType.Account));
2024-09-18 01:50:29 +08:00
//writer.WriteStruct(actor);
//writer.Write(rest);
2024-09-16 02:56:02 +08:00
2024-09-18 01:50:29 +08:00
//c.SendPacket(0x4, 0x81, 0x40, writer.ToArray());
2024-09-20 21:58:37 +08:00
c.SendPacket(new ActionUpdateServerPacket(c._account.AccountId, actor, rest));
2024-09-16 02:56:02 +08:00
}
}
}
}