コード例 #1
0
        void GetKickoffPositionSuccess(object obj)
        {
            m2c_getkickoffposition msg = (m2c_getkickoffposition)obj;

            if (msg.teePosX < -10)
            {
                GameEntry.Event.Fire(this, new ShowMessageEventArgs("未获取到设备对应的击球点 将使用默认设置"));
            }
            else
            {
                GameEntry.GameData.teePosX = msg.teePosX;
            }

            NetFsnState++;
            NetFSN();
        }
コード例 #2
0
        public void MsgAnalysis(JsonData res, Action <object> action)
        {
            m2c_getkickoffposition m2c = new m2c_getkickoffposition();

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

            if (m2c.resultCode == "0")
            {
                m2c.teePosX = -100f;
                if (res["kickoffpositionmap"].Count != 0)
                {
                    m2c.teePosX = float.Parse(res["kickoffpositionmap"][0]["topxy"].ToString());
                }
            }
            if (action != null)
            {
                action(m2c);
            }
        }