コード例 #1
0
    private IEnumerator DoInitialize()
    {
        Utility.CreateGameObjectAndComponent("TheaterModeTable", this.get_gameObject().get_transform(), -1);
        Utility.CreateGameObjectAndComponent("TheaterModeChapterTable", this.get_gameObject().get_transform(), -1);
        while (MonoBehaviourSingleton <TheaterModeChapterTable> .I.isLoading || MonoBehaviourSingleton <TheaterModeTable> .I.isLoading)
        {
            yield return((object)null);
        }
        Dictionary <int, int>  checkList = new Dictionary <int, int>();
        Dictionary <int, uint> idList    = new Dictionary <int, uint>();
        Dictionary <uint, int> revIdList = new Dictionary <uint, int>();

        new Dictionary <uint, int>();
        Dictionary <uint, int> deliveryList = new Dictionary <uint, int>();

        MonoBehaviourSingleton <TheaterModeTable> .I.AllTheaterData(delegate(TheaterModeTable.TheaterModeData data)
        {
            if (!((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_00d8: stateMachine*/)._003CcheckList_003E__0.ContainsKey(data.script_id) && !((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_00d8: stateMachine*/)._003CidList_003E__1.ContainsKey(data.script_id))
            {
                ((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_00d8: stateMachine*/)._003CcheckList_003E__0.Add(data.script_id, 0);
                ((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_00d8: stateMachine*/)._003CidList_003E__1.Add(data.script_id, data.story_id);
                ((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_00d8: stateMachine*/)._003CrevIdList_003E__2.Add(data.story_id, data.script_id);
            }
        });

        if (checkList.ContainsKey(11000001))
        {
            checkList[11000001] = 1;
        }
        if (checkList.ContainsKey(11000002))
        {
            checkList[11000002] = 1;
        }
        if (Singleton <QuestTable> .IsValid() && MonoBehaviourSingleton <QuestManager> .IsValid())
        {
            Singleton <QuestTable> .I.AllQuestData(delegate(QuestTable.QuestTableData data)
            {
                if (data.storyId != 0 && ((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_014e: stateMachine*/)._003CcheckList_003E__0.ContainsKey(data.storyId))
                {
                    if (((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_014e: stateMachine*/)._003CcheckList_003E__0[data.storyId] == 0)
                    {
                        ((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_014e: stateMachine*/)._003CcheckList_003E__0[data.storyId] = -1;
                    }
                    ((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_014e: stateMachine*/)._003CquestList_003E__3.Add(data.questID, data.storyId);
                    ClearStatusQuest clearStatusQuestData = MonoBehaviourSingleton <QuestManager> .I.GetClearStatusQuestData(data.questID);
                    if (clearStatusQuestData != null && (clearStatusQuestData.questStatus == 3 || clearStatusQuestData.questStatus == 4))
                    {
                        ((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_014e: stateMachine*/)._003CcheckList_003E__0[data.storyId] = 1;
                    }
                }
            });
        }
        Singleton <DeliveryTable> .I.AllDeliveryData(delegate(DeliveryTable.DeliveryData data)
        {
            if (data.clearEventID != 0)
            {
                int clearEventID = (int)data.clearEventID;
                if (((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_0164: stateMachine*/)._003CcheckList_003E__0.ContainsKey(clearEventID))
                {
                    if (((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_0164: stateMachine*/)._003CcheckList_003E__0[clearEventID] == 0)
                    {
                        ((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_0164: stateMachine*/)._003CcheckList_003E__0[clearEventID] = -1;
                    }
                    ((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_0164: stateMachine*/)._003CdeliveryList_003E__4.Add(data.id, clearEventID);
                    CLEAR_STATUS clearStatusDelivery = MonoBehaviourSingleton <DeliveryManager> .I.GetClearStatusDelivery(data.id);
                    if (clearStatusDelivery == CLEAR_STATUS.CLEAR || clearStatusDelivery == CLEAR_STATUS.ALL_CLEAR)
                    {
                        ((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_0164: stateMachine*/)._003CcheckList_003E__0[clearEventID] = 1;
                    }
                }
            }
        });

        if (s_connectCache == null)
        {
            TheaterModeModel.RequestSendForm send_form = new TheaterModeModel.RequestSendForm();
            foreach (KeyValuePair <uint, int> item in deliveryList)
            {
                int storyId2 = item.Value;
                if (checkList[storyId2] < 1)
                {
                    send_form.theaterList.Add(new TheaterModePostData((int)idList[storyId2], (int)item.Key, 0));
                }
            }
            foreach (KeyValuePair <int, int> item2 in checkList)
            {
                int storyId = item2.Key;
                if (checkList[storyId] == 0)
                {
                    send_form.theaterList.Add(new TheaterModePostData((int)idList[storyId], 0, storyId));
                }
            }
            bool isEndConnection = false;
            Protocol.Send(TheaterModeModel.URL, send_form, delegate(TheaterModeModel ret)
            {
                if (ret.Error == Error.None)
                {
                    if (ret == null || ret.result == null || ret.result.theaterList == null)
                    {
                        return;
                    }
                    s_connectCache = ret.result;
                }
                ((_003CDoInitialize_003Ec__IteratorEA) /*Error near IL_02ee: stateMachine*/)._003CisEndConnection_003E__12 = true;
            }, string.Empty);
            while (!isEndConnection)
            {
                yield return((object)null);
            }
        }
        for (int l = 0; l < s_connectCache.theaterList.Count; l++)
        {
            if (s_connectCache.theaterList[l].isOpen)
            {
                checkList[revIdList[(uint)s_connectCache.theaterList[l].theaterId]] = 1;
            }
            else
            {
                checkList[revIdList[(uint)s_connectCache.theaterList[l].theaterId]] = -1;
            }
        }
        m_canViewStoryList = MonoBehaviourSingleton <TheaterModeTable> .I.GetTableFromOKDic(checkList);

        List <uint> chapterList = new List <uint>();
        int         k           = 0;

        for (int count2 = m_canViewStoryList.Count; k < count2; k++)
        {
            uint chapter = (uint)m_canViewStoryList[k].chapter_id;
            if (!chapterList.Contains(chapter))
            {
                chapterList.Add(chapter);
            }
        }
        m_canViewChapterList = MonoBehaviourSingleton <TheaterModeChapterTable> .I.GetPickedData(chapterList);

        m_canViewChapterList.Sort(delegate(TheaterModeChapterTable.TheaterModeChapterData a, TheaterModeChapterTable.TheaterModeChapterData b)
        {
            if (a.order != 0 && b.order != 0)
            {
                return(b.order - a.order);
            }
            if (b.order != 0)
            {
                return(-1);
            }
            if (a.order != 0)
            {
                return(1);
            }
            return((int)(b.chapter_id - a.chapter_id));
        });
        LoadingQueue loadingQueue = new LoadingQueue(this);

        bannerTable = new Dictionary <int, LoadObject>(m_canViewChapterList.Count);
        for (int j = 0; j < m_canViewChapterList.Count; j++)
        {
            TheaterModeChapterTable.TheaterModeChapterData table = m_canViewChapterList[j];
            if (!bannerTable.ContainsKey(table.banner_id))
            {
                string     bannerImg = ResourceName.GetEventBanner(table.banner_id);
                LoadObject obj       = loadingQueue.Load(RESOURCE_CATEGORY.EVENT_ICON, bannerImg, false);
                bannerTable.Add(table.banner_id, obj);
            }
        }
        if (loadingQueue.IsLoading())
        {
            yield return((object)loadingQueue.Wait());
        }
        m_mainChapterList  = new List <TheaterModeChapterTable.TheaterModeChapterData>();
        m_eventChapterList = new List <TheaterModeChapterTable.TheaterModeChapterData>();
        int i = 0;

        for (int count = m_canViewChapterList.Count; i < count; i++)
        {
            if (m_canViewChapterList[i].is_main == 0)
            {
                m_eventChapterList.Add(m_canViewChapterList[i]);
            }
            else
            {
                m_mainChapterList.Add(m_canViewChapterList[i]);
            }
        }
        SetPaging();
        m_isSelectMain = false;
        OnQuery_SELECT_MAIN();
        base.Initialize();
    }
コード例 #2
0
 private void OnQuery_BUTTONBACK()
 {
     s_connectCache = null;
     Debug.Log((object)"CLEAR CACHE!!");
     GameSection.ChangeEvent("[BACK]", null);
 }