Beispiel #1
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);
        }
    }
Beispiel #2
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);
        }
    }
Beispiel #3
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);
        }
    }