PSO2SERVER/Server/Protocol/Packets/08-SpawnPacket/08-05-TransporterSpawnPacket.cs

67 lines
1.9 KiB
C#
Raw Normal View History

2024-12-08 11:33:06 +08:00
using Newtonsoft.Json;
using PSO2SERVER.Models;
2024-12-06 23:40:36 +08:00
using PSO2SERVER.Zone;
2024-09-18 03:47:04 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Protocol.Packets
2024-09-18 03:47:04 +08:00
{
public class TransporterSpawnPacket : Packet
{
2024-12-08 11:33:06 +08:00
[JsonProperty("object")]
2024-12-06 23:40:36 +08:00
public ObjectHeader objHeader { get; set; } = new ObjectHeader();
2024-12-08 11:33:06 +08:00
[JsonProperty("position")]
2024-12-06 23:40:36 +08:00
public PSOLocation objPosition { get; set; } = new PSOLocation();
public ushort unk1 { get; set; } = 0;
/// Enemy name.
2024-12-08 11:33:06 +08:00
[JsonProperty("name")]
2024-12-06 23:40:36 +08:00
public string objName { get; set; } = string.Empty;//0x20
public uint unk2 { get; set; } = 0;
public ushort unk3 { get; set; } = 0;
public ushort unk4 { get; set; } = 0;
public ushort unk5 { get; set; } = 0;
public ushort unk6 { get; set; } = 0;
public uint unk7 { get; set; } = 0;
public uint unk8 { get; set; } = 0;
2024-09-18 03:47:04 +08:00
2024-12-06 23:40:36 +08:00
public TransporterSpawnPacket(PSOObject obj)
2024-09-18 03:47:04 +08:00
{
2024-12-06 23:40:36 +08:00
objHeader = obj.Header;
objPosition = obj.Position;
objName = obj.Name;
2024-09-18 03:47:04 +08:00
}
2024-12-08 11:33:06 +08:00
public TransporterSpawnPacket()
{
}
2024-09-18 03:47:04 +08:00
#region implemented abstract members of Packet
public override byte[] Build()
{
var pkt = new PacketWriter();
2024-12-06 23:40:36 +08:00
pkt.WriteStruct(objHeader);
pkt.WritePosition(objPosition);
pkt.Write(unk1); // Padding?
pkt.WriteFixedLengthASCII(objName, 0x20);
pkt.Write(unk2);
pkt.Write(unk3);
pkt.Write(unk4);
pkt.Write(unk5);
pkt.Write(unk6);
pkt.Write(unk7);
pkt.Write(unk8);
2024-09-18 03:47:04 +08:00
return pkt.ToArray();
}
public override PacketHeader GetHeader()
{
return new PacketHeader(0x08, 0x05, PacketFlags.None);
}
#endregion
}
}