コード例 #1
0
        /// <summary>
        /// 发送参考线数据
        /// </summary>
        /// <param name="iShipID">船舶id.</param>
        /// <param name="oParam">数据</param>
        public void NetSubmitRefLine(int iShipID, RefLineData oParam)
        {
            CSubmitData oData = new CSubmitData();

            oData.iShipID = iShipID;
            oData.oParam  = oParam;
            Thread oThread = new Thread(SubmitRefLineThread);

            oThread.Start(oData);
        }
コード例 #2
0
        public void Request()
        {
            RefLineData oData     = this.m_Data.oParam as RefLineData;
            string      sPostData = "instanceid=" + NetManager.Instance.GetInstanceID().ToString() +
                                    "&shipid=" + this.m_Data.iShipID.ToString() +
                                    "&flag=" + oData.flag.ToString() +
                                    "&posX=" + oData.posX.ToString() +
                                    "&posY=" + oData.posY.ToString() +
                                    "&radius=" + oData.radius.ToString();
            var pointList = oData.points;

            sPostData += "&count=" + pointList.Count.ToString();
            if (pointList.Count != 0)
            {
                sPostData += "&points=";
                for (int i = 0; i < pointList.Count; i++)
                {
                    if (i != 0)
                    {
                        sPostData += ",";
                    }

                    sPostData += pointList [i].ToString();
                }
            }

            try
            {
                string sJasonData = HttpHelper.HttpPost(Constant.BaseUrl + this.url, sPostData);
                Console.WriteLine(sJasonData);
            }
            catch
            {
                Console.WriteLine("error: SubmitRefLineApi");
            }
        }