예제 #1
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     SourceInventoryId = messageStream.ReadInt64();
     SourceSlot        = messageStream.ReadByte();
     TargetInventoryId = messageStream.ReadInt64();
     TargetSlot        = messageStream.ReadByte();
 }
예제 #2
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     SwingDirection = messageStream.ReadFloat();
     HitZombies     = messageStream.ReadEntityIds();
     HitHumans      = messageStream.ReadEntityIds();
     HitScenery     = messageStream.ReadEntityIds();
     StartPoint     = messageStream.ReadVector();
     EntityUser     = messageStream.ReadEntityId();
 }
예제 #3
0
        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);
            }
        }
        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);
        }
예제 #5
0
        protected override void DeserializeImpl(IIncomingMessageStream messageStream)
        {
            base.DeserializeImpl(messageStream);

            byte count = 1;

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

            BulletEffects = ReadBulletEffects(messageStream, count);
        }
예제 #6
0
        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);
        }
        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);
        }
예제 #9
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     ItemSpecId = messageStream.ReadInt32();
 }
예제 #10
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     StartPoint = messageStream.ReadVector();
 }
예제 #11
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     EntityId  = messageStream.ReadEntityId();
     SpecId    = messageStream.ReadInt32();
     UsageTime = messageStream.ReadInt32();
 }
예제 #12
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     base.DeserializeImpl(messageStream);
     EntityUser = messageStream.ReadEntityId();
 }
예제 #13
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     ContainerEntityId = messageStream.ReadInt32();
 }
예제 #14
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     LoadedAmmoTotal = messageStream.ReadInt32();
 }
예제 #15
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     InventoryId = messageStream.ReadInt64();
 }
예제 #16
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     EntityId = messageStream.ReadEntityId();
 }
예제 #17
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     Position       = messageStream.ReadVector();
     Rotation       = messageStream.ReadFloat();
     MovementVector = messageStream.ReadVector();
 }
예제 #18
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     Rotation = messageStream.ReadRotation();
 }
예제 #19
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     RemotePlayer = messageStream.ReadRemotePlayer();
     NewLevel     = messageStream.ReadInt32();
 }
예제 #20
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
 }
예제 #21
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     ClientId       = messageStream.ReadUint16();
     GameTimeHour   = messageStream.ReadByte();
     GameTimeMinute = messageStream.ReadByte();
 }
예제 #22
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     Amount = messageStream.ReadInt32();
 }
예제 #23
0
 protected override void DeserializeImpl(IIncomingMessageStream messageStream)
 {
     Name = messageStream.ReadString();
 }