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); }
public void AddWD_DngInfoDataList(string worldId, GameWebAPI.RespDataWD_GetDungeonInfo dngInfo) { if (worldId == "1") { QuestData.WD_DngInfoData wd_DngInfoData = new QuestData.WD_DngInfoData(); wd_DngInfoData.worldAreaId = "1"; wd_DngInfoData.dngInfo = dngInfo; this.WD_DngInfoDataList.Add(wd_DngInfoData); for (int i = 0; i < wd_DngInfoData.dngInfo.worldDungeonInfo.Length; i++) { wd_DngInfoData.dngInfo.worldDungeonInfo[i].isEvent = false; } } else if (worldId == "3") { List <QuestData.WorldAreaData> wam = this.GetWorldAreaM_Normal(); GameWebAPI.RespDataMA_GetWorldStageM.WorldStageM[] worldStageM = MasterDataMng.Instance().RespDataMA_WorldStageM.worldStageM; List <QuestData.WorldAreaData> list = new List <QuestData.WorldAreaData>(); int z; for (z = 0; z < wam.Count; z++) { if (!(wam[z].data.worldAreaId == "1") && !(wam[z].data.worldAreaId == "8")) { string worldAreaId = wam[z].data.worldAreaId; QuestData.WD_DngInfoData wd_DngInfoData2 = new QuestData.WD_DngInfoData(); wd_DngInfoData2.worldAreaId = worldAreaId; wd_DngInfoData2.dngInfo = new GameWebAPI.RespDataWD_GetDungeonInfo(); List <GameWebAPI.RespDataWD_GetDungeonInfo.WorldDungeonInfo> list2 = new List <GameWebAPI.RespDataWD_GetDungeonInfo.WorldDungeonInfo>(); for (int j = 0; j < dngInfo.worldDungeonInfo.Length; j++) { string b = dngInfo.worldDungeonInfo[j].worldStageId.ToString(); for (int k = 0; k < worldStageM.Length; k++) { if (worldStageM[k].worldStageId == b && worldStageM[k].worldAreaId == wd_DngInfoData2.worldAreaId) { list2.Add(dngInfo.worldDungeonInfo[j]); } } } wd_DngInfoData2.dngInfo.worldDungeonInfo = new GameWebAPI.RespDataWD_GetDungeonInfo.WorldDungeonInfo[list2.Count]; for (int j = 0; j < list2.Count; j++) { wd_DngInfoData2.dngInfo.worldDungeonInfo[j] = list2[j]; } this.WD_DngInfoDataList.Add(wd_DngInfoData2); bool flag = false; if (list2.Count > 0) { wam[z].isActive = true; if (list2[0].timeLeft <= 0) { flag = true; } } else { wam[z].isActive = false; flag = true; } if (flag) { GameWebAPI.RespDataMA_WorldEventAreaMaster respDataMA_WorldEventAreaMaster = MasterDataMng.Instance().RespDataMA_WorldEventAreaMaster; GameWebAPI.RespDataMA_WorldEventMaster respDataMA_WorldEventMaster = MasterDataMng.Instance().RespDataMA_WorldEventMaster; if (wam[z].data.type == "3") { GameWebAPI.RespDataMA_WorldEventAreaMaster.WorldEventAreaM areaMaster = respDataMA_WorldEventAreaMaster.worldEventAreaM.SingleOrDefault((GameWebAPI.RespDataMA_WorldEventAreaMaster.WorldEventAreaM x) => x.worldAreaId == wam[z].data.worldAreaId); GameWebAPI.RespDataMA_WorldEventMaster.WorldEventM worldEventM = respDataMA_WorldEventMaster.worldEventM.Where((GameWebAPI.RespDataMA_WorldEventMaster.WorldEventM v) => v.worldEventId == areaMaster.worldEventId).First <GameWebAPI.RespDataMA_WorldEventMaster.WorldEventM>(); if (worldEventM != null) { wam[z].isActive = (DateTime.Parse(worldEventM.receiveEndTime) > ServerDateTime.Now); if (wam[z].isActive) { list.Add(wam[z]); } } } } for (int l = 0; l < wd_DngInfoData2.dngInfo.worldDungeonInfo.Length; l++) { wd_DngInfoData2.dngInfo.worldDungeonInfo[l].isEvent = true; } } } foreach (QuestData.WorldAreaData item in list) { wam.Remove(item); wam.Add(item); } list.Clear(); } else if (worldId == "8") { string text = "8"; List <QuestData.WorldAreaData> worldAreaM_Normal = this.GetWorldAreaM_Normal(); int m; for (m = 0; m < worldAreaM_Normal.Count; m++) { if (worldAreaM_Normal[m].data.worldAreaId == text) { break; } } if (m == worldAreaM_Normal.Count) { worldAreaM_Normal.Add(new QuestData.WorldAreaData { data = new GameWebAPI.RespDataMA_GetWorldAreaM.WorldAreaM(), data = { worldAreaId = text } }); } QuestData.WD_DngInfoData wd_DngInfoData3 = new QuestData.WD_DngInfoData(); wd_DngInfoData3.worldAreaId = text; wd_DngInfoData3.dngInfo = new GameWebAPI.RespDataWD_GetDungeonInfo(); wd_DngInfoData3.dngInfo.worldDungeonInfo = new GameWebAPI.RespDataWD_GetDungeonInfo.WorldDungeonInfo[dngInfo.worldDungeonInfo.Length]; for (int n = 0; n < dngInfo.worldDungeonInfo.Length; n++) { GameWebAPI.RespDataWD_GetDungeonInfo.WorldDungeonInfo worldDungeonInfo = dngInfo.worldDungeonInfo[n]; worldDungeonInfo.sortIdx = n; worldDungeonInfo.totalTicketNum = 0; for (int num = 0; num < worldDungeonInfo.dungeons.Length; num++) { if (!string.IsNullOrEmpty(worldDungeonInfo.dungeons[num].dungeonTicketNum)) { worldDungeonInfo.totalTicketNum += int.Parse(worldDungeonInfo.dungeons[num].dungeonTicketNum); } } wd_DngInfoData3.dngInfo.worldDungeonInfo[n] = worldDungeonInfo; } if (dngInfo.worldDungeonInfo.Length > 0) { worldAreaM_Normal[m].isActive = true; } else { worldAreaM_Normal[m].isActive = false; } this.WD_DngInfoDataList.Add(wd_DngInfoData3); for (int num2 = 0; num2 < wd_DngInfoData3.dngInfo.worldDungeonInfo.Length; num2++) { wd_DngInfoData3.dngInfo.worldDungeonInfo[num2].isEvent = false; } } else if (worldId == "4") { this.WD_DngInfoStatusTutorial = 3; if (dngInfo.worldDungeonInfo != null) { for (int num3 = 0; num3 < dngInfo.worldDungeonInfo.Length; num3++) { GameWebAPI.RespDataWD_GetDungeonInfo.Dungeons[] dungeons = dngInfo.worldDungeonInfo[num3].dungeons; if (dungeons != null) { for (int num4 = 0; num4 < dungeons.Length; num4++) { if (dungeons[num4].worldDungeonId == 9001) { this.WD_DngInfoStatusTutorial = dungeons[num4].status; break; } } break; } } } } else { global::Debug.LogError("======================================================= AddWD_DngInfoDataList INVALIT WORLD ID"); } }