using PSO2SERVER.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace PSO2SERVER.Protocol.Packets { public class UpdateStoragePacket : Packet { // Unk field (can be a list of UpdatedStorageItem) public List Unk { get; set; } // Already existing items being updated public List Updated { get; set; } // New items added public List NewItems { get; set; } // Additional unknown fields (uint and ulong) public uint Unk2 { get; set; } public ulong Unk3 { get; set; } public UpdateStoragePacket(List unk, List updated, List newItems, uint unk2, ulong unk3) { Unk = unk; Updated = updated; NewItems = newItems; Unk2 = unk2; Unk3 = unk3; } #region implemented abstract members of Packet public override byte[] Build() { var pkt = new PacketWriter(); pkt.WriteMagic(Unk.Count, 0x4DC2, 0x2A); foreach(var u in Unk) { pkt.WriteStruct(u); } pkt.WriteMagic(Updated.Count, 0x4DC2, 0x2A); foreach (var u in Updated) { pkt.WriteStruct(u); } pkt.WriteMagic(NewItems.Count, 0x4DC2, 0x2A); foreach (var u in NewItems) { pkt.WriteStruct(u); } pkt.Write(Unk2); pkt.Write(Unk3); return pkt.ToArray(); } public override PacketHeader GetHeader() { return new PacketHeader(0x0F, 0x22, PacketFlags.PACKED); } #endregion } }