private string GetBGPath()
    {
        GameWebAPI.RespDataMA_WorldEventAreaMaster respDataMA_WorldEventAreaMaster = MasterDataMng.Instance().RespDataMA_WorldEventAreaMaster;
        GameWebAPI.RespDataMA_WorldEventAreaMaster.WorldEventAreaM worldEventAreaM = respDataMA_WorldEventAreaMaster.worldEventAreaM.SingleOrDefault((GameWebAPI.RespDataMA_WorldEventAreaMaster.WorldEventAreaM x) => x.worldAreaId == CMD_QuestTOP.AreaData.data.worldAreaId);
        string result = string.Empty;

        if (worldEventAreaM != null && !string.IsNullOrEmpty(worldEventAreaM.worldEventId))
        {
            string worldEventId = worldEventAreaM.worldEventId;
            GameWebAPI.RespDataMA_WorldEventMaster respDataMA_WorldEventMaster = MasterDataMng.Instance().RespDataMA_WorldEventMaster;
            for (int i = 0; i < respDataMA_WorldEventMaster.worldEventM.Length; i++)
            {
                if (respDataMA_WorldEventMaster.worldEventM[i].worldEventId == worldEventId)
                {
                    string backgroundImg = respDataMA_WorldEventMaster.worldEventM[i].backgroundImg;
                    if (!string.IsNullOrEmpty(backgroundImg))
                    {
                        result = AssetDataMng.GetWebAssetImagePath() + "/events/" + backgroundImg;
                        break;
                    }
                }
            }
        }
        return(result);
    }
    private string GetWorldEventId()
    {
        string result = string.Empty;

        GameWebAPI.RespDataMA_WorldEventAreaMaster respDataMA_WorldEventAreaMaster = MasterDataMng.Instance().RespDataMA_WorldEventAreaMaster;
        GameWebAPI.RespDataMA_WorldEventMaster     respDataMA_WorldEventMaster     = MasterDataMng.Instance().RespDataMA_WorldEventMaster;
        GameWebAPI.RespDataMA_WorldEventAreaMaster.WorldEventAreaM areaMaster      = respDataMA_WorldEventAreaMaster.worldEventAreaM.SingleOrDefault((GameWebAPI.RespDataMA_WorldEventAreaMaster.WorldEventAreaM x) => x.worldAreaId == CMD_QuestTOP.AreaData.data.worldAreaId);
        if (areaMaster != null && !string.IsNullOrEmpty(areaMaster.worldEventId) && respDataMA_WorldEventMaster.worldEventM.Any((GameWebAPI.RespDataMA_WorldEventMaster.WorldEventM x) => x.worldEventId == areaMaster.worldEventId))
        {
            result = areaMaster.worldEventId;
        }
        return(result);
    }
Esempio n. 3
0
 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");
     }
 }