PSO2SERVER/Server/Packets/PSOPackets/04-ObjectPacket/04-02-TeleportTransferPacket.cs

33 lines
838 B
C#
Raw Normal View History

2024-09-10 00:31:40 +08:00
using System;
2024-09-10 01:13:20 +08:00
using PSO2SERVER.Models;
2024-09-10 00:31:40 +08:00
2024-09-10 01:13:20 +08:00
namespace PSO2SERVER.Packets.PSOPackets
2024-09-10 00:31:40 +08:00
{
class TeleportTransferPacket : Packet
{
private PSOObject src;
private PSOLocation dst;
public TeleportTransferPacket(PSOObject srcTeleporter, PSOLocation destination)
{
src = srcTeleporter;
dst = destination;
}
public override byte[] Build()
{
PacketWriter writer = new PacketWriter();
writer.Write(new byte[12]);
writer.WriteStruct(src.Header);
writer.WritePosition(dst);
writer.Write(new byte[2]);
return writer.ToArray();
}
public override PacketHeader GetHeader()
{
2024-09-16 16:58:51 +08:00
return new PacketHeader(0x04, 0x02, PacketFlags.OBJECT_RELATED);
2024-09-10 00:31:40 +08:00
}
}
}