Esempio n. 1
0
        private int CompareAccountDungeonId(QuestData.WorldDungeonData a, QuestData.WorldDungeonData b)
        {
            int num  = int.Parse(a.worldDungeonM.worldDungeonId);
            int num2 = int.Parse(b.worldDungeonM.worldDungeonId);

            if (num < num2)
            {
                return(-1);
            }
            if (num > num2)
            {
                return(1);
            }
            return(0);
        }
Esempio n. 2
0
        public List <QuestData.WorldDungeonData> GetWorldDungeonData_ByAreaIdStageId(string worldAreaId, string worldStageId, GameWebAPI.RespDataWD_GetDungeonInfo dungeonInfo, int targetCount = 0, bool addLock = false, bool addEmpty = false)
        {
            List <QuestData.WorldDungeonData> list = new List <QuestData.WorldDungeonData>();

            GameWebAPI.RespDataMA_GetWorldDungeonM.WorldDungeonM[]      worldDungeonM = MasterDataMng.Instance().RespDataMA_WorldDungeonM.worldDungeonM;
            List <GameWebAPI.RespDataMA_GetWorldDungeonM.WorldDungeonM> list2         = new List <GameWebAPI.RespDataMA_GetWorldDungeonM.WorldDungeonM>();

            if (dungeonInfo == null)
            {
                return(null);
            }
            for (int i = 0; i < worldDungeonM.Length; i++)
            {
                if (worldDungeonM[i].worldStageId == worldStageId)
                {
                    list2.Add(worldDungeonM[i]);
                }
            }
            if (dungeonInfo.worldDungeonInfo == null)
            {
                return(list);
            }
            GameWebAPI.RespDataWD_GetDungeonInfo.Dungeons[]       array            = null;
            GameWebAPI.RespDataWD_GetDungeonInfo.WorldDungeonInfo worldDungeonInfo = null;
            this.wdi_bk = null;
            int  num   = 0;
            bool flag  = false;
            bool flag2 = false;

            for (int j = 0; j < dungeonInfo.worldDungeonInfo.Length; j++)
            {
                if (dungeonInfo.worldDungeonInfo[j].worldStageId == int.Parse(worldStageId))
                {
                    if (targetCount == num)
                    {
                        worldDungeonInfo = dungeonInfo.worldDungeonInfo[j];
                        this.wdi_bk      = worldDungeonInfo;
                        array            = worldDungeonInfo.dungeons;
                        if (array == null && worldDungeonInfo.timeLeft == 0)
                        {
                            flag = true;
                        }
                        flag2 = true;
                        break;
                    }
                    num++;
                }
            }
            if (flag2)
            {
                if (flag)
                {
                    QuestData.WorldDungeonData item = new QuestData.WorldDungeonData
                    {
                        stageId       = worldDungeonInfo.worldStageId,
                        worldDungeonM = null,
                        dungeon       = null,
                        wdscMList     = null,
                        isViewRanking = true,
                        isCounting    = (1 == worldDungeonInfo.isCounting)
                    };
                    list.Add(item);
                }
                else
                {
                    for (int k = 0; k < list2.Count; k++)
                    {
                        for (int l = 0; l < array.Length; l++)
                        {
                            if (int.Parse(list2[k].worldDungeonId) == array[l].worldDungeonId && (addEmpty || !this.IsEmptyDng(array[l], worldAreaId)) && (addLock || array[l].status > 1))
                            {
                                list.Add(new QuestData.WorldDungeonData
                                {
                                    stageId       = worldDungeonInfo.worldStageId,
                                    worldDungeonM = list2[k],
                                    dungeon       = array[l],
                                    status        = array[l].status,
                                    wdscMList     = this.GetWorldDungeonStartConditionM(array[l].worldDungeonId.ToString()),
                                    remainingTime = worldDungeonInfo.timeLeft
                                });
                            }
                        }
                    }
                }
                list.Sort(new Comparison <QuestData.WorldDungeonData>(this.CompareAccountDungeonId));
                return(list);
            }
            return(null);
        }