Example #1
0
        public override void Deserialize(ICustomDataInput reader)
        {
            QuestType  = reader.ReadByte();
            StartMapId = reader.ReadDouble();
            var countKnownStepsList = reader.ReadShort();

            KnownStepsList = new List <TreasureHuntStep>();
            for (short i = 0; i < countKnownStepsList; i++)
            {
                var knownStepsListtypeId = reader.ReadShort();
                TreasureHuntStep type    = new TreasureHuntStep();
                type.Deserialize(reader);
                KnownStepsList.Add(type);
            }
            TotalStepCount      = reader.ReadByte();
            CheckPointCurrent   = reader.ReadVarInt();
            CheckPointTotal     = reader.ReadVarInt();
            AvailableRetryCount = reader.ReadInt();
            var countFlags = reader.ReadShort();

            Flags = new List <TreasureHuntFlag>();
            for (short i = 0; i < countFlags; i++)
            {
                TreasureHuntFlag type = new TreasureHuntFlag();
                type.Deserialize(reader);
                Flags.Add(type);
            }
        }
Example #2
0
        public override void Deserialize(IDataReader reader)
        {
            int knownStepsListCount = reader.ReadUShort();
            int knownStepsListIndex;

            m_knownStepsList = new System.Collections.Generic.List <TreasureHuntStep>();
            for (knownStepsListIndex = 0; (knownStepsListIndex < knownStepsListCount); knownStepsListIndex = (knownStepsListIndex + 1))
            {
                TreasureHuntStep objectToAdd = ProtocolManager.GetTypeInstance <TreasureHuntStep>(reader.ReadUShort());
                objectToAdd.Deserialize(reader);
                m_knownStepsList.Add(objectToAdd);
            }
            int flagsCount = reader.ReadUShort();
            int flagsIndex;

            m_flags = new System.Collections.Generic.List <TreasureHuntFlag>();
            for (flagsIndex = 0; (flagsIndex < flagsCount); flagsIndex = (flagsIndex + 1))
            {
                TreasureHuntFlag objectToAdd = new TreasureHuntFlag();
                objectToAdd.Deserialize(reader);
                m_flags.Add(objectToAdd);
            }
            m_questType           = reader.ReadByte();
            m_startMapId          = reader.ReadInt();
            m_totalStepCount      = reader.ReadByte();
            m_checkPointCurrent   = reader.ReadVarUhInt();
            m_checkPointTotal     = reader.ReadVarUhInt();
            m_availableRetryCount = reader.ReadInt();
        }
Example #3
0
        public override void Deserialize(IDataReader reader)
        {
            QuestType  = reader.ReadByte();
            StartMapId = reader.ReadDouble();
            var knownStepsListCount = reader.ReadUShort();

            KnownStepsList = new List <TreasureHuntStep>();
            for (var knownStepsListIndex = 0; knownStepsListIndex < knownStepsListCount; knownStepsListIndex++)
            {
                var objectToAdd = ProtocolTypeManager.GetInstance <TreasureHuntStep>(reader.ReadUShort());
                objectToAdd.Deserialize(reader);
                KnownStepsList.Add(objectToAdd);
            }
            TotalStepCount      = reader.ReadByte();
            CheckPointCurrent   = reader.ReadVarUhInt();
            CheckPointTotal     = reader.ReadVarUhInt();
            AvailableRetryCount = reader.ReadInt();
            var flagsCount = reader.ReadUShort();

            Flags = new List <TreasureHuntFlag>();
            for (var flagsIndex = 0; flagsIndex < flagsCount; flagsIndex++)
            {
                var objectToAdd = new TreasureHuntFlag();
                objectToAdd.Deserialize(reader);
                Flags.Add(objectToAdd);
            }
        }
Example #4
0
        public override void Deserialize(IDataReader reader)
        {
            this.questType = (uint)reader.ReadByte();
            if (this.questType < 0U)
            {
                throw new Exception("Forbidden value (" + (object)this.questType + ") on element of TreasureHuntMessage.questType.");
            }
            this.startMapId = reader.ReadDouble();
            if (this.startMapId < 0.0 || this.startMapId > 9.00719925474099E+15)
            {
                throw new Exception("Forbidden value (" + (object)this.startMapId + ") on element of TreasureHuntMessage.startMapId.");
            }
            uint num1 = (uint)reader.ReadUShort();

            for (int index = 0; (long)index < (long)num1; ++index)
            {
                TreasureHuntStep instance = ProtocolTypeManager.GetInstance <TreasureHuntStep>((uint)reader.ReadUShort());
                instance.Deserialize(reader);
                this.knownStepsList.Add(instance);
            }
            this.totalStepCount = (uint)reader.ReadByte();
            if (this.totalStepCount < 0U)
            {
                throw new Exception("Forbidden value (" + (object)this.totalStepCount + ") on element of TreasureHuntMessage.totalStepCount.");
            }
            this.checkPointCurrent = reader.ReadVarUhInt();
            if (this.checkPointCurrent < 0U)
            {
                throw new Exception("Forbidden value (" + (object)this.checkPointCurrent + ") on element of TreasureHuntMessage.checkPointCurrent.");
            }
            this.checkPointTotal = reader.ReadVarUhInt();
            if (this.checkPointTotal < 0U)
            {
                throw new Exception("Forbidden value (" + (object)this.checkPointTotal + ") on element of TreasureHuntMessage.checkPointTotal.");
            }
            this.availableRetryCount = reader.ReadInt();
            uint num2 = (uint)reader.ReadUShort();

            for (int index = 0; (long)index < (long)num2; ++index)
            {
                TreasureHuntFlag treasureHuntFlag = new TreasureHuntFlag();
                treasureHuntFlag.Deserialize(reader);
                this.flags.Add(treasureHuntFlag);
            }
        }