コード例 #1
0
        public override void Deserialize(BigEndianReader reader)
        {
            dungeonId = reader.ReadShort();
            if (dungeonId < 0)
            {
                throw new Exception("Forbidden value on dungeonId = " + dungeonId + ", it doesn't respect the following condition : dungeonId < 0");
            }
            inviterId = reader.ReadInt();
            if (inviterId < 0)
            {
                throw new Exception("Forbidden value on inviterId = " + inviterId + ", it doesn't respect the following condition : inviterId < 0");
            }
            var limit = reader.ReadUShort();

            invalidBuddiesIds = new int[limit];
            for (int i = 0; i < limit; i++)
            {
                invalidBuddiesIds[i] = reader.ReadInt();
            }
        }
コード例 #2
0
        public override void Deserialize(BigEndianReader reader)
        {
            byte flag1 = reader.ReadByte();

            autoconnect    = BooleanByteWrapper.GetFlag(flag1, 0);
            useCertificate = BooleanByteWrapper.GetFlag(flag1, 1);
            useLoginToken  = BooleanByteWrapper.GetFlag(flag1, 2);
            version        = new Types.VersionExtended();
            version.Deserialize(reader);
            lang = reader.ReadUTF();
            var limit = reader.ReadUShort();

            credentials = new sbyte[limit];
            for (int i = 0; i < limit; i++)
            {
                credentials[i] = reader.ReadSByte();
            }
            serverId            = reader.ReadShort();
            sessionOptionalSalt = reader.ReadDouble();
        }
コード例 #3
0
        public override void Deserialize(BigEndianReader reader)
        {
            fightId = reader.ReadInt();
            if (fightId < 0)
            {
                throw new Exception("Forbidden value on fightId = " + fightId + ", it doesn't respect the following condition : fightId < 0");
            }
            var limit = reader.ReadUShort();

            alliesId = new int[limit];
            for (int i = 0; i < limit; i++)
            {
                alliesId[i] = reader.ReadInt();
            }
            duration = reader.ReadShort();
            if (duration < 0)
            {
                throw new Exception("Forbidden value on duration = " + duration + ", it doesn't respect the following condition : duration < 0");
            }
        }
コード例 #4
0
 public virtual void Deserialize(BigEndianReader reader)
 {
     guestId = reader.ReadInt();
     if (guestId < 0)
     {
         throw new Exception("Forbidden value on guestId = " + guestId + ", it doesn't respect the following condition : guestId < 0");
     }
     hostId = reader.ReadInt();
     if (hostId < 0)
     {
         throw new Exception("Forbidden value on hostId = " + hostId + ", it doesn't respect the following condition : hostId < 0");
     }
     name      = reader.ReadUTF();
     guestLook = new Types.EntityLook();
     guestLook.Deserialize(reader);
     breed  = reader.ReadSByte();
     sex    = reader.ReadBoolean();
     status = Types.ProtocolTypeManager.GetInstance <Types.PlayerStatus>(reader.ReadShort());
     status.Deserialize(reader);
 }
コード例 #5
0
 public virtual void Deserialize(BigEndianReader reader)
 {
     playerId = reader.ReadInt();
     if (playerId < 0)
     {
         throw new Exception("Forbidden value on playerId = " + playerId + ", it doesn't respect the following condition : playerId < 0");
     }
     playerName = reader.ReadUTF();
     breed      = reader.ReadSByte();
     if (breed < (byte)Enums.PlayableBreedEnum.Feca || breed > (byte)Enums.PlayableBreedEnum.Steamer)
     {
         throw new Exception("Forbidden value on breed = " + breed + ", it doesn't respect the following condition : breed < (byte)Enums.PlayableBreedEnum.Feca || breed > (byte)Enums.PlayableBreedEnum.Steamer");
     }
     sex   = reader.ReadBoolean();
     level = reader.ReadShort();
     if (level < 0)
     {
         throw new Exception("Forbidden value on level = " + level + ", it doesn't respect the following condition : level < 0");
     }
 }
コード例 #6
0
        public override void Deserialize(BigEndianReader reader)
        {
            var limit = reader.ReadUShort();

            alliances = new Types.AllianceInformations[limit];
            for (int i = 0; i < limit; i++)
            {
                alliances[i] = new Types.AllianceInformations();
                alliances[i].Deserialize(reader);
            }
            limit             = reader.ReadUShort();
            allianceNbMembers = new short[limit];
            for (int i = 0; i < limit; i++)
            {
                allianceNbMembers[i] = reader.ReadShort();
            }
            limit = reader.ReadUShort();
            allianceRoundWeigth = new int[limit];
            for (int i = 0; i < limit; i++)
            {
                allianceRoundWeigth[i] = reader.ReadInt();
            }
            limit = reader.ReadUShort();
            allianceMatchScore = new sbyte[limit];
            for (int i = 0; i < limit; i++)
            {
                allianceMatchScore[i] = reader.ReadSByte();
            }
            allianceMapWinner = new Types.BasicAllianceInformations();
            allianceMapWinner.Deserialize(reader);
            allianceMapWinnerScore = reader.ReadInt();
            if (allianceMapWinnerScore < 0)
            {
                throw new Exception("Forbidden value on allianceMapWinnerScore = " + allianceMapWinnerScore + ", it doesn't respect the following condition : allianceMapWinnerScore < 0");
            }
            allianceMapMyAllianceScore = reader.ReadInt();
            if (allianceMapMyAllianceScore < 0)
            {
                throw new Exception("Forbidden value on allianceMapMyAllianceScore = " + allianceMapMyAllianceScore + ", it doesn't respect the following condition : allianceMapMyAllianceScore < 0");
            }
        }
コード例 #7
0
        public override void Deserialize(BigEndianReader reader)
        {
            base.Deserialize(reader);
            spellId = reader.ReadVarShort();
            if (spellId < 0)
            {
                throw new Exception("Forbidden value on spellId = " + spellId + ", it doesn't respect the following condition : spellId < 0");
            }
            spellLevel = reader.ReadSByte();
            if (spellLevel < 1 || spellLevel > 6)
            {
                throw new Exception("Forbidden value on spellLevel = " + spellLevel + ", it doesn't respect the following condition : spellLevel < 1 || spellLevel > 6");
            }
            var limit = reader.ReadUShort();

            portalsIds = new short[limit];
            for (int i = 0; i < limit; i++)
            {
                portalsIds[i] = reader.ReadShort();
            }
        }
コード例 #8
0
 public override void Deserialize(BigEndianReader reader)
 {
     base.Deserialize(reader);
     leaderName         = reader.ReadUTF();
     nbConnectedMembers = reader.ReadShort();
     if (nbConnectedMembers < 0)
     {
         throw new Exception("Forbidden value on nbConnectedMembers = " + nbConnectedMembers + ", it doesn't respect the following condition : nbConnectedMembers < 0");
     }
     nbTaxCollectors = reader.ReadSByte();
     if (nbTaxCollectors < 0)
     {
         throw new Exception("Forbidden value on nbTaxCollectors = " + nbTaxCollectors + ", it doesn't respect the following condition : nbTaxCollectors < 0");
     }
     lastActivity = reader.ReadInt();
     if (lastActivity < 0)
     {
         throw new Exception("Forbidden value on lastActivity = " + lastActivity + ", it doesn't respect the following condition : lastActivity < 0");
     }
     enabled = reader.ReadBoolean();
 }
コード例 #9
0
 public override void Deserialize(BigEndianReader reader)
 {
     base.Deserialize(reader);
     lifePoints = reader.ReadInt();
     if (lifePoints < 0)
     {
         throw new Exception("Forbidden value on lifePoints = " + lifePoints + ", it doesn't respect the following condition : lifePoints < 0");
     }
     maxLifePoints = reader.ReadInt();
     if (maxLifePoints < 0)
     {
         throw new Exception("Forbidden value on maxLifePoints = " + maxLifePoints + ", it doesn't respect the following condition : maxLifePoints < 0");
     }
     prospecting = reader.ReadShort();
     if (prospecting < 0)
     {
         throw new Exception("Forbidden value on prospecting = " + prospecting + ", it doesn't respect the following condition : prospecting < 0");
     }
     regenRate = reader.ReadByte();
     if (regenRate < 0 || regenRate > 255)
     {
         throw new Exception("Forbidden value on regenRate = " + regenRate + ", it doesn't respect the following condition : regenRate < 0 || regenRate > 255");
     }
     initiative = reader.ReadShort();
     if (initiative < 0)
     {
         throw new Exception("Forbidden value on initiative = " + initiative + ", it doesn't respect the following condition : initiative < 0");
     }
     alignmentSide = reader.ReadSByte();
     worldX        = reader.ReadShort();
     if (worldX < -255 || worldX > 255)
     {
         throw new Exception("Forbidden value on worldX = " + worldX + ", it doesn't respect the following condition : worldX < -255 || worldX > 255");
     }
     worldY = reader.ReadShort();
     if (worldY < -255 || worldY > 255)
     {
         throw new Exception("Forbidden value on worldY = " + worldY + ", it doesn't respect the following condition : worldY < -255 || worldY > 255");
     }
     mapId     = reader.ReadInt();
     subAreaId = reader.ReadShort();
     if (subAreaId < 0)
     {
         throw new Exception("Forbidden value on subAreaId = " + subAreaId + ", it doesn't respect the following condition : subAreaId < 0");
     }
     status = Types.ProtocolTypeManager.GetInstance <Types.PlayerStatus>(reader.ReadShort());
     status.Deserialize(reader);
 }
コード例 #10
0
        // Methods
        internal void Init(BigEndianReader Reader, int MapVersion)
        {
            if (MapVersion >= 9)
            {
                LayerId = Reader.ReadByte();
            }
            else
            {
                LayerId = Reader.ReadInt();
            }
            CellsCount = Reader.ReadShort();
            int cellsCount = CellsCount;
            int i          = 1;

            while ((i <= cellsCount))
            {
                Cell item = new Cell();
                item.Init(Reader, MapVersion);
                Cells.Add(item);
                i += 1;
            }
        }
        public override void Deserialize(BigEndianReader reader)
        {
            dungeonId = reader.ReadShort();
            if (dungeonId < 0)
            {
                throw new Exception("Forbidden value on dungeonId = " + dungeonId + ", it doesn't respect the following condition : dungeonId < 0");
            }
            var limit = reader.ReadUShort();

            addedPlayers = new Types.DungeonPartyFinderPlayer[limit];
            for (int i = 0; i < limit; i++)
            {
                addedPlayers[i] = new Types.DungeonPartyFinderPlayer();
                addedPlayers[i].Deserialize(reader);
            }
            limit             = reader.ReadUShort();
            removedPlayersIds = new int[limit];
            for (int i = 0; i < limit; i++)
            {
                removedPlayersIds[i] = reader.ReadInt();
            }
        }
コード例 #12
0
        public override void Deserialize(BigEndianReader reader)
        {
            base.Deserialize(reader);
            byte flag1 = reader.ReadByte();

            keyRingBonus      = BooleanByteWrapper.GetFlag(flag1, 0);
            hasHardcoreDrop   = BooleanByteWrapper.GetFlag(flag1, 1);
            hasAVARewardToken = BooleanByteWrapper.GetFlag(flag1, 2);
            staticInfos       = Types.ProtocolTypeManager.GetInstance <Types.GroupMonsterStaticInformations>(reader.ReadShort());
            staticInfos.Deserialize(reader);
            ageBonus = reader.ReadShort();
            if (ageBonus < -1 || ageBonus > 1000)
            {
                throw new Exception("Forbidden value on ageBonus = " + ageBonus + ", it doesn't respect the following condition : ageBonus < -1 || ageBonus > 1000");
            }
            lootShare = reader.ReadSByte();
            if (lootShare < -1 || lootShare > 8)
            {
                throw new Exception("Forbidden value on lootShare = " + lootShare + ", it doesn't respect the following condition : lootShare < -1 || lootShare > 8");
            }
            alignmentSide = reader.ReadSByte();
        }
コード例 #13
0
ファイル: Layer.cs プロジェクト: gateaubleu/Burning
        public void FromRaw(BigEndianReader param1, int param2)
        {
            BigEndianReader bigEndianReader = param1;
            int             num             = param2;

            try
            {
                this.LayerId    = num >= 9 ? (int)bigEndianReader.ReadByte() : bigEndianReader.ReadInt();
                this.CellsCount = (int)bigEndianReader.ReadShort();
                this.Cells      = new Cell[this.CellsCount];
                for (int index = 0; index < this.CellsCount; ++index)
                {
                    Cell cell = new Cell(this);
                    cell.FromRaw(bigEndianReader, num);
                    this.Cells[index] = cell;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine((object)ex);
                throw;
            }
        }
コード例 #14
0
 public override void Deserialize(BigEndianReader reader)
 {
     memberId = reader.ReadInt();
     if (memberId < 0)
     {
         throw new Exception("Forbidden value on memberId = " + memberId + ", it doesn't respect the following condition : memberId < 0");
     }
     rank = reader.ReadShort();
     if (rank < 0)
     {
         throw new Exception("Forbidden value on rank = " + rank + ", it doesn't respect the following condition : rank < 0");
     }
     experienceGivenPercent = reader.ReadSByte();
     if (experienceGivenPercent < 0 || experienceGivenPercent > 100)
     {
         throw new Exception("Forbidden value on experienceGivenPercent = " + experienceGivenPercent + ", it doesn't respect the following condition : experienceGivenPercent < 0 || experienceGivenPercent > 100");
     }
     rights = reader.ReadUInt();
     if (rights < 0 || rights > 4.294967295E9)
     {
         throw new Exception("Forbidden value on rights = " + rights + ", it doesn't respect the following condition : rights < 0 || rights > 4.294967295E9");
     }
 }
コード例 #15
0
ファイル: Achievement.cs プロジェクト: TifouxDev/OptimusApi
        public virtual void Deserialize(BigEndianReader reader)
        {
            id = reader.ReadShort();
            if (id < 0)
            {
                throw new Exception("Forbidden value on id = " + id + ", it doesn't respect the following condition : id < 0");
            }
            var limit = reader.ReadUShort();

            finishedObjective = new Types.AchievementObjective[limit];
            for (int i = 0; i < limit; i++)
            {
                finishedObjective[i] = new Types.AchievementObjective();
                finishedObjective[i].Deserialize(reader);
            }
            limit             = reader.ReadUShort();
            startedObjectives = new Types.AchievementStartedObjective[limit];
            for (int i = 0; i < limit; i++)
            {
                startedObjectives[i] = new Types.AchievementStartedObjective();
                startedObjectives[i].Deserialize(reader);
            }
        }
コード例 #16
0
        public override void Deserialize(BigEndianReader reader)
        {
            var limit = reader.ReadUShort();

            effects = new Types.FightDispellableEffectExtendedInformations[limit];
            for (int i = 0; i < limit; i++)
            {
                effects[i] = new Types.FightDispellableEffectExtendedInformations();
                effects[i].Deserialize(reader);
            }
            limit = reader.ReadUShort();
            marks = new Types.GameActionMark[limit];
            for (int i = 0; i < limit; i++)
            {
                marks[i] = new Types.GameActionMark();
                marks[i].Deserialize(reader);
            }
            gameTurn = reader.ReadShort();
            if (gameTurn < 0)
            {
                throw new Exception("Forbidden value on gameTurn = " + gameTurn + ", it doesn't respect the following condition : gameTurn < 0");
            }
        }
コード例 #17
0
        public override void Deserialize(BigEndianReader reader)
        {
            base.Deserialize(reader);
            objectGID = reader.ReadShort();
            if (objectGID < 0)
            {
                throw new Exception("Forbidden value on objectGID = " + objectGID + ", it doesn't respect the following condition : objectGID < 0");
            }
            var limit = reader.ReadUShort();

            effects = new Types.ObjectEffect[limit];
            for (int i = 0; i < limit; i++)
            {
                effects[i] = Types.ProtocolTypeManager.GetInstance <Types.ObjectEffect>(reader.ReadShort());
                effects[i].Deserialize(reader);
            }
            objectUID = reader.ReadInt();
            if (objectUID < 0)
            {
                throw new Exception("Forbidden value on objectUID = " + objectUID + ", it doesn't respect the following condition : objectUID < 0");
            }
            quantity = reader.ReadInt();
            if (quantity < 0)
            {
                throw new Exception("Forbidden value on quantity = " + quantity + ", it doesn't respect the following condition : quantity < 0");
            }
            objectPrice = reader.ReadInt();
            if (objectPrice < 0)
            {
                throw new Exception("Forbidden value on objectPrice = " + objectPrice + ", it doesn't respect the following condition : objectPrice < 0");
            }
            publicPrice = reader.ReadInt();
            if (publicPrice < 0)
            {
                throw new Exception("Forbidden value on publicPrice = " + publicPrice + ", it doesn't respect the following condition : publicPrice < 0");
            }
        }
コード例 #18
0
 public override void Deserialize(BigEndianReader reader)
 {
     areaId        = reader.ReadInt();
     atLeastNbRoom = reader.ReadSByte();
     if (atLeastNbRoom < 0)
     {
         throw new Exception("Forbidden value on atLeastNbRoom = " + atLeastNbRoom + ", it doesn't respect the following condition : atLeastNbRoom < 0");
     }
     atLeastNbChest = reader.ReadSByte();
     if (atLeastNbChest < 0)
     {
         throw new Exception("Forbidden value on atLeastNbChest = " + atLeastNbChest + ", it doesn't respect the following condition : atLeastNbChest < 0");
     }
     skillRequested = reader.ReadShort();
     if (skillRequested < 0)
     {
         throw new Exception("Forbidden value on skillRequested = " + skillRequested + ", it doesn't respect the following condition : skillRequested < 0");
     }
     maxPrice = reader.ReadInt();
     if (maxPrice < 0)
     {
         throw new Exception("Forbidden value on maxPrice = " + maxPrice + ", it doesn't respect the following condition : maxPrice < 0");
     }
 }
コード例 #19
0
        public override void Deserialize(BigEndianReader reader)
        {
            byte flag1 = reader.ReadByte();

            autoconnect    = BooleanByteWrapper.GetFlag(flag1, 0);
            useCertificate = BooleanByteWrapper.GetFlag(flag1, 1);
            useLoginToken  = BooleanByteWrapper.GetFlag(flag1, 2);
            version        = new Types.VersionExtended();
            version.Deserialize(reader);
            lang = reader.ReadUTF();
            var limit = reader.ReadVarInt();

            credentials = new sbyte[limit];
            for (int i = 0; i < limit; i++)
            {
                credentials[i] = reader.ReadSByte();
            }
            serverId            = reader.ReadShort();
            sessionOptionalSalt = reader.ReadDouble();
            if (sessionOptionalSalt < -9.007199254740992E15 || sessionOptionalSalt > 9.007199254740992E15)
            {
                throw new Exception("Forbidden value on sessionOptionalSalt = " + sessionOptionalSalt + ", it doesn't respect the following condition : sessionOptionalSalt < -9.007199254740992E15 || sessionOptionalSalt > 9.007199254740992E15");
            }
        }
コード例 #20
0
        public override void Deserialize(BigEndianReader reader)
        {
            infos = Types.ProtocolTypeManager.GetInstance <Types.GuildFactSheetInformations>(reader.ReadShort());
            infos.Deserialize(reader);
            creationDate = reader.ReadInt();
            if (creationDate < 0)
            {
                throw new Exception("Forbidden value on creationDate = " + creationDate + ", it doesn't respect the following condition : creationDate < 0");
            }
            nbTaxCollectors = reader.ReadShort();
            if (nbTaxCollectors < 0)
            {
                throw new Exception("Forbidden value on nbTaxCollectors = " + nbTaxCollectors + ", it doesn't respect the following condition : nbTaxCollectors < 0");
            }
            enabled = reader.ReadBoolean();
            var limit = reader.ReadUShort();

            members = new Types.CharacterMinimalInformations[limit];
            for (int i = 0; i < limit; i++)
            {
                members[i] = new Types.CharacterMinimalInformations();
                members[i].Deserialize(reader);
            }
        }
コード例 #21
0
 public override void Deserialize(BigEndianReader reader)
 {
     base.Deserialize(reader);
     waitAckId = reader.ReadShort();
 }
コード例 #22
0
 public override void Deserialize(BigEndianReader reader)
 {
     base.Deserialize(reader);
     targetId = reader.ReadInt();
     delta    = reader.ReadShort();
 }
コード例 #23
0
public virtual void Deserialize(BigEndianReader reader)
{

lifePoints = reader.ReadInt();
            if (lifePoints < 0)
                throw new Exception("Forbidden value on lifePoints = " + lifePoints + ", it doesn't respect the following condition : lifePoints < 0");
            maxLifePoints = reader.ReadInt();
            if (maxLifePoints < 0)
                throw new Exception("Forbidden value on maxLifePoints = " + maxLifePoints + ", it doesn't respect the following condition : maxLifePoints < 0");
            baseMaxLifePoints = reader.ReadInt();
            if (baseMaxLifePoints < 0)
                throw new Exception("Forbidden value on baseMaxLifePoints = " + baseMaxLifePoints + ", it doesn't respect the following condition : baseMaxLifePoints < 0");
            permanentDamagePercent = reader.ReadInt();
            if (permanentDamagePercent < 0)
                throw new Exception("Forbidden value on permanentDamagePercent = " + permanentDamagePercent + ", it doesn't respect the following condition : permanentDamagePercent < 0");
            shieldPoints = reader.ReadInt();
            if (shieldPoints < 0)
                throw new Exception("Forbidden value on shieldPoints = " + shieldPoints + ", it doesn't respect the following condition : shieldPoints < 0");
            actionPoints = reader.ReadShort();
            maxActionPoints = reader.ReadShort();
            movementPoints = reader.ReadShort();
            maxMovementPoints = reader.ReadShort();
            summoner = reader.ReadInt();
            summoned = reader.ReadBoolean();
            neutralElementResistPercent = reader.ReadShort();
            earthElementResistPercent = reader.ReadShort();
            waterElementResistPercent = reader.ReadShort();
            airElementResistPercent = reader.ReadShort();
            fireElementResistPercent = reader.ReadShort();
            neutralElementReduction = reader.ReadShort();
            earthElementReduction = reader.ReadShort();
            waterElementReduction = reader.ReadShort();
            airElementReduction = reader.ReadShort();
            fireElementReduction = reader.ReadShort();
            criticalDamageFixedResist = reader.ReadShort();
            pushDamageFixedResist = reader.ReadShort();
            dodgePALostProbability = reader.ReadShort();
            if (dodgePALostProbability < 0)
                throw new Exception("Forbidden value on dodgePALostProbability = " + dodgePALostProbability + ", it doesn't respect the following condition : dodgePALostProbability < 0");
            dodgePMLostProbability = reader.ReadShort();
            if (dodgePMLostProbability < 0)
                throw new Exception("Forbidden value on dodgePMLostProbability = " + dodgePMLostProbability + ", it doesn't respect the following condition : dodgePMLostProbability < 0");
            tackleBlock = reader.ReadShort();
            tackleEvade = reader.ReadShort();
            invisibilityState = reader.ReadSByte();
            

}
コード例 #24
0
 public override void Deserialize(BigEndianReader reader)
 {
     base.Deserialize(reader);
     playerId = reader.ReadVarInt();
     if (playerId < 0)
     {
         throw new Exception("Forbidden value on playerId = " + playerId + ", it doesn't respect the following condition : playerId < 0");
     }
     playerName = reader.ReadUTF();
     level      = reader.ReadByte();
     if (level < 0 || level > 200)
     {
         throw new Exception("Forbidden value on level = " + level + ", it doesn't respect the following condition : level < 0 || level > 200");
     }
     alignmentSide = reader.ReadSByte();
     breed         = reader.ReadSByte();
     sex           = reader.ReadBoolean();
     guildInfo     = new Types.BasicGuildInformations();
     guildInfo.Deserialize(reader);
     moodSmileyId = reader.ReadSByte();
     status       = Types.ProtocolTypeManager.GetInstance <Types.PlayerStatus>(reader.ReadShort());
     status.Deserialize(reader);
 }
コード例 #25
0
ファイル: JobDescription.cs プロジェクト: shadowok/BlueSheep
        public virtual void Deserialize(BigEndianReader reader)
        {
            jobId = reader.ReadSByte();
            if (jobId < 0)
            {
                throw new Exception("Forbidden value on jobId = " + jobId + ", it doesn't respect the following condition : jobId < 0");
            }
            var limit = reader.ReadUShort();

            skills = new Types.SkillActionDescription[limit];
            for (int i = 0; i < limit; i++)
            {
                skills[i] = Types.ProtocolTypeManager.GetInstance <Types.SkillActionDescription>(reader.ReadShort());
                skills[i].Deserialize(reader);
            }
        }
コード例 #26
0
        public override void Deserialize(BigEndianReader reader)
        {
            questType = reader.ReadSByte();
            if (questType < 0)
            {
                throw new Exception("Forbidden value on questType = " + questType + ", it doesn't respect the following condition : questType < 0");
            }
            startMapId = reader.ReadInt();
            var limit = reader.ReadUShort();

            knownStepsList = new Types.TreasureHuntStep[limit];
            for (int i = 0; i < limit; i++)
            {
                knownStepsList[i] = Types.ProtocolTypeManager.GetInstance <Types.TreasureHuntStep>(reader.ReadShort());
                knownStepsList[i].Deserialize(reader);
            }
            totalStepCount = reader.ReadSByte();
            if (totalStepCount < 0)
            {
                throw new Exception("Forbidden value on totalStepCount = " + totalStepCount + ", it doesn't respect the following condition : totalStepCount < 0");
            }
            checkPointCurrent = reader.ReadVarInt();
            if (checkPointCurrent < 0)
            {
                throw new Exception("Forbidden value on checkPointCurrent = " + checkPointCurrent + ", it doesn't respect the following condition : checkPointCurrent < 0");
            }
            checkPointTotal = reader.ReadVarInt();
            if (checkPointTotal < 0)
            {
                throw new Exception("Forbidden value on checkPointTotal = " + checkPointTotal + ", it doesn't respect the following condition : checkPointTotal < 0");
            }
            availableRetryCount = reader.ReadInt();
            limit = reader.ReadUShort();
            flags = new Types.TreasureHuntFlag[limit];
            for (int i = 0; i < limit; i++)
            {
                flags[i] = new Types.TreasureHuntFlag();
                flags[i].Deserialize(reader);
            }
        }
コード例 #27
0
        public override void Deserialize(BigEndianReader reader)
        {
            var limit = reader.ReadUShort();

            prisms = new Types.PrismSubareaEmptyInfo[limit];
            for (int i = 0; i < limit; i++)
            {
                prisms[i] = Types.ProtocolTypeManager.GetInstance <Types.PrismSubareaEmptyInfo>(reader.ReadShort());
                prisms[i].Deserialize(reader);
            }
        }
コード例 #28
0
        // Methods
        internal void Init(BigEndianReader Reader, int MapVersion, Map map)
        {
            Floor = (Reader.ReadSByte() * 10);
            if (Floor == -1280)
            {
                return;
            }
            if (MapVersion >= 9)
            {
                var tmp_bytes = Reader.ReadShort();
                Mov = (tmp_bytes & 1) == 0;
                NonWalkableDuringFight = (tmp_bytes & 2) != 0;
                NonWalkableDuringRP    = (tmp_bytes & 4) != 0;
                Los      = (tmp_bytes & 8) == 0;
                Blue     = (tmp_bytes & 16) != 0;
                Red      = (tmp_bytes & 32) != 0;
                Visible  = (tmp_bytes & 64) != 0;
                FarmCell = (tmp_bytes & 128) != 0;
                if (MapVersion >= 10)
                {
                    HavenbagCell = (tmp_bytes & 256) != 0;
                    TopArrow     = (tmp_bytes & 512) != 0;
                    BottomArrow  = (tmp_bytes & 1024) != 0;
                    RightArrow   = (tmp_bytes & 2048) != 0;
                    LeftArrow    = (tmp_bytes & 4096) != 0;
                }
                else
                {
                    TopArrow    = (tmp_bytes & 256) != 0;
                    BottomArrow = (tmp_bytes & 512) != 0;
                    RightArrow  = (tmp_bytes & 1024) != 0;
                    LeftArrow   = (tmp_bytes & 2048) != 0;
                }
                if (TopArrow)
                {
                    map.TopArrowCells.Add(CellId);
                }
                if (BottomArrow)
                {
                    map.BottomArrowCells.Add(CellId);
                }
                if (RightArrow)
                {
                    map.RightArrowCells.Add(CellId);
                }
                if (LeftArrow)
                {
                    map.LeftArrowCells.Add(CellId);
                }
            }
            else
            {
                LosMov                 = Reader.ReadByte();
                Los                    = (LosMov & 2) >> 1 == 1;
                Mov                    = (LosMov & 1) == 1;
                Visible                = (LosMov & 64) >> 6 == 1;
                FarmCell               = (LosMov & 32) >> 5 == 1;
                Blue                   = (LosMov & 16) >> 4 == 1;
                Red                    = (LosMov & 8) >> 3 == 1;
                NonWalkableDuringRP    = (LosMov & 128) >> 7 == 1;
                NonWalkableDuringFight = (LosMov & 4) >> 2 == 1;
            }
            Speed         = Reader.ReadSByte();
            MapChangeData = Reader.ReadSByte();

            if (MapVersion > 5)
            {
                MoveZone = Reader.ReadByte();
            }
            if (MapVersion > 7 && MapVersion < 9)
            {
                var tmpBits = Reader.ReadSByte();
                Arrow = 15 & tmpBits;
            }

            if (useTopArrow())
            {
                map.TopArrowCells.Add(CellId);
            }

            if (useBottomArrow())
            {
                map.BottomArrowCells.Add(CellId);
            }

            if (useLeftArrow())
            {
                map.LeftArrowCells.Add(CellId);
            }

            if (useRightArrow())
            {
                map.RightArrowCells.Add(CellId);
            }
        }
コード例 #29
0
 public override void Deserialize(BigEndianReader reader)
 {
     properties = Types.ProtocolTypeManager.GetInstance <Types.HouseInformations>(reader.ReadShort());
     properties.Deserialize(reader);
 }
コード例 #30
0
 public override void Deserialize(BigEndianReader reader)
 {
     base.Deserialize(reader);
     weaponTypeId = reader.ReadShort();
 }