Ejemplo n.º 1
0
        private const int MaxPosValue  = 1001000; //请求的参数最大值 超出这个数值属于伪造  x*1000+y的最大值

        internal async Task <BaseResponseData> GetLandCell(int[] pos, GetMapResult result)
        {
            if (pos.Length < 1)
            {
                result.Result = GameEnum.WsResult.ParamsError;
                return(result);
            }
            var mapCells = await GetLandCell(pos);

            if (mapCells == null)
            {
                return(result);
            }
            else
            {
                List <LoadBuildInfo> shopList = new List <LoadBuildInfo>();
                foreach (var m in mapCells)
                {
                    if (!string.IsNullOrEmpty(m.Value.BuildId))
                    {
                        var shopInfo = await BuildController.Instance.GetBuildInfo(m.Value.BuildId);

                        if (shopInfo != null)
                        {
                            shopList.Add(shopInfo);
                        }
                    }
                }
                result.LoadLandInfoDic = mapCells;
                result.LoadBuildInfo   = shopList;
            }
            return(result);
        }
Ejemplo n.º 2
0
        public async Task <GetMapResult> GetRoleLandShopInfo(Guid roleId)
        {
            GetMapResult result = new GetMapResult();

            result.LoadBuildInfo = await BuildController.Instance.GetBuildListByRoleIdAsync(roleId);

            result.LoadLandInfoDic = await GetLandListByRoleIdAsync(roleId);

            return(result);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 请求地图信息
        /// </summary>
        /// <param name="account"></param>
        /// <param name="role"></param>
        /// <param name="sid"></param>
        /// <param name="bytes">坐标数组</param>
        /// <returns></returns>
        private static async Task <BaseResponseData> GetMapCell()
        {
            GetMapResult result = new GetMapResult();

            if (User.bytes == null)
            {
                result.Result = GameEnum.WsResult.ParamsError;
                return(result);
            }
            var data = await InitHelpers.GetPse().DeserializeAsync <GetMapReq>(User.bytes);

            if (data == null)
            {
                result.Result = GameEnum.WsResult.ParamsError;
                return(result);
            }
            return(await LandController.Instance.GetLandCell(data.Pos, result));
        }