Пример #1
0
    private void OnApplicationPause(bool pause)
    {
        UnityEngine.Debug.LogWarning("OnApplicationPause  == " + pause);
        if (TsPlatform.IsMobile)
        {
            if (NmFacebookManager.instance.IsFacebook)
            {
                return;
            }
            if (NrTSingleton <NrMainSystem> .Instance.m_bIsBilling)
            {
                return;
            }
            GameObject gameObject = GameObject.Find("OmniataManager");
            if (gameObject == null)
            {
                gameObject = new GameObject("OmniataManager");
            }
            if (gameObject != null)
            {
                OmniataComponent component = gameObject.GetComponent <OmniataComponent>();
                if (component && !pause)
                {
                    DateTime dateTime  = DateTime.Now.ToLocalTime();
                    DateTime arg_AE_0  = dateTime;
                    DateTime dateTime2 = new DateTime(1970, 1, 1, 0, 0, 0, 0);
                    int      num       = (int)(arg_AE_0 - dateTime2.ToLocalTime()).TotalSeconds;
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    dictionary.Add("ts", num.ToString());
                    dictionary.Add("step", "pauseoff");
                    dictionary.Add("device", SystemInfo.deviceUniqueIdentifier);
                    if (TsPlatform.IsAndroid)
                    {
                        dictionary.Add("version", TsPlatform.APP_VERSION_AND);
                    }
                    else if (TsPlatform.IsIPhone)
                    {
                        dictionary.Add("version", TsPlatform.APP_VERSION_IOS);
                    }
                    component.TrackLoad(dictionary);
                }
            }
            if (pause && Scene.CurScene > Scene.Type.LOGIN)
            {
                NrTSingleton <FiveRocksEventManager> .Instance.Placement("Game_end");

                UnityEngine.Debug.LogWarning("OnApplicationPause");
                NrTSingleton <NrMainSystem> .Instance.OnApplicationPause();

                BaseNet_Game.GetInstance().Quit();
            }
            else if (NrWebViewObject.GetGameObject() == null)
            {
                UnityEngine.Debug.LogWarning("NrWebViewObject == NULL");
            }
        }
    }
Пример #2
0
    public void Notice(IUIObject obj)
    {
        if (TsPlatform.IsMobile && !TsPlatform.IsEditor)
        {
            NrWebViewObject gameObject = NrWebViewObject.GetGameObject();
            gameObject.MainmenuNoticeOpen = true;
            NrTSingleton <NkClientLogic> .Instance.RequestOTPAuthKey(eOTPRequestType.OTPREQ_USERAUTH);

            NrTSingleton <FiveRocksEventManager> .Instance.Placement("notice_open");
        }
    }
 public bool OnWebCall(string WebCall)
 {
     if (WebCall.Contains("InternetConnnetError"))
     {
         MsgHandler.Handle("InternetConnnetError", new object[0]);
         TsPlatform.Operator.CloseWebView();
         return(true);
     }
     if (WebCall.Contains("EmailOpen"))
     {
         char[] separator = new char[]
         {
             '='
         };
         string[] array = WebCall.Split(separator);
         if (2 <= array.Length)
         {
             string url = "http://" + array[1];
             Application.OpenURL(url);
             MsgHandler.Handle("QuitAPP", new object[0]);
         }
     }
     if (WebCall.Contains("close"))
     {
         NrWebViewObject gameObject = NrWebViewObject.GetGameObject();
         if (gameObject.GameNoticeOpen)
         {
             gameObject.GameNoticeOpen = false;
         }
         TsPlatform.Operator.CloseWebView();
     }
     if (WebCall.Contains("member_out_proc"))
     {
         NrWebViewObject gameObject2 = NrWebViewObject.GetGameObject();
         if (gameObject2.GameNoticeOpen)
         {
             gameObject2.GameNoticeOpen = false;
         }
         TsPlatform.Operator.CloseWebView();
         MsgHandler.Handle("RequestMemberSecession", new object[0]);
     }
     if (WebCall.Contains("bandpolicy_proc"))
     {
         NrWebViewObject gameObject3 = NrWebViewObject.GetGameObject();
         if (gameObject3.GameNoticeOpen)
         {
             gameObject3.GameNoticeOpen = false;
         }
         TsPlatform.Operator.CloseWebView();
         MsgHandler.Handle("ShowTerm", new object[0]);
         PlayerPrefs.SetInt(NrPrefsKey.SHOW_TERM, 1);
     }
     if (WebCall.Contains("qna_Write.aspx"))
     {
         MsgHandler.Handle("SetPlacement", new object[]
         {
             "cs_direct"
         });
     }
     if (WebCall.Contains("customer.aspx"))
     {
         MsgHandler.Handle("SetPlacement", new object[]
         {
             "cs_menu"
         });
     }
     if (WebCall.Contains("AuthPlatformSync_proc.aspx") && WebCall.Contains("msg=success"))
     {
         TsPlatform.Operator.CloseWebView();
         MsgHandler.Handle("ConvertGuestID", new object[]
         {
             false
         });
     }
     return(true);
 }
Пример #4
0
    private void ProcessOTPReady(eOTPRequestType eReqType)
    {
        if (this.szOTPAuthKey[(int)eReqType].Length > 0)
        {
            switch (eReqType)
            {
            case eOTPRequestType.OTPREQ_USERAUTH:
            {
                bool            flag       = false;
                NrWebViewObject gameObject = NrWebViewObject.GetGameObject();
                if (!gameObject.FirstNoticeOpen || gameObject.MainmenuNoticeOpen)
                {
                    flag = true;
                }
                if (flag)
                {
                    string     strCharName = string.Empty;
                    NrCharBase @char       = NrTSingleton <NkCharManager> .Instance.GetChar(1);

                    if (@char != null)
                    {
                        strCharName = @char.GetCharName();
                    }
                    NrMobileNoticeWeb nrMobileNoticeWeb = new NrMobileNoticeWeb();
                    nrMobileNoticeWeb.OnGameNotice(this.szOTPAuthKey[0], strCharName);
                }
                gameObject.FirstNoticeOpen    = true;
                gameObject.MainmenuNoticeOpen = false;
                break;
            }

            case eOTPRequestType.OTPREQ_CHARPORTRAIT:
            {
                NrCharBase char2 = NrTSingleton <NkCharManager> .Instance.GetChar(1);

                if (char2 != null)
                {
                    NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

                    NkSoldierInfo leaderSoldierInfo = charPersonInfo.GetLeaderSoldierInfo();
                    string        arg = string.Empty;
                    if (charPersonInfo != null && leaderSoldierInfo != null)
                    {
                        arg = this.GetProcessLeaderHero(leaderSoldierInfo.GetCharKind());
                    }
                    string url = string.Format("http://{0}/mobilephoto/user.aspx?otp={1}&type={2}", NrGlobalReference.strWebPageDomain, this.szOTPAuthKey[1], arg);
                    Application.OpenURL(url);
                }
                break;
            }

            case eOTPRequestType.OTPREQ_GUILDMARK:
                if (0L < NrTSingleton <NewGuildManager> .Instance.GetGuildID())
                {
                    string url2 = string.Format("http://{0}/mobilephoto/guild.aspx?otp={1}", NrGlobalReference.strWebPageDomain, this.szOTPAuthKey[2]);
                    Application.OpenURL(url2);
                }
                break;

            case eOTPRequestType.OTPREQ_EMAIL:
            {
                string            text = string.Format("http://{0}/member/member_confirm1.aspx?OTP={1}", NrGlobalReference.strWebPageDomain, this.szOTPAuthKey[3]);
                NrMobileNoticeWeb nrMobileNoticeWeb2 = new NrMobileNoticeWeb();
                nrMobileNoticeWeb2.OpenWebURL(text);
                TsLog.LogOnlyEditor("!!!!!!!!!!!!!!!! OTPREQ_EMAIL :{0}" + text);
                break;
            }

            case eOTPRequestType.OTPREQ_HP_AUTH:
            {
                string url3 = string.Format("http://{0}/mobileAuth/auth.aspx?otp={1}", NrGlobalReference.strWebPageDomain, this.szOTPAuthKey[4]);
                Application.OpenURL(url3);
                NrTSingleton <NrMainSystem> .Instance.QuitGame(false);

                break;
            }

            case eOTPRequestType.OTPREQ_GUESTID:
            {
                string url4 = string.Empty;
                if (TsPlatform.IsAndroid)
                {
                    url4 = string.Format("http://{0}/member/AuthPlatformSync_auth.aspx?OTP={1}&platform=android", NrGlobalReference.strWebPageDomain, this.szOTPAuthKey[5]);
                }
                else
                {
                    url4 = string.Format("http://{0}/member/AuthPlatformSync_auth.aspx?OTP={1}&platform=ios", NrGlobalReference.strWebPageDomain, this.szOTPAuthKey[5]);
                }
                NrMobileNoticeWeb nrMobileNoticeWeb3 = new NrMobileNoticeWeb();
                nrMobileNoticeWeb3.OpenWebURL(url4);
                break;
            }

            case eOTPRequestType.OTPREQ_HELPQUESTION:
            {
                NrMobileNoticeWeb nrMobileNoticeWeb4 = new NrMobileNoticeWeb();
                nrMobileNoticeWeb4.OnGameQuestion(this.szOTPAuthKey[6], string.Empty);
                break;
            }

            case eOTPRequestType.OTPREQ_UNREGISTER:
            {
                NrMobileNoticeWeb nrMobileNoticeWeb5 = new NrMobileNoticeWeb();
                nrMobileNoticeWeb5.OnGameUnregister(this.szOTPAuthKey[7]);
                break;
            }
            }
            this.szOTPAuthKey[(int)eReqType] = string.Empty;
        }
    }