Пример #1
0
        protected override void DealConnectError(ApolloResult result)
        {
            this.lastResult = result;
            this.reconPolicy.StartPolicy(result);
            List <KeyValuePair <string, string> > events = new List <KeyValuePair <string, string> > {
                new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()),
                new KeyValuePair <string, string>("status", "1"),
                new KeyValuePair <string, string>("type", "platform"),
                new KeyValuePair <string, string>("errorCode", result.ToString())
            };

            Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_SvrConnectFail", events, true);
        }
Пример #2
0
        protected override void DealConnectFail(ApolloResult result, ApolloLoginInfo loginInfo)
        {
            this.reconPolicy.StartPolicy(result);
            MonoSingleton <Reconnection> .instance.QueryIsRelayGaming(result);

            List <KeyValuePair <string, string> > events = new List <KeyValuePair <string, string> > {
                new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()),
                new KeyValuePair <string, string>("status", "1"),
                new KeyValuePair <string, string>("type", "challenge"),
                new KeyValuePair <string, string>("errorCode", result.ToString())
            };

            Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_SvrConnectFail", events, true);
        }
Пример #3
0
    public void Login(ApolloPlatform platform, ulong uin = 0, string pwd = null)
    {
        switch (platform)
        {
        case ApolloPlatform.None:
        {
            if (ApolloConfig.CustomOpenId == null)
            {
            }
            ApolloResult result = NoneAccountService.Initialize(new NoneAccountInitInfo(ApolloConfig.CustomOpenId));
            if (result == ApolloResult.Success)
            {
                break;
            }
            List <KeyValuePair <string, string> > events = new List <KeyValuePair <string, string> > {
                new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion()),
                new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()),
                new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString()),
                new KeyValuePair <string, string>("openid", "NULL")
            };
            float num = Time.time - Singleton <CLoginSystem> .GetInstance().m_fLoginClickTime;

            events.Add(new KeyValuePair <string, string>("totaltime", num.ToString()));
            events.Add(new KeyValuePair <string, string>("errorcode", result.ToString()));
            events.Add(new KeyValuePair <string, string>("error_msg", "null"));
            Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_Login_MSDKClientAuth", events, true);

            Singleton <EventRouter> .GetInstance().BroadCastEvent <ApolloResult>(EventID.ApolloHelper_Login_Failed, result);

            return;
        }

        case ApolloPlatform.WTLogin:
            Singleton <EventRouter> .GetInstance().BroadCastEvent <ApolloResult>(EventID.ApolloHelper_Login_Failed, ApolloResult.Empty);

            return;
        }
        ApolloConfig.Uin      = uin;
        ApolloConfig.Password = pwd;
        ApolloConfig.platform = this.CurPlatform = platform;
        if ((ApolloConfig.platform == ApolloPlatform.None) && this.IsNoneModeSupport)
        {
            Singleton <EventRouter> .GetInstance().BroadCastEvent <ApolloAccountInfo>(EventID.ApolloHelper_Login_Success, this.GetAccountInfo(false));
        }
        else
        {
            this.OnLogin(platform);
        }
    }
        protected override void DealConnectError(ApolloResult result)
        {
            this.lastResult = result;
            this.reconPolicy.StartPolicy(result, 10);
            List <KeyValuePair <string, string> > list = new List <KeyValuePair <string, string> >();

            list.Add(new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion()));
            list.Add(new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()));
            list.Add(new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString()));
            list.Add(new KeyValuePair <string, string>("openid", "NULL"));
            list.Add(new KeyValuePair <string, string>("status", "0"));
            list.Add(new KeyValuePair <string, string>("type", "platform"));
            list.Add(new KeyValuePair <string, string>("errorCode", result.ToString()));
            Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_SvrConnectFail", list, true);
        }
Пример #5
0
    private void OnLoginEvent(ApolloResult loginResult, ApolloAccountInfo loginfo)
    {
        Debug.Log("OnLoginEvent called");
        this.m_IsSwitchToLoginPlatform = false;
        if (loginResult == ApolloResult.Success)
        {
            if (loginfo != null)
            {
                if ((this.m_LastOpenID != null) && (loginfo.OpenId != this.m_LastOpenID))
                {
                    Singleton <CUIManager> .GetInstance().OpenMessageBox(Singleton <CTextManager> .GetInstance().GetText("Common_Login_Different_Account_Tip_Force"), enUIEventID.Login_Change_Account_Yes, false);

                    return;
                }
                Singleton <EventRouter> .GetInstance().BroadCastEvent <ApolloAccountInfo>(EventID.ApolloHelper_Login_Success, loginfo);
            }
        }
        else if (loginResult == ApolloResult.UserCancel)
        {
            Debug.Log("Login Fail. User cancel");
            BugLocateLogSys.Log(string.Format("Login Fail. User cancel", new object[0]));
            Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.ApolloHelper_Login_Canceled);
        }
        else
        {
            Debug.Log(string.Format("Login Fail. Error code is {0}", loginResult));
            BugLocateLogSys.Log(string.Format("Login Fail. Error code is {0}", loginResult));
            List <KeyValuePair <string, string> > events = new List <KeyValuePair <string, string> > {
                new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()),
                new KeyValuePair <string, string>("status", "1"),
                new KeyValuePair <string, string>("errorcode", loginResult.ToString())
            };
            Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_PlatformLogin", events, true);

            Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.ApolloHelper_Login_Failed);
        }
        if (this.accountService != null)
        {
            this.accountService.LoginEvent -= new AccountLoginHandle(this.OnLoginEvent);
        }
        else
        {
            BugLocateLogSys.Log("accountService == null");
        }
        this.m_IsLoginEventHandlerRegistered = false;
        this.m_IsLoginReturn = true;
        BugLocateLogSys.Log("LoginEvent Thread:" + Thread.CurrentThread.ManagedThreadId);
    }
Пример #6
0
        protected override void DealConnectFail(ApolloResult result, ApolloLoginInfo loginInfo)
        {
            this.reconPolicy.StartPolicy(result, 6);
            MonoSingleton <Reconnection> .get_instance().QueryIsRelayGaming(result);

            List <KeyValuePair <string, string> > list = new List <KeyValuePair <string, string> >();

            list.Add(new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion()));
            list.Add(new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()));
            list.Add(new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString()));
            list.Add(new KeyValuePair <string, string>("openid", "NULL"));
            list.Add(new KeyValuePair <string, string>("status", "0"));
            list.Add(new KeyValuePair <string, string>("type", "challenge"));
            list.Add(new KeyValuePair <string, string>("errorCode", result.ToString()));
            Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_SvrConnectFail", list, true);
        }
Пример #7
0
    public void Login(ApolloPlatform platform, ulong uin = 0uL, string pwd = null)
    {
        switch (platform)
        {
        case 0:
        {
            if (ApolloConfig.CustomOpenId == null)
            {
            }
            ApolloResult apolloResult = NoneAccountService.Initialize(new NoneAccountInitInfo(ApolloConfig.CustomOpenId));
            if (apolloResult != null)
            {
                List <KeyValuePair <string, string> > list = new List <KeyValuePair <string, string> >();
                list.Add(new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion()));
                list.Add(new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()));
                list.Add(new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString()));
                list.Add(new KeyValuePair <string, string>("openid", "NULL"));
                list.Add(new KeyValuePair <string, string>("totaltime", (Time.time - Singleton <CLoginSystem> .GetInstance().m_fLoginClickTime).ToString()));
                list.Add(new KeyValuePair <string, string>("errorCode", apolloResult.ToString()));
                list.Add(new KeyValuePair <string, string>("error_msg", "null"));
                Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_Login_MSDKClientAuth", list, true);

                Singleton <EventRouter> .GetInstance().BroadCastEvent <ApolloResult>(EventID.ApolloHelper_Login_Failed, apolloResult);

                return;
            }
            break;
        }

        case 3:
            Singleton <EventRouter> .GetInstance().BroadCastEvent <ApolloResult>(EventID.ApolloHelper_Login_Failed, 7);

            return;
        }
        ApolloConfig.Uin      = uin;
        ApolloConfig.Password = pwd;
        this.CurPlatform      = platform;
        ApolloConfig.platform = platform;
        if (ApolloConfig.platform == null && this.IsNoneModeSupport)
        {
            Singleton <EventRouter> .GetInstance().BroadCastEvent <ApolloAccountInfo>(EventID.ApolloHelper_Login_Success, this.GetAccountInfo(false));
        }
        else
        {
            this.OnLogin(platform);
        }
    }
Пример #8
0
    public void Login(ApolloPlatform platform, ulong uin = 0, string pwd = null)
    {
        switch (platform)
        {
        case ApolloPlatform.None:
        {
            if (ApolloConfig.CustomOpenId == null)
            {
                Debug.Log(string.Format("Custom OpenId is Empty! current platform{0}", platform));
            }
            ApolloResult result = NoneAccountService.Initialize(new NoneAccountInitInfo(ApolloConfig.CustomOpenId));
            if (result != ApolloResult.Success)
            {
                Debug.Log(string.Format("login apollo result is {0}! current platform{1}", result, platform));
                List <KeyValuePair <string, string> > events = new List <KeyValuePair <string, string> > {
                    new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()),
                    new KeyValuePair <string, string>("status", "1"),
                    new KeyValuePair <string, string>("errorcode", result.ToString())
                };
                Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_PlatformLogin", events, true);

                Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.ApolloHelper_Login_Failed);

                return;
            }
            Debug.Log(string.Format("Set login by none platform success", result, platform));
            break;
        }

        case ApolloPlatform.WTLogin:
            Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.ApolloHelper_Login_Failed);

            return;
        }
        ApolloConfig.Uin      = uin;
        ApolloConfig.Password = pwd;
        ApolloConfig.platform = this.m_CurPlatform = platform;
        if (ApolloConfig.platform == ApolloPlatform.None)
        {
            Singleton <EventRouter> .GetInstance().BroadCastEvent <ApolloAccountInfo>(EventID.ApolloHelper_Login_Success, this.GetAccountInfo(false));
        }
        else
        {
            this.OnLogin(platform);
        }
    }
Пример #9
0
        protected override void DealConnectFail(ApolloResult result, ApolloLoginInfo loginInfo)
        {
            this.lastResult = result;
            if ((result == ApolloResult.StayInQueue) || (result == ApolloResult.SvrIsFull))
            {
                MonoSingleton <TdirMgr> .GetInstance().ConnectLobby();
            }
            else
            {
                this.reconPolicy.StartPolicy(result);
            }
            List <KeyValuePair <string, string> > events = new List <KeyValuePair <string, string> > {
                new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()),
                new KeyValuePair <string, string>("status", "1"),
                new KeyValuePair <string, string>("type", "platform"),
                new KeyValuePair <string, string>("errorCode", result.ToString())
            };

            Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_SvrConnectFail", events, true);
        }
Пример #10
0
    private void OnLoginEvent(ApolloResult loginResult, ApolloAccountInfo accountInfo)
    {
        this.m_IsSwitchToLoginPlatform = false;
        if (loginResult != ApolloResult.Success)
        {
            if (loginResult == ApolloResult.UserCancel)
            {
                BugLocateLogSys.Log(string.Format("Login Fail. User cancel", new object[0]));
                Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.ApolloHelper_Login_Canceled);
            }
            else
            {
                BugLocateLogSys.Log(string.Format("Login Fail. Error code is {0}", loginResult));
                List <KeyValuePair <string, string> > events = new List <KeyValuePair <string, string> > {
                    new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion()),
                    new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()),
                    new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString()),
                    new KeyValuePair <string, string>("openid", "NULL")
                };
                float num = Time.time - Singleton <CLoginSystem> .GetInstance().m_fLoginClickTime;

                events.Add(new KeyValuePair <string, string>("totaltime", num.ToString()));
                events.Add(new KeyValuePair <string, string>("errorcode", loginResult.ToString()));
                events.Add(new KeyValuePair <string, string>("error_msg", "null"));
                Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_Login_MSDKClientAuth", events, true);

                Singleton <EventRouter> .GetInstance().BroadCastEvent <ApolloResult>(EventID.ApolloHelper_Login_Failed, loginResult);
            }
        }
        else
        {
            if (this.m_LastOpenID == null)
            {
                switch (this.CurPlatform)
                {
                case ApolloPlatform.Wechat:
                case ApolloPlatform.QRWechat:
                    if (accountInfo.Platform != ApolloPlatform.Wechat)
                    {
                        this.Logout();
                        return;
                    }
                    break;

                case ApolloPlatform.QQ:
                case ApolloPlatform.WTLogin:
                case ApolloPlatform.QR:
                    if (accountInfo.Platform == ApolloPlatform.QQ)
                    {
                        break;
                    }
                    this.Logout();
                    return;
                }
            }
            ApolloConfig.platform = this.CurPlatform = accountInfo.Platform;
            if ((this.m_LastOpenID != null) && (accountInfo.OpenId != this.m_LastOpenID))
            {
                Singleton <CUIManager> .GetInstance().OpenMessageBox(Singleton <CTextManager> .GetInstance().GetText("Common_Login_Different_Account_Tip_Force"), enUIEventID.Login_Change_Account_Yes, false);

                return;
            }
            if (this.JudgeLoginAccountInfo(ref accountInfo))
            {
                Singleton <EventRouter> .GetInstance().BroadCastEvent <ApolloAccountInfo>(EventID.ApolloHelper_Login_Success, accountInfo);
            }
            else
            {
                Singleton <EventRouter> .GetInstance().BroadCastEvent <ApolloAccountInfo>(EventID.ApolloHelper_Login_Failed, accountInfo);
            }
        }
        if (this.accountService != null)
        {
            this.accountService.LoginEvent -= new AccountLoginHandle(this.OnLoginEvent);
        }
        else
        {
            BugLocateLogSys.Log("accountService == null");
        }
        this.m_IsLoginEventHandlerRegistered = false;
        this.m_IsLoginReturn = true;
        BugLocateLogSys.Log("LoginEvent Thread:" + Thread.CurrentThread.ManagedThreadId);
    }
    private void OnLoginEvent(ApolloResult loginResult, ApolloAccountInfo accountInfo)
    {
        Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

        Singleton <ApolloHelper> .GetInstance().IsLastLaunchFrom3rdAPP = false;

        Debug.Log(string.Concat(new object[]
        {
            "*Login*OnLoginEvent called ",
            loginResult,
            " ",
            Time.realtimeSinceStartup
        }));
        this.m_IsSwitchToLoginPlatform = false;
        if (loginResult == ApolloResult.Success)
        {
            ApolloConfig.platform = (this.CurPlatform = accountInfo.Platform);
            if (!string.IsNullOrEmpty(this.m_LastOpenID) && accountInfo.OpenId != this.m_LastOpenID)
            {
                Singleton <CUIManager> .GetInstance().OpenMessageBox(Singleton <CTextManager> .GetInstance().GetText("Common_Login_Different_Account_Tip_Force"), enUIEventID.Login_Change_Account_Yes, false);

                return;
            }
            if (this.JudgeLoginAccountInfo(ref accountInfo))
            {
                Singleton <EventRouter> .GetInstance().BroadCastEvent <ApolloAccountInfo>(EventID.ApolloHelper_Login_Success, accountInfo);
            }
            else
            {
                Singleton <EventRouter> .GetInstance().BroadCastEvent <ApolloResult>(EventID.ApolloHelper_Login_Failed, ApolloResult.Empty);
            }
        }
        else if (loginResult == ApolloResult.UserCancel)
        {
            BugLocateLogSys.Log(string.Format("Login Fail. User cancel", new object[0]));
            Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.ApolloHelper_Login_Canceled);
        }
        else if (loginResult == ApolloResult.NeedRealNameAuth)
        {
            Debug.Log("Login NeedRealNameAuth.");
            BugLocateLogSys.Log(string.Format("Login NeedRealNameAuth.", new object[0]));
            Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.ApolloHelper_Login_Need_Real_Name_Auth);
        }
        else
        {
            BugLocateLogSys.Log(string.Format("Login Fail. Error code is {0}", loginResult));
            List <KeyValuePair <string, string> > list = new List <KeyValuePair <string, string> >();
            list.Add(new KeyValuePair <string, string>("g_version", CVersion.GetAppVersion()));
            list.Add(new KeyValuePair <string, string>("WorldID", MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID.ToString()));
            list.Add(new KeyValuePair <string, string>("platform", Singleton <ApolloHelper> .GetInstance().CurPlatform.ToString()));
            list.Add(new KeyValuePair <string, string>("openid", "NULL"));
            list.Add(new KeyValuePair <string, string>("totaltime", (Time.time - Singleton <CLoginSystem> .GetInstance().m_fLoginClickTime).ToString()));
            list.Add(new KeyValuePair <string, string>("errorCode", loginResult.ToString()));
            list.Add(new KeyValuePair <string, string>("error_msg", "null"));
            Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Service_Login_MSDKClientAuth", list, true);

            Singleton <EventRouter> .GetInstance().BroadCastEvent <ApolloResult>(EventID.ApolloHelper_Login_Failed, loginResult);
        }
        if (this.accountService == null)
        {
            BugLocateLogSys.Log("accountService == null");
        }
        this.m_IsLoginReturn = true;
        BugLocateLogSys.Log("LoginEvent Thread:" + Thread.get_CurrentThread().get_ManagedThreadId());
    }