Exemplo n.º 1
0
    public static void checkAndGivePromotionItems(string productIds)
    {
        //IL_006b: Unknown result type (might be due to invalid IL or missing references)
        //IL_0070: Expected O, but got Unknown
        string text = MonoBehaviourSingleton <AccountManager> .I.account.token;
        int    num  = text.IndexOf('=');

        if (num >= 0)
        {
            text = text.Substring(num + 1);
        }
        NetworkNative.setSidToken(text);
        string text2 = NetworkManager.APP_HOST;

        if (text2.EndsWith("/"))
        {
            text2 = text2.Substring(0, text2.Length - 1);
        }
        NetworkNative.setHost(text2);
        try
        {
            AndroidJavaClass val = new AndroidJavaClass(Property.BundleIdentifier + ".InAppBillingHelper");
            val.CallStatic("checkAndGivePromotionitems", new object[1]
            {
                productIds
            });
        }
        catch (Exception ex)
        {
            Debug.LogError((object)ex);
        }
    }
 public override void UpdateUI()
 {
     SetActive((Enum)UI.IPT_ADDRESS, !isValidGoogleAccountPopup);
     SetActive((Enum)UI.POP_ADDRESS, isValidGoogleAccountPopup);
     SetInput((Enum)UI.IPT_ADDRESS, string.Empty, 255, (EventDelegate.Callback)InputCallback);
     SetInput((Enum)UI.IPT_PASSWORD, string.Empty, 255, (EventDelegate.Callback)InputCallback);
     if (isValidGoogleAccountPopup)
     {
         List <string> account_list = null;
         googleAccountList = NetworkNative.getGoogleAccounts();
         if (googleAccountList.googleAccounts.Count > 0)
         {
             UILabel lbl = base.GetComponent <UILabel>((Enum)UI.LBL_ADDRESS);
             account_list = new List <string>();
             googleAccountList.googleAccounts.ForEach(delegate(NetworkNative.GoogleAccount account)
             {
                 account_list.Add(PopupTextAdjust(lbl, account.name));
             });
         }
         SetPopupListText((Enum)UI.POP_ADDRESS, account_list, -1);
         SetPopupListOnChange((Enum)UI.POP_ADDRESS, (Enum)UI.LBL_ADDRESS, (EventDelegate.Callback)InputCallback_Address);
     }
     SetLabelText((Enum)UI.LBL_ADDRESS_TEXT, base.sectionData.GetText((!isGoogleAccount) ? "MAIL" : "GOOGLE"));
     base.UpdateUI();
 }
Exemplo n.º 3
0
 private void OnQuery_CONTACT()
 {
     if (CheckInputData(true))
     {
         string        text              = base.GetComponent <UILabel>((Enum)UI.LBL_ADDRESS).text;
         string        text2             = base.GetComponent <UILabel>((Enum)UI.LBL_SECRET_ANSER).text;
         string        text3             = base.GetComponent <UILabel>((Enum)UI.LBL_USER_NAME).text;
         string        text4             = base.GetComponent <UILabel>((Enum)UI.LBL_USER_RANK).text;
         string        defaultUserAgent  = NetworkNative.getDefaultUserAgent();
         string        nativeVersionName = NetworkNative.getNativeVersionName();
         string        value             = "*****@*****.**";
         string        url           = "Dragon Project [Login]";
         string        text5         = "3. [Answer to secret question]\n{4}\n\n";
         string        text6         = "[Registered Dragon Project ID]";
         string        url2          = string.Format("1. [Username and current level]\nUsername:{0}\nLevel:{1}\n\n2. " + text6 + "\n{2}\n{3}\n\n" + text5 + "※Please do not erase the information below\nDevice details:{5}\nApp details:{6}\n", text3, text4, base.sectionData.GetText("ACCOUNT_MAIL"), text, text2, defaultUserAgent, nativeVersionName);
         StringBuilder stringBuilder = new StringBuilder();
         stringBuilder.Append("mailto:");
         stringBuilder.Append(value);
         stringBuilder.Append("?subject=");
         stringBuilder.Append(EscapeURL(url));
         stringBuilder.Append("&body=");
         stringBuilder.Append(EscapeURL(url2));
         Native.OpenURL(stringBuilder.ToString());
     }
 }
    public void Open(string url, Action <string> _onClose = null)
    {
        //IL_0009: Unknown result type (might be due to invalid IL or missing references)
        onClose       = _onClose;
        webViewObject = this.get_gameObject().AddComponent <WebViewObject>();
        webViewObject.Init(string.Empty, string.Empty, string.Empty);
        webViewObject.EvaluateJS("var appVersion='" + NetworkNative.getNativeVersionName() + "';");
        webViewObject.SetCookie(NetworkManager.APP_HOST, "apv", NetworkNative.getNativeVersionName());
        if (MonoBehaviourSingleton <AccountManager> .I.account.token != string.Empty)
        {
            string[] array = MonoBehaviourSingleton <AccountManager> .I.account.token.Split('=');

            webViewObject.SetCookie(NetworkManager.APP_HOST, array[0], array[1]);
        }
        webViewObject.LoadURL(url);
        webViewObject.SetVisibility(true);
        int num  = Screen.get_width();
        int num2 = Screen.get_height();

        if (MonoBehaviourSingleton <AppMain> .IsValid())
        {
            num  = MonoBehaviourSingleton <AppMain> .I.defaultScreenWidth;
            num2 = MonoBehaviourSingleton <AppMain> .I.defaultScreenHeight;
        }
        int left   = (int)((float)num * m_Margine.get_xMin());
        int top    = (int)((float)num2 * m_Margine.get_yMin());
        int right  = (int)((float)num * m_Margine.get_width());
        int bottom = (int)((float)num2 * m_Margine.get_height());

        webViewObject.SetMargins(left, top, right, bottom);
    }
    public bool IsValidHappenQuest(uint questId)
    {
        if (questToItemTable == null)
        {
            return(false);
        }
        UIntKeyTable <QuestToFieldData> uIntKeyTable = questToItemTable.Get(questId);

        if (uIntKeyTable == null)
        {
            return(false);
        }
        Version applicationVersion = NetworkNative.getNativeVersionFromName();
        int     field_count        = 0;

        uIntKeyTable.ForEach(delegate(QuestToFieldData data)
        {
            if (data.mapId != 0 && (data.eventId == 0 || MonoBehaviourSingleton <QuestManager> .I.IsEventPlayableWith((int)data.eventId, applicationVersion)))
            {
                FieldMapTable.FieldMapTableData fieldMapData = Singleton <FieldMapTable> .I.GetFieldMapData(data.mapId);
                if (fieldMapData != null && (!fieldMapData.IsEventData || MonoBehaviourSingleton <QuestManager> .I.IsEventPlayableWith(fieldMapData.eventId, applicationVersion)))
                {
                    field_count++;
                }
            }
        });
        return(field_count > 0);
    }
