Пример #1
0
        /// <summary>
        /// 发送给本地账号服务器验证
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public IEnumerator send2LocalAccountServer(object value)
        {
            string wxCode = value as string;

            WWWForm dataForm = new WWWForm();

            dataForm.AddField("t", "weixin");
            dataForm.AddField("code", wxCode);
            dataForm.AddField("qid", SDKManager.Q_ID);
            dataForm.AddField("iid", StartUpScene._bindStrng);
            string devid = "";

            if (sdk.SDKManager.isAppStoreVersion())
            {
                devid = object_c.ObjectCCallback._IDFA;
            }
            else
            {
                JARUtilTools tools = Scene.GameSceneManager.uiCameraObj.GetComponent <JARUtilTools>();
                if (tools != null)
                {
                    devid = tools.GetIMEI(); //"fdsfd2";//
                    if (string.IsNullOrEmpty(devid))
                    {
                        devid = GameDataMgr.LOGIN_DATA.GetFastLoginUUID();
                    }
                }
            }
            dataForm.AddField("devid", devid);
            WWW www = new WWW(SDKManager.WxLoginUrl, dataForm);

            //string loginUrl = BetterString.Builder(SDKManager.LoginUrl, "?code=", wxCode, "&qid=", SDKManager.Q_ID.ToString());
            //WWW www = new WWW(loginUrl);

            yield return(www);

            if (www.isDone && string.IsNullOrEmpty(www.error))
            {
                // 解析账号服务器返回的结果
                bool bRlt = GameDataMgr.LOGIN_DATA.parseAccountReturn(www.text, true, false, true);
                if (bRlt)
                {
                    GameDataMgr.LOGIN_DATA.IsLoginSuccess = true;
                    // 验证成功直接连接游戏服务器
                    LoginInputController.ConnectToServer();
                }
            }
            else
            {
                //TODO: process login exception
            }
        }
Пример #2
0
    /*public JSONObject GetAllUserList()
     * {
     *
     * }*/

    /// <summary>
    /// 快速登陆
    /// </summary>
    /// <returns></returns>
    public IEnumerator registerToAccountServerFast()
    {
        /*string _uuid = GameDataMgr.LOGIN_DATA.GetFastLoginUUID();
         * WWWForm dataForm = new WWWForm();
         * string _code = _uuid + "," + GameDataMgr.LOGIN_DATA.GetFastLoginKey();
         * dataForm.AddField("type", "0");
         * dataForm.AddField("code", _code);
         * dataForm.AddField("t", "oauth");*/
        string       devid = "";
        JARUtilTools tools = GameSceneManager.uiCameraObj.GetComponent <JARUtilTools>();

        if (tools != null)
        {
            devid = tools.GetIMEI(); //"fdsfd2";//
        }
        if (string.IsNullOrEmpty(devid))
        {
            devid = GameDataMgr.LOGIN_DATA.GetFastLoginUUID();
        }


        //Post数据表
        WWWForm dataForm = new WWWForm();

        dataForm.AddField("type", "0");
        string code = GameDataMgr.LOGIN_DATA.GetFastLoginUUID() + "," + GameDataMgr.LOGIN_DATA.GetFastLoginKey();

        dataForm.AddField("code", code);
        dataForm.AddField("t", "oauth");

        dataForm.AddField("qid", SDKManager.Q_ID);
        dataForm.AddField("devid", devid);
        dataForm.AddField("simid", "");
        dataForm.AddField("logintype", ClientDefine.PLAT_FORM_TYPE);
        WWW w = new WWW(sdk.SDKManager.FastLoginURL, dataForm);

        yield return(w);

        if (string.IsNullOrEmpty(w.error))
        {
            if (w.isDone)
            {
                Debug.LogError(w.text);
                bool bRlt = GameDataMgr.LOGIN_DATA.parseAccountReturn(w.text, true);
                LogSys.LogWarning("----->a= print fast word ======" + bRlt);
                if (bRlt)
                {
//                    LogSys.LogWarning("-----> print fast word ======"+w.text);
                    GameDataMgr.LOGIN_DATA.SaveFastLoginInfo();
                    GameDataMgr.PLAYER_DATA.IsTouris = true;
                    if (!ClientNetwork.Instance.IsConnected())
                    {
                        ClientNetwork.Instance.Connect();
                    }
                }
                else
                {
                    UIManager.CreateWin(UIName.LOGIN_INPUT_WIN);
                    var versionUpdate = startUpMono.transform.Find("VersionUpdate").GetComponent <VersionUpdate>();
                    versionUpdate.ShowLoginBtn();
                }
            }
        }
        else
        {
            UtilTools.HideWaitWin();
            UtilTools.MessageDialog(w.error, okCallbackFunc: ReturnToLogin);
        }
    }
Пример #3
0
        IEnumerator AutologinAccountServer_WeiXin(string md5Content)
        {
            yield return(null);

            Utils.LogSys.Log("+++++++++++++++自动登录微信帐号++++++++++++++++++");
            WWWForm dataForm = new WWWForm();

            dataForm.AddField("code", md5Content);
            dataForm.AddField("qid", SDKManager.Q_ID);
            dataForm.AddField("iid", StartUpScene._bindStrng);
            string devid = "";

            if (sdk.SDKManager.isAppStoreVersion())
            {
                devid = object_c.ObjectCCallback._IDFA;
            }
            else
            {
                JARUtilTools tools = Scene.GameSceneManager.uiCameraObj.GetComponent <JARUtilTools>();
                if (tools != null)
                {
                    devid = tools.GetIMEI(); //"fdsfd2";//
                    if (string.IsNullOrEmpty(devid))
                    {
                        devid = GameDataMgr.LOGIN_DATA.GetFastLoginUUID();
                    }
                }
            }
            dataForm.AddField("devid", devid);

            WWW w = new WWW(SDKManager.AutoLoginUrl, dataForm);

            yield return(w);

            if (!string.IsNullOrEmpty(w.error))
            {
                yield return(new WaitForSeconds(1f));

                w = new WWW(SDKManager.AutoLoginUrl, dataForm);
                yield return(w);
            }

            if (!string.IsNullOrEmpty(w.error))
            {
                yield return(new WaitForSeconds(1f));

                w = new WWW(SDKManager.AutoLoginUrl, dataForm);
                yield return(w);
            }

            if (string.IsNullOrEmpty(w.error))
            {
                if (w.isDone)
                {
                    bool bRlt = GameDataMgr.LOGIN_DATA.parseAccountReturn(w.text, true, true, true);
                    if (bRlt)
                    {
                        UtilTools.HideWaitWin(WaitFlag.LoginWin);
                        //GameDataMgr.LOGIN_DATA.SavePhoneLoginInfo();
                        LoginInputController.ConnectToServer();
                    }
                    else
                    {
                        var versionUpdate = transform.Find("VersionUpdate").GetComponent <VersionUpdate>();
                        versionUpdate.ShowLoginBtn();
                        UtilTools.HideWaitWin(WaitFlag.LoginWin);
                        UIManager.CreateWin(UIName.LOGIN_INPUT_WIN);//如果登录帐号服务器失败, 显示登录界面
                    }
                }
            }
            else
            {
                var versionUpdate = transform.Find("VersionUpdate").GetComponent <VersionUpdate>();
                versionUpdate.ShowLoginBtn();
                UtilTools.HideWaitWin(WaitFlag.LoginWin);
                UIManager.CreateWin(UIName.LOGIN_INPUT_WIN);//如果登录帐号服务器失败, 显示登录界面
            }
        }