protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     SourceInventoryId = messageStream.ReadInt64();
     SourceSlot        = messageStream.ReadByte();
     TargetInventoryId = messageStream.ReadInt64();
     TargetSlot        = messageStream.ReadByte();
 }
        protected override void DeserializeImpl(IIncomingMessageStream messageStream)
        {
            base.DeserializeImpl(messageStream);

            byte count = 1;

            if (_minBulletCount != 1 || _maxBulletCount != 1)
            {
                count = messageStream.ReadByte();
            }

            BulletEffects = ReadBulletEffects(messageStream, count);
        }
        protected override void DeserializeImpl(IIncomingMessageStream messageStream)
        {
            PartialUpdate = messageStream.ReadBoolean();

            if (!PartialUpdate)
            {
                InventorySize = messageStream.ReadByte();
            }

            InventoryId      = messageStream.ReadInt64();
            InventoryType    = (InventoryType)messageStream.ReadInt16();
            InventoryContent = ReadInventoryContent(messageStream, InventoryId);
        }
        private static List <BulletEffectData> ReadBulletEffects(IIncomingMessageStream messageStream, short count)
        {
            var ret = new List <BulletEffectData>(count);

            for (var i = 0; i < count; ++i)
            {
                var item = new BulletEffectData();
                item.EndPoint = messageStream.ReadVector();
                item.Rotation = messageStream.ReadFloat();
                item.Effect   = messageStream.ReadByte();

                ret.Add(item);
            }

            return(ret);
        }
        static Dictionary <byte, InventoryItem> ReadInventoryContent(IIncomingMessageStream stream, long inventoryId)
        {
            var count = stream.ReadInt16();
            var ret   = new Dictionary <byte, InventoryItem>(count);

            Logger.Write(string.Format("Reading {0} inventory slots", count));

            for (var i = 0; i < count; ++i)
            {
                var key = stream.ReadByte();

                Logger.Write(string.Format("Reading inventory slot {0}", key));

                var value = ReadInventoryItem(stream, inventoryId);

                Logger.Write(string.Format("Finished inventory slot {0}.", key));

                ret[key] = value;
            }

            return(ret);
        }
Beispiel #6
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     InventoryId     = messageStream.ReadInt64();
     InventorySlotId = messageStream.ReadByte();
 }
Beispiel #7
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     ClientId       = messageStream.ReadUint16();
     GameTimeHour   = messageStream.ReadByte();
     GameTimeMinute = messageStream.ReadByte();
 }