Exemplo n.º 6
0
    public void SendRegistAuthFacebook(string access_token, Action <bool> call_back)
    {
        RegistAuthFacebookModel.RequestSendForm requestSendForm = new RegistAuthFacebookModel.RequestSendForm();
        requestSendForm.accessToken = access_token;
        requestSendForm.d           = NetworkNative.getUniqueDeviceId();
        bool is_success = false;

        Protocol.Send(RegistAuthFacebookModel.URL, requestSendForm, delegate(RegistAuthFacebookModel ret)
        {
            if (ret.Error == Error.None)
            {
                is_success = true;
                MonoBehaviourSingleton <UserInfoManager> .I.SetRecvUserInfo(ret.result.userInfo, 0);
                MonoBehaviourSingleton <UserInfoManager> .I.SetNewsID(ret.result.newsId);
                SaveAccount(ret.result.uh, null);
                Dictionary <string, object> values = new Dictionary <string, object>
                {
                    {
                        "fb_login",
                        "yes"
                    },
                    {
                        "colopl_login",
                        "no"
                    },
                    {
                        "guest_login",
                        "no"
                    }
                };
                MonoBehaviourSingleton <GoWrapManager> .I.trackEvent("Account_Register", "Account", values);
            }
            call_back(is_success);
        }, string.Empty);
    }
Exemplo n.º 7
0
 protected void UpdateEventList()
 {
     RemoveEndedEvents();
     if (eventList == null || eventList.Count == 0)
     {
         SetActive((Enum)UI.STR_EVENT_NON_LIST, true);
     }
     else
     {
         SetActive((Enum)UI.STR_EVENT_NON_LIST, false);
         SetDynamicList((Enum)UI.GRD_EVENT_QUEST, "QuestEventListSelectItem", eventList.Count, false, (Func <int, bool>) null, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle)
         {
             Network.EventData eventData = eventList[i];
             Texture2D val = null;
             if (bannerTable.TryGetValue(eventData.bannerId, out LoadObject value))
             {
                 val = (value.loadedObject as Texture2D);
                 if (val != null)
                 {
                     Transform t2 = FindCtrl(t, UI.TEX_EVENT_BANNER);
                     SetActive(t2, true);
                     SetTexture(t2, val);
                     SetActive(t, UI.LBL_NO_BANNER, false);
                 }
                 else
                 {
                     SetActive(t, UI.TEX_EVENT_BANNER, false);
                     SetActive(t, UI.LBL_NO_BANNER, true);
                     string name = eventData.name;
                     SetLabelText(t, UI.LBL_NO_BANNER, name);
                 }
             }
             if (!string.IsNullOrEmpty(eventData.endDate.date))
             {
                 Transform t3 = FindCtrl(t, UI.LBL_LEFT);
                 SetActive(t3, true);
                 SetLabelText(t3, StringTable.Get(STRING_CATEGORY.TIME, 4u));
                 t3 = FindCtrl(t, UI.LBL_LEFT_TIME);
                 SetActive(t3, true);
                 SetLabelText(t3, UIUtility.TimeFormatWithUnit(eventData.GetRest()));
             }
             else
             {
                 SetActive(t, UI.LBL_LEFT, false);
                 SetActive(t, UI.LBL_LEFT_TIME, false);
             }
             SetEvent(t, "SELECT_EXPLORE", eventData);
             Version nativeVersionFromName = NetworkNative.getNativeVersionFromName();
             bool flag       = eventData.IsPlayableWith(nativeVersionFromName);
             bool flag2      = IsClearedEvent(eventData) && flag;
             bool is_visible = !flag2 && !eventData.readPrologueStory;
             SetActive(t, UI.SPR_NEW, is_visible);
             SetActive(t, UI.SPR_CLEARED, flag2);
             SetBadge(FindCtrl(t, UI.TEX_EVENT_BANNER), MonoBehaviourSingleton <DeliveryManager> .I.GetCompletableEventDeliveryNum(eventData.eventId), 1, 16, -3, false);
         });
     }
 }
    private bool IsPlayableVersion()
    {
        if (eventData == null)
        {
            return(true);
        }
        Version nativeVersionFromName = NetworkNative.getNativeVersionFromName();

        return(eventData.IsPlayableWith(nativeVersionFromName));
    }
Exemplo n.º 9
0
 public static bool CheckApplicationVersion(string check_version_text)
 {
     if (string.IsNullOrEmpty(check_version_text))
     {
         return(true);
     }
     if (appVer == (Version)null)
     {
         appVer = NetworkNative.getNativeVersionFromName();
     }
     return(appVer.CompareTo(new Version(check_version_text)) >= 0);
 }
Exemplo n.º 10
0
	private void OnQuery_SELECT_ARENA()
	{
		Network.EventData ev = GameSection.GetEventData() as Network.EventData;
		if (ev != null)
		{
			if (ev.HasEndDate() && ev.GetRest() < 0)
			{
				GameSection.ChangeEvent("SELECT_ENDED", null);
			}
			else
			{
				Version nativeVersionFromName = NetworkNative.getNativeVersionFromName();
				if (!ev.IsPlayableWith(nativeVersionFromName))
				{
					string event_data = string.Format(base.sectionData.GetText("REQUIRE_HIGHER_VERSION"), ev.minVersion);
					GameSection.ChangeEvent("SELECT_VERSION", event_data);
				}
				else if (!ev.readPrologueStory)
				{
					GameSection.StayEvent();
					MonoBehaviourSingleton<QuestManager>.I.SendQuestReadEventStory(ev.eventId, delegate(bool success, Error error)
					{
						if (success)
						{
							if (ev.prologueStoryId > 0)
							{
								GameSceneTables.EventData eventData = base.sectionData.GetEventData("STORY");
								if (eventData != null)
								{
									string name = (!MonoBehaviourSingleton<LoungeMatchingManager>.I.IsInLounge()) ? "MAIN_MENU_HOME" : "MAIN_MENU_LOUNGE";
									EventData[] array = new EventData[3]
									{
										new EventData(name, null),
										new EventData("TO_EVENT", null),
										new EventData("SELECT_ARENA", ev)
									};
									GameSection.ChangeStayEvent("STORY", new object[4]
									{
										ev.prologueStoryId,
										string.Empty,
										string.Empty,
										array
									});
								}
							}
							ev.readPrologueStory = true;
						}
						GameSection.ResumeEvent(true, null);
					});
				}
			}
		}
	}
Exemplo n.º 11
0
 public void OnTokenReceived(object sender, TokenReceivedEventArgs token)
 {
     PushNotificationDevicePostModel.RequestSendForm requestSendForm = new PushNotificationDevicePostModel.RequestSendForm();
     requestSendForm.deviceToken = token.get_Token();
     requestSendForm.clientVer   = NetworkNative.getNativeVersionNameRemoveDot();
     MonoBehaviourSingleton <NetworkManager> .I.Request(PushNotificationDevicePostModel.URL, requestSendForm, delegate(PushNotificationDevicePostModel ret)
     {
         if (ret.Error == Error.None)
         {
             PlayerPrefs.SetString("fcm_registed", NetworkNative.getNativeVersionNameRemoveDot());
         }
     }, string.Empty, string.Empty);
 }
Exemplo n.º 12
0
    public void SendRegistCreate(Action <bool> call_back)
    {
        RegistCreateSendParam registCreateSendParam = new RegistCreateSendParam();

        registCreateSendParam.d = NetworkNative.getUniqueDeviceId();
        registCreateSendParam.SetAttribute(Native.GetInstallReferrer());
        bool is_success = false;

        Protocol.Send(RegistCreateModel.URL, registCreateSendParam, delegate(RegistCreateModel ret)
        {
            if (ret.Error == Error.None)
            {
                is_success = true;
                MonoBehaviourSingleton <UserInfoManager> .I.SetRecvUserInfo(ret.result.userInfo, 0);
                MonoBehaviourSingleton <UserInfoManager> .I.userIdHash = ret.result.userIdHash;
                SaveAccount(ret.result.uh, null);
                Dictionary <string, object> values = new Dictionary <string, object>
                {
                    {
                        "fb_login",
                        "no"
                    },
                    {
                        "colopl_login",
                        "no"
                    },
                    {
                        "guest_login",
                        "yes"
                    }
                };
                MonoBehaviourSingleton <GoWrapManager> .I.trackEvent("Account_Register", "Account", values);
                call_back(is_success);
            }
            else
            {
                OpenYesNoDialog(ret.Error, delegate(string sel)
                {
                    if ("YES" == sel)
                    {
                        MonoBehaviourSingleton <NetworkManager> .I.tokenTemp = null;
                        SendRegistCreate(call_back);
                    }
                    else
                    {
                        Application.Quit();
                    }
                });
            }
        }, string.Empty);
    }
Exemplo n.º 13
0
    public void SetNewsID(int news_id)
    {
        int @int = PlayerPrefs.GetInt("LastNewsID", -1);

        newsID = news_id;
        string @string = PlayerPrefs.GetString("fcm_registed", string.Empty);

        if (news_id != @int || string.IsNullOrEmpty(@string) || !NetworkNative.getNativeVersionNameRemoveDot().Equals(@string))
        {
            NetworkNative.createRegistrationId();
        }
        if (!needOpenNewsPage && news_id != @int && news_id != -1)
        {
            needOpenNewsPage = true;
        }
    }
 public override void UpdateUI()
 {
     SetActive((Enum)UI.IPT_ADDRESS, !isGoogleAccount);
     SetActive((Enum)UI.POP_ADDRESS, isGoogleAccount);
     SetActive((Enum)UI.OBJ_SECRET_QUESTION, !isGoogleAccount);
     SetInput((Enum)UI.IPT_ADDRESS, string.Empty, 255, (EventDelegate.Callback)InputCallBack);
     SetInput((Enum)UI.IPT_PASSWORD, string.Empty, 255, (EventDelegate.Callback)InputCallBack);
     SetInput((Enum)UI.IPT_CONFIRM_PASSWORD, string.Empty, 255, (EventDelegate.Callback)InputCallBack);
     if (!isGoogleAccount)
     {
         SetInput((Enum)UI.IPT_SECRET_ANSER, string.Empty, 45, (EventDelegate.Callback)InputCallBack);
     }
     if (isGoogleAccount)
     {
         List <string> account_list = null;
         googleAccountList = NetworkNative.getGoogleAccounts();
         if (googleAccountList.googleAccounts.Count > 0)
         {
             UILabel lbl = base.GetComponent <UILabel>((Enum)UI.LBL_ADDRESS);
             account_list = new List <string>();
             googleAccountList.googleAccounts.ForEach(delegate(NetworkNative.GoogleAccount account)
             {
                 account_list.Add(PopupTextAdjust(lbl, account.name));
             });
         }
         SetPopupListText((Enum)UI.POP_ADDRESS, account_list, -1);
         SetPopupListOnChange((Enum)UI.POP_ADDRESS, (Enum)UI.LBL_ADDRESS, (EventDelegate.Callback)InputCallBack_Address);
     }
     else
     {
         List <string> list = new List <string>();
         list.Add(StringTable.Get(STRING_CATEGORY.ACCOUNT, 0u));
         list.Add(StringTable.Get(STRING_CATEGORY.ACCOUNT, 1u));
         list.Add(StringTable.Get(STRING_CATEGORY.ACCOUNT, 2u));
         list.Add(StringTable.Get(STRING_CATEGORY.ACCOUNT, 3u));
         list.Add(StringTable.Get(STRING_CATEGORY.ACCOUNT, 4u));
         list.Add(StringTable.Get(STRING_CATEGORY.ACCOUNT, 5u));
         list.Add(StringTable.Get(STRING_CATEGORY.ACCOUNT, 6u));
         SetPopupListText((Enum)UI.POP_SECRET_QUESTION, list, -1);
         SetPopupListOnChange((Enum)UI.POP_SECRET_QUESTION, (Enum)UI.LBL_SECRET_QUESTION, (EventDelegate.Callback)InputCallBack_SecretQuestion);
     }
 }
Exemplo n.º 15
0
    private void LoadSaveData()
    {
        bool flag = false;

        if (!SaveData.HasKey(SaveData.Key.Account))
        {
            flag    = true;
            account = new Account();
            SaveData.SetData(SaveData.Key.Account, account);
        }
        account = SaveData.GetData <Account>(SaveData.Key.Account);
        if (flag)
        {
            SaveData.Save();
        }
        else
        {
            NetworkNative.setCookieToken(account.token);
        }
    }
Exemplo n.º 16
0
    private bool IsPlayableVersion(out Network.EventData notPlayableEventData)
    {
        notPlayableEventData = null;
        if (cardDataList == null || cardDataList.Count <= 0)
        {
            return(true);
        }
        Version nativeVersionFromName = NetworkNative.getNativeVersionFromName();
        int     i = 0;

        for (int count = cardDataList.Count; i < count; i++)
        {
            Network.EventData eventData = cardDataList[i].eventData;
            if (eventData != null && !eventData.IsPlayableWith(nativeVersionFromName))
            {
                notPlayableEventData = eventData;
                return(false);
            }
        }
        return(true);
    }
Exemplo n.º 17
0
 public void SaveAccount(string user_hash, string token = null)
 {
     account.userHash = user_hash;
     if (token != null)
     {
         account.token = token;
         if (!string.IsNullOrEmpty(token))
         {
             NetworkNative.setCookieToken(account.token);
             Native.getList();
         }
     }
     else if (!string.IsNullOrEmpty(MonoBehaviourSingleton <NetworkManager> .I.tokenTemp))
     {
         account.token = MonoBehaviourSingleton <NetworkManager> .I.tokenTemp;
         NetworkNative.setCookieToken(account.token);
         Native.getList();
     }
     SaveData.SetData(SaveData.Key.Account, account);
     SaveData.Save();
 }
Exemplo n.º 18
0
    public void SendRegistAuthRob(string email, string password, Action <bool> call_back)
    {
        MonoBehaviourSingleton <NetworkManager> .I.tokenTemp = null;
        RegistAuthRobModel.RequestSendForm requestSendForm = new RegistAuthRobModel.RequestSendForm();
        requestSendForm.email    = email;
        requestSendForm.password = password;
        requestSendForm.d        = NetworkNative.getUniqueDeviceId();
        bool is_success = false;

        Protocol.Send(RegistAuthRobModel.URL, requestSendForm, delegate(RegistAuthRobModel ret)
        {
            if (ret.Error == Error.None)
            {
                is_success = true;
                MonoBehaviourSingleton <UserInfoManager> .I.SetRecvUserInfo(ret.result.userInfo, 0);
                MonoBehaviourSingleton <UserInfoManager> .I.SetNewsID(ret.result.newsId);
                MonoBehaviourSingleton <UserInfoManager> .I.userIdHash = ret.result.userIdHash;
                SaveAccount(ret.result.uh, null);
            }
            call_back(is_success);
        }, string.Empty);
    }
Exemplo n.º 19
0
    private Dictionary <string, string> GetHeader(WWWForm form)
    {
        Dictionary <string, string> dictionary = new Dictionary <string, string>();

        foreach (string key in form.get_headers().Keys)
        {
            dictionary.Add(key, form.get_headers()[key].ToString());
        }
        AccountManager.Account account = MonoBehaviourSingleton <AccountManager> .I.account;
        dictionary["Cookie"] = (account.token ?? string.Empty);
        dictionary["apv"]    = NetworkNative.getNativeVersionName();
        dictionary["amv"]    = string.Empty;
        if (MonoBehaviourSingleton <ResourceManager> .IsValid())
        {
            dictionary["amv"] = MonoBehaviourSingleton <ResourceManager> .I.manifestVersion.ToString();
        }
        dictionary["aidx"] = string.Empty;
        if (MonoBehaviourSingleton <ResourceManager> .IsValid())
        {
            dictionary["aidx"] = MonoBehaviourSingleton <ResourceManager> .I.assetIndex.ToString();
        }
        dictionary["tidx"] = string.Empty;
        if (MonoBehaviourSingleton <ResourceManager> .IsValid())
        {
            dictionary["tidx"] = MonoBehaviourSingleton <ResourceManager> .I.tableIndex.ToString();
        }
        dictionary["tmv"] = string.Empty;
        if (MonoBehaviourSingleton <DataTableManager> .IsValid())
        {
            dictionary["tmv"] = MonoBehaviourSingleton <DataTableManager> .I.manifestVersion.ToString();
        }
        dictionary[ServerConstDefine.CDV_KEY] = string.Empty;
        if (MonoBehaviourSingleton <UserInfoManager> .IsValid() && MonoBehaviourSingleton <UserInfoManager> .I.userInfo != null)
        {
            dictionary[ServerConstDefine.CDV_KEY] = MonoBehaviourSingleton <UserInfoManager> .I.userInfo.constDefine.cdv.ToString();
        }
        dictionary["User-Agent"] = NetworkNative.getDefaultUserAgent();
        return(dictionary);
    }
Exemplo n.º 20
0
    private List <QuestTable.QuestTableData> CreateHappneList(uint mapId)
    {
        List <QuestTable.QuestTableData> list = new List <QuestTable.QuestTableData>();
        Dictionary <uint, uint>          questIdEventIdDic = Singleton <QuestToFieldTable> .I.GetQuestIdEventIdDic(mapId);

        if (questIdEventIdDic == null || questIdEventIdDic.Count <= 0)
        {
            return(list);
        }
        foreach (KeyValuePair <uint, uint> item in questIdEventIdDic)
        {
            QuestTable.QuestTableData questData = Singleton <QuestTable> .I.GetQuestData(item.Key);

            if (questData != null && (item.Value < 1 || MonoBehaviourSingleton <QuestManager> .I.IsEventPlayableWith((int)item.Value, NetworkNative.getNativeVersionFromName())))
            {
                list.Add(questData);
            }
        }
        return(list);
    }
Exemplo n.º 21
0
    private IEnumerator Start()
    {
        ResourceManager.internalMode = true;
        GameSaveData.Load();
        if (PlayerPrefs.GetInt("INIT_SE_VOLUME", 0) == 0)
        {
            if (GameSaveData.instance.volumeSE == 1f)
            {
                GameSaveData.instance.volumeSE = 0.5f;
            }
            PlayerPrefs.SetInt("INIT_SE_VOLUME", 1);
        }
        if (string.IsNullOrEmpty(GameSaveData.instance.graphicOptionKey))
        {
            if (NetworkNative.isRunOnRazerPhone())
            {
                GameSaveData.instance.graphicOptionKey = "highest";
                Application.set_targetFrameRate(120);
                Time.set_fixedDeltaTime(0.008333335f);
            }
            else
            {
                GameSaveData.instance.graphicOptionKey = "low";
            }
        }
        if (GameSaveData.instance != null)
        {
            if (GameSaveData.instance.graphicOptionKey == "highest")
            {
                Application.set_targetFrameRate(120);
                Time.set_fixedDeltaTime(0.008333335f);
            }
            else
            {
                Application.set_targetFrameRate(30);
            }
        }
        NetworkNative.setHost(NetworkManager.APP_HOST);
        isAnalytics = true;
        NetworkNative.getAnalytics();
        MonoBehaviourSingleton <AppMain> .I.UpdateResolution(true);

        MonoBehaviourSingleton <SoundManager> .I.UpdateConfigVolume();

        if (MonoBehaviourSingleton <InGameManager> .IsValid())
        {
            MonoBehaviourSingleton <InGameManager> .I.UpdateConfig();
        }
        if (MonoBehaviourSingleton <InputManager> .IsValid())
        {
            MonoBehaviourSingleton <InputManager> .I.UpdateConfigInput();
        }
        Transform ui_root = ResourceUtility.Realizes(Resources.Load("UI/UI_Root"), MonoBehaviourSingleton <AppMain> .I._transform, -1);

        ui_root.get_gameObject().AddComponent <UIManager>();
        MonoBehaviourSingleton <UIManager> .I.SetDisable(UIManager.DISABLE_FACTOR.INITIALIZE, true);

        MonoBehaviourSingleton <AppMain> .I.get_gameObject().AddComponent <GameSceneManager>();

        MonoBehaviourSingleton <AppMain> .I.get_gameObject().AddComponent <UserInfoManager>();

        MonoBehaviourSingleton <AppMain> .I.get_gameObject().AddComponent <TransitionManager>();

        MonoBehaviourSingleton <AppMain> .I.get_gameObject().AddComponent <FBManager>();

        MonoBehaviourSingleton <AppMain> .I.get_gameObject().AddComponent <NativeGameService>();

        Singleton <StringTable> .Create();

        Singleton <StringTable> .I.CreateTable(null);

        MonoBehaviourSingleton <GameSceneManager> .I.Initialize();

        LoadingQueue load_queue             = new LoadingQueue(this);
        LoadObject   lo_sound_se_table      = load_queue.Load(RESOURCE_CATEGORY.TABLE, "SETable", false);
        LoadObject   lo_audio_setting_table = load_queue.Load(RESOURCE_CATEGORY.TABLE, "AudioSettingTable", false);

        while (load_queue.IsLoading() || !MonoBehaviourSingleton <GameSceneManager> .I.isInitialized)
        {
            yield return((object)null);
        }
        Singleton <SETable> .Create();

        Singleton <SETable> .I.CreateTableFromInternal((lo_sound_se_table.loadedObject as TextAsset).get_text());

        Singleton <AudioSettingTable> .Create();

        Singleton <AudioSettingTable> .I.CreateTableFromInternal((lo_audio_setting_table.loadedObject as TextAsset).get_text());

        if (MonoBehaviourSingleton <SoundManager> .IsValid())
        {
            MonoBehaviourSingleton <SoundManager> .I.LoadParmanentAudioClip();

            while (MonoBehaviourSingleton <SoundManager> .I.IsLoadingAudioClip())
            {
                yield return((object)null);
            }
        }
        MonoBehaviourSingleton <ResourceManager> .I.SetURL(NetworkManager.IMG_HOST);

        MonoBehaviourSingleton <GoGameResourceManager> .I.LoadVariantManifest();

        while (MonoBehaviourSingleton <GoGameResourceManager> .I.isLoadingVariantManifest)
        {
            Debug.Log((object)"Waiting LoadingVariantManifest ");
            yield return((object)null);
        }
        int reset = PlayerPrefs.GetInt("AppMain.Reset", 0);

        if (reset != 0)
        {
            yield return((object)null);

            MonoBehaviourSingleton <AppMain> .I.Reset((reset & 1) != 0, (reset & 2) != 0);
        }
        else
        {
            float analyticTimeCount = 5f;
            while (isAnalytics)
            {
                analyticTimeCount -= Time.get_deltaTime();
                if (analyticTimeCount < 0f)
                {
                    int err_code = 200000;
                    MonoBehaviourSingleton <GameSceneManager> .I.OpenCommonDialog(new CommonDialog.Desc(CommonDialog.TYPE.OK, StringTable.Format(STRING_CATEGORY.COMMON_DIALOG, 1001u, err_code), StringTable.Get(STRING_CATEGORY.COMMON_DIALOG, 100u), null, null, null), delegate
                    {
                        MonoBehaviourSingleton <AppMain> .I.Reset();
                    }, true, err_code);

                    yield break;
                }
                yield return((object)null);
            }
            bool wait = true;
            MonoBehaviourSingleton <AccountManager> .I.SendCheckRegister(analyticsString, delegate
            {
                ((_003CStart_003Ec__Iterator19) /*Error near IL_0495: stateMachine*/)._003Cwait_003E__7 = false;
            });

            while (wait)
            {
                yield return((object)null);
            }
            MonoBehaviourSingleton <ResourceManager> .I.cache.ClearObjectCaches(true);

            MonoBehaviourSingleton <ResourceManager> .I.cache.ClearPackageCaches();

            bool assetbundle_mode = isAssetBundleMode();
            bool to_opening       = IsOpening();
            if (assetbundle_mode)
            {
                if (!CheckPermissions())
                {
                    bool isFirstLoad = PlayerPrefs.GetInt("first_time_load_game_msg", 0) == 0;
                    AndroidPermissionsManager.ShouldShowRequestPermission("android.permission.WRITE_EXTERNAL_STORAGE");
                    PlayerPrefs.SetInt("first_time_load_game_msg", 1);
                    if (!isFirstLoad)
                    {
                        MonoBehaviourSingleton <UIManager> .I.loading.ShowChangePermissionMsg(true);

                        while (!CheckPermissions())
                        {
                            yield return((object)null);
                        }
                    }
                    else
                    {
                        MonoBehaviourSingleton <UIManager> .I.loading.ShowWellcomeMsg(true);

                        while (isWaitGrantedPermission)
                        {
                            yield return((object)null);
                        }
                        while (!isGrantedPermission)
                        {
                            isWaitGrantedPermission = true;
                            MonoBehaviourSingleton <UIManager> .I.loading.ShowDellyMsg(true);

                            MonoBehaviourSingleton <UIManager> .I.loading.ShowEmptyFirstLoad(false);

                            while (isWaitGrantedPermission)
                            {
                                yield return((object)null);
                            }
                            if (!isGrantedPermission && !AndroidPermissionsManager.ShouldShowRequestPermission("android.permission.WRITE_EXTERNAL_STORAGE"))
                            {
                                MonoBehaviourSingleton <UIManager> .I.loading.HideAllPermissionMsg();

                                MonoBehaviourSingleton <UIManager> .I.loading.ShowChangePermissionMsg(true);

                                while (!CheckPermissions())
                                {
                                    yield return((object)null);
                                }
                                isGrantedPermission = true;
                            }
                        }
                    }
                    MonoBehaviourSingleton <UIManager> .I.loading.ShowEmptyFirstLoad(true);

                    MonoBehaviourSingleton <UIManager> .I.loading.HideAllTextMsg();

                    yield return((object)null);
                }
                else if (PlayerPrefs.GetInt("first_time_load_game_msg", 0) == 0)
                {
                    PlayerPrefs.SetInt("first_time_load_game_msg", 1);
                    MonoBehaviourSingleton <UIManager> .I.loading.ShowEmptyFirstLoad(true);
                }
                if (to_opening)
                {
                    MonoBehaviourSingleton <UIManager> .I.loading.downloadGaugeVisible = false;
                }
                MonoBehaviourSingleton <ResourceManager> .I.SetURL(NetworkManager.IMG_HOST);

                MonoBehaviourSingleton <ResourceManager> .I.LoadManifest();

                while (MonoBehaviourSingleton <ResourceManager> .I.isLoadingManifest)
                {
                    yield return((object)null);
                }
                ResourceManager.internalMode = false;
                load_queue.Load(RESOURCE_CATEGORY.SHADER, null, null, true);
                load_queue.Load(RESOURCE_CATEGORY.UI_FONT, null, null, true);
                ResourceManager.internalMode = true;
                yield return((object)load_queue.Wait());

                MonoBehaviourSingleton <ResourceManager> .I.cache.MarkSystemPackage(RESOURCE_CATEGORY.SHADER.ToAssetBundleName(null));

                MonoBehaviourSingleton <ResourceManager> .I.cache.MarkSystemPackage(RESOURCE_CATEGORY.UI_FONT.ToAssetBundleName(null));

                MonoBehaviourSingleton <ResourceManager> .I.cache.CacheShadersFromPackage(RESOURCE_CATEGORY.SHADER.ToAssetBundleName(null));

                MonoBehaviourSingleton <UIManager> .I.loading.downloadGaugeVisible = true;
            }
            NetworkNative.getNativeAsset();
            if (MonoBehaviourSingleton <AccountManager> .I.sendAsset)
            {
                NetworkNative.getNativeiOSAsset();
            }
            if (to_opening)
            {
                Native.CheckReferrerSendToAppBrowser();
                ResourceManager.internalMode = true;
                ResourceManager.internalMode = false;
                if (MonoBehaviourSingleton <ResourceManager> .I.manifest != null)
                {
                    ResourceManager.internalMode = true;
                }
                MonoBehaviourSingleton <AppMain> .I.get_gameObject().AddComponent <OpeningStartProcess>();
            }
            else
            {
                ResourceManager.internalMode = false;
                MonoBehaviourSingleton <AppMain> .I.get_gameObject().AddComponent <LoadingProcess>();
            }
            Object.Destroy(this);
        }
    }
Exemplo n.º 22
0
    private void Start()
    {
        //IL_002a: Unknown result type (might be due to invalid IL or missing references)
        //IL_0034: Unknown result type (might be due to invalid IL or missing references)
        //IL_003a: Invalid comparison between Unknown and I4
        //IL_003f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0045: Invalid comparison between Unknown and I4
        //IL_004a: Unknown result type (might be due to invalid IL or missing references)
        //IL_0050: Invalid comparison between Unknown and I4
        //IL_0055: Unknown result type (might be due to invalid IL or missing references)
        //IL_005b: Invalid comparison between Unknown and I4
        //IL_0091: Unknown result type (might be due to invalid IL or missing references)
        //IL_0096: Expected O, but got Unknown
        //IL_00d5: Unknown result type (might be due to invalid IL or missing references)
        //IL_00e1: Unknown result type (might be due to invalid IL or missing references)
        Screen.set_sleepTimeout(-1);
        isInitialized         = false;
        isApplicationQuit     = false;
        isReset               = false;
        showingTableLoadError = false;
        Startup();
        InitCollideLayers();
        if ((int)Screen.get_orientation() == 0 || (int)Screen.get_orientation() == 1 || (int)Screen.get_orientation() == 3 || (int)Screen.get_orientation() == 3 || (int)Screen.get_orientation() == 4)
        {
            Screen.set_orientation(1);
        }
        else
        {
            Screen.set_orientation(2);
        }
        Utility.Initialize();
        Temporary.Initialize();
        Protocol.Initialize();
        HomeSelfCharacter.CTRL = true;
        appVer = NetworkNative.getNativeVersionFromName();
        GameObject val = this.get_gameObject();

        val.AddComponent <GoWrapManager>();
        val.AddComponent <FCMManager>();
        val.AddComponent <DefaultTimeUpdater>();
        val.AddComponent <ResourceManager>();
        MonoBehaviourSingleton <ResourceManager> .I.onAsyncLoadQuery = onAsyncLoadQuery;
        val.AddComponent <InstantiateManager>();
        DataTableManager dataTableManager = new GameObject("DataTableManager").AddComponent <DataTableManager>();

        dataTableManager.get_transform().set_parent(base._transform);
        dataTableManager.onError        += OnTableDownloadError;
        ResourceManager.enableLoadDirect = false;
        CreateDefaultCamera();
        val.AddComponent <ScreenOrientationManager>();
        MonoBehaviourSingleton <ScreenOrientationManager> .I.OnScreenRotate += OnScreenRotate;
        UpdateResolution(MonoBehaviourSingleton <ScreenOrientationManager> .I.isPortrait);
        Utility.CreateGameObjectAndComponent("AudioListenerManager", MonoBehaviourSingleton <AppMain> .I._transform, -1);
        Utility.CreateGameObjectAndComponent("SoundManager", base._transform, -1);
        Utility.CreateGameObjectAndComponent("AudioObjectPool", base._transform, -1);
        Utility.CreateGameObjectAndComponent("EffectManager", base._transform, -1);
        val.AddComponent <NetworkManager>();
        val.AddComponent <ProtocolManager>();
        val.AddComponent <AccountManager>();
        val.AddComponent <TimeManager>();
        val.AddComponent <GoGameTimeManager>();
        Utility.CreateGameObjectAndComponent("NativeReceiver", base._transform, -1);
        Utility.CreateGameObjectAndComponent("ShopReceiver", base._transform, -1);
        Utility.CreateGameObjectAndComponent("ChatManager", base._transform, -1);
        Utility.CreateGameObjectAndComponent("NativeShare", base._transform, -1);
        val.AddComponent <CoopApp>();
        val.AddComponent <BootProcess>();
    }