static void WriteInventoryItem(IOutgoingMessageStream stream, InventoryItem inventoryItem)
        {
            if (inventoryItem == null)
            {
                Logger.Write("Writing empty inventory item");
                stream.WriteInt32(EmptyInventorySlotSpecId);
                return;
            }

            Logger.Write(string.Format("Writing inventory item with item spec id {0}", inventoryItem.ItemSpecId));

            if (inventoryItem.ItemSpecId == 0)
            {
                throw new Exception("ItemSpec has id of 0. Make sure you use correct StaticItemSpecCache ritual.");
            }

            stream.WriteInt32(inventoryItem.ItemSpecId);
            stream.Write(inventoryItem.GetProperties().ToList());
        }
示例#2
0
 protected override void SerializeImpl(IOutgoingMessageStream messageStream)
 {
     messageStream.WriteEntityId(EntityId);
     messageStream.WriteInt32(SpecId);
     messageStream.WriteInt32(UsageTime);
 }
示例#3
0
 protected override void SerializeImpl(IOutgoingMessageStream messageStream)
 {
     messageStream.WriteInt32(Amount);
 }
示例#4
0
 protected override void SerializeImpl(IOutgoingMessageStream messageStream)
 {
     messageStream.WriteInt32(ItemSpecId);
 }
示例#5
0
 protected override void SerializeImpl(IOutgoingMessageStream messageStream)
 {
     messageStream.Write(RemotePlayer);
     messageStream.WriteInt32(NewLevel);
 }
示例#6
0
 protected override void SerializeImpl(IOutgoingMessageStream messageStream)
 {
     messageStream.WriteInt32(ContainerEntityId);
 }
示例#7
0
 protected override void SerializeImpl(IOutgoingMessageStream messageStream)
 {
     messageStream.WriteInt32(ItemSpec.Id);
     messageStream.Write(ItemSpec.GetProperties().ToList());
 }
示例#8
0
 protected override void SerializeImpl(IOutgoingMessageStream messageStream)
 {
     messageStream.WriteInt32(LoadedAmmoTotal);
 }