void GetGolfMachineSuccess(object obj)
        {
            m2c_getgolfmachine msg = (m2c_getgolfmachine)obj;

            if (msg.gmid != -100)
            {
                GetKickoffPosition(msg.gmid);
            }
            else
            {
                GameEntry.Event.Fire(this, new ShowMessageEventArgs("未获取到设备对应的击球点 将使用默认设置"));
                NetFsnState++;
                NetFSN();
            }
        }
示例#2
0
        public void MsgAnalysis(JsonData res, Action <object> action)
        {
            m2c_getgolfmachine m2c = new m2c_getgolfmachine();

            m2c.resultCode = res["respVo"]["resultCode"].ToString();
            m2c.resultDesc = res["respVo"]["resultDesc"].ToString();

            if (m2c.resultCode == "0")
            {
                if (res["golfmachinemap"].Count != 0)
                {
                    m2c.gmid     = int.Parse(res["golfmachinemap"][0]["id"].ToString());
                    m2c.callback = res["golfmachinemap"][0]["callback"].ToString();
                }
            }
            if (action != null)
            {
                action(m2c);
            }
        }
        void GetQRCodeUrlSuccess(object obj)
        {
            m2c_getgolfmachine msg = (m2c_getgolfmachine)obj;

            if (!string.IsNullOrEmpty(msg.callback))
            {
                MachineId = msg.gmid;
                QRUrl     = string.Format("https://open.weixin.qq.com/connect/qrconnect?appid=wxc2290f256563ff64&redirect_uri=http%3A%2F%2Fwww.golfgalaxytech.cn%3A8080%2Fwsx.tools%2F{0}&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect", msg.callback);
                Debug.Log("请求地址成功");
                NetFsnState++;
                NetFSN();
            }
            else
            {
                Debug.Log("fail");
                GameEntry.Event.Fire(this, new ShowMessageEventArgs("无法获取设备号对应二维码!"));
                //webView.gameObject.SetActive(false);
                browser.gameObject.SetActive(false);
                tips.SetActive(true);
                //NetFsnState = 0;
                //NetFSN();
            }
        }