示例#1
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);
    }
示例#2
0
    public void SendRequest()
    {
        if (!m_isSending)
        {
            switch (m_progress)
            {
            default:
                return;

            case PROGRESS.CHECK_REGISTER:
                Protocol.Send(CheckRegisterModel.URL, delegate(CheckRegisterModel ret)
                {
                    RecvResult(ret, ret.result);
                }, string.Empty);
                break;

            case PROGRESS.ASSET_BUNDLE_VERSION:
                Protocol.Send(AssetBundleVersionModel.URL, delegate(AssetBundleVersionModel ret)
                {
                    RecvResult(ret, ret.result);
                }, string.Empty);
                break;

            case PROGRESS.REGIST_CREATE:
            {
                RegistCreateSendParam registCreateSendParam = new RegistCreateSendParam();
                registCreateSendParam.d = "TestDevice";
                Protocol.Send(RegistCreateModel.URL, registCreateSendParam, delegate(RegistCreateModel ret)
                    {
                        RecvResult(ret, ret.result);
                    }, string.Empty);
                break;
            }

            case PROGRESS.USER_INFO:
                Protocol.Send(OnceStatusInfoModel.URL, delegate(OnceStatusInfoModel ret)
                {
                    RecvResult(ret, ret.result);
                }, string.Empty);
                break;
            }
            m_isSending = true;
        }
    }