using System.IO; namespace Dalamud.Game.Network.Structures; /// /// Represents market board purchase information. This message is received from the /// server when a purchase is made at a market board. /// public class MarketBoardPurchase { private MarketBoardPurchase() { } /// /// Gets the item ID of the item that was purchased. /// public uint CatalogId { get; private set; } /// /// Gets the quantity of the item that was purchased. /// public uint ItemQuantity { get; private set; } /// /// Reads market board purchase information from the struct at the provided pointer. /// /// A pointer to a struct containing market board purchase information from the server. /// An object representing the data read. public static unsafe MarketBoardPurchase Read(IntPtr dataPtr) { using var stream = new UnmanagedMemoryStream((byte*)dataPtr.ToPointer(), 1544); using var reader = new BinaryReader(stream); var output = new MarketBoardPurchase(); output.CatalogId = reader.ReadUInt32(); stream.Position += 4; output.ItemQuantity = reader.ReadUInt32(); return output; } }