protected override void DeserializeImpl(IIncomingMessageStream messageStream) { var id = messageStream.ReadInt32(); var properties = messageStream.ReadEntityProperties <ItemSpecProperty>(); ItemSpec = new ItemSpec(id); foreach (var prop in properties) { ItemSpec.SetProperty(prop); } }
static InventoryItem ReadInventoryItem(IIncomingMessageStream stream, long inventoryId) { var specId = stream.ReadInt32(); if (specId == EmptyInventorySlotSpecId) { Logger.Write("Reading empty inventory item"); return(null); } Logger.Write(string.Format("Reading inventory item with item spec id {0}", specId)); var properties = stream.ReadEntityProperties <InventoryItemProperty>(); var ret = new InventoryItem(null, specId); foreach (var item in properties) { ret.SetProperty(item); } return(ret); }