コード例 #1
0
    public void GetUserInfo(System.Action <bool, string> userJsonInfo)
    {
                #if (UNITY_ANDROID && !UNITY_EDITOR)
#if ANDROID_UC
        OnUserJsonInfoBack = userJsonInfo;
        m_sid = UCGameSdk.getSid();
        if (OnUserJsonInfoBack != null)
        {
            OnUserJsonInfoBack(true, m_sid);
        }
#endif
#endif
    }
コード例 #2
0
    private void OnLoginResult(int code, string msg)
    {
        log(string.Format("UCCallbackMessage - OnLoginResult: code={0}, msg={1}", code, msg));

        //输出登录结果到页面(接入后删除)
        SendMessage("setMessage", string.Format("UCCallbackMessage - OnLoginResult: code={0}, msg={1}", code, msg));
        UI.Login.LoginUIManagerPlatform.setSdkMessage(string.Format("UCCallbackMessage - OnLoginResult: code={0}, msg={1}", code, msg));

        if (code == UCStatusCode.SUCCESS)
        {
            LoginPlatformManager.Instance.m_isLoginedPlatform = true;

            string sid = UCGameSdk.getSid();
            log("login succeeded: sid=" + sid);

            UI.Login.LoginUIManagerPlatform.Instance.OnSendLoginInfo();
            //
            UCConfig.logined = true;

            //显示悬浮按钮
            UCGameSdk.showFloatButton(100, 20, true);

            //进入分区通知,//TODO: 应在进入分区时进行该调用
            //UCGameSdk.notifyZone ("66区-风起云涌", "R29924", "Role-大漠孤烟");
        }
        else if (code == UCStatusCode.LOGIN_EXIT)
        {
            //登录界面退出,返回到游戏画面
            log("login UI exit, back to game UI");
            if (msg == "取消登录")
            {
                Invoke("ReLoginUC", 2f);
            }
        }
        else
        {
            log(string.Format("Failed login, code={0}, msg={1}", code, msg));
            //登录失败
            //
        }
    }
コード例 #3
0
    private void OnLoginResult(int code, string msg)
    {
        log(string.Format("UCCallbackMessage - OnLoginResult: code={0}, msg={1}", code, msg));

        //输出登录结果到页面(接入后删除)
        SendMessage("setMessage", string.Format("UCCallbackMessage - OnLoginResult: code={0}, msg={1}", code, msg));

        if (code == UCStatusCode.SUCCESS)
        {
            UCConfig.logined = true;

            //显示悬浮按钮
            //UCGameSdk.showFloatButton (100, 20, true);

            //进入分区通知,//TODO: 应在进入分区时进行该调用
            //UCGameSdk.notifyZone ("66区-风起云涌", "R29924", "Role-大漠孤烟");

            Debug.Log("uc sid is " + UCGameSdk.getSid());

            // 缺少获取用户基本信息的接口
            ThirdPartyPlatform.UserUniqId = "";
            ThirdPartyPlatform.SessionId  = UCGameSdk.getSid();
            ThirdPartyPlatform.NickName   = "";

            ThirdPartyPlatform.OnLogin(true);
        }
        else if (code == UCStatusCode.LOGIN_EXIT)
        {
            //登录界面退出,返回到游戏画面
            log("login UI exit, back to game UI");
        }
        else
        {
            log(string.Format("Failed login, code={0}, msg={1}", code, msg));

            //登录失败
            //
        }
    }