using System; using System.Collections.Generic; using PSO2SERVER.Models; namespace PSO2SERVER.Protocol.Packets { public class MoveToMatStoragePacket : Packet { /// /// Items updated in the inventory. /// public List UpdatedInventory; // Equivalent to Vec /// /// Items updated in the material storage. /// public List UpdatedMaterialStorage; // Assuming this exists #region implemented abstract members of Packet public MoveToMatStoragePacket(List updatedInventoryItems, List materialStorageItems) { this.UpdatedInventory = updatedInventoryItems; this.UpdatedMaterialStorage = materialStorageItems; } public override byte[] Build() { var pkt = new PacketWriter(); pkt.WriteMagic(UpdatedInventory.Count, 0x1644, 0x35); foreach (var item in UpdatedInventory) {pkt.WriteStruct(item);} pkt.WriteMagic(UpdatedMaterialStorage.Count, 0x1644, 0x35); foreach(var item in UpdatedMaterialStorage) {pkt.WriteStruct(item);} return pkt.ToArray(); } public override PacketHeader GetHeader() { return new PacketHeader(0x0F, 0xE1, PacketFlags.PACKED); } #endregion } }