示例#1
0
        public async Task <FortDetailResponse> GetFort(string fortId, double fortLat, double fortLng)
        {
            var customRequest = new Request.Types.FortDetailsRequest()
            {
                Id        = ByteString.CopyFromUtf8(fortId),
                Latitude  = Utils.FloatAsUlong(fortLat),
                Longitude = Utils.FloatAsUlong(fortLng),
            };

            var fortDetailRequest = RequestBuilder.GetRequest(_unknownAuth, _currentLat, _currentLng, 10,
                                                              new Request.Types.Requests()
            {
                Type    = (int)RequestType.FORT_DETAILS,
                Message = customRequest.ToByteString()
            });

            return(await _httpClient.PostProto <Request, FortDetailResponse>($"https://{_apiUrl}/rpc", fortDetailRequest));
        }
示例#2
0
        public static async Task <FortDetailsResponse> GetFort(HttpClient client, string _apiUrl, string fortId, double fortLat, double fortLng, Request.Types.UnknownAuth _unknownAuth, double _currentLat, double _currentLng)
        {
            var customRequest = new Request.Types.FortDetailsRequest
            {
                Id        = ByteString.CopyFromUtf8(fortId),
                Latitude  = Helpers.Extensions.FloatAsUlong(fortLat),
                Longitude = Helpers.Extensions.FloatAsUlong(fortLng)
            };

            var fortDetailRequest = RequestBuilder.GetRequest(_unknownAuth, _currentLat, _currentLng, 10,
                                                              new Request.Types.Requests
            {
                Type    = (int)RequestType.FORT_DETAILS,
                Message = customRequest.ToByteString()
            });

            return
                (await
                 client.PostProtoPayload <Request, FortDetailsResponse>($"https://{_apiUrl}/rpc",
                                                                        fortDetailRequest));
        }
示例#3
0
        public async Task<FortDetailsResponse> GetFort(string fortId, double fortLat, double fortLng)
        {
            var customRequest = new Request.Types.FortDetailsRequest
            {
                Id = ByteString.CopyFromUtf8(fortId),
                Latitude = Utils.FloatAsUlong(fortLat),
                Longitude = Utils.FloatAsUlong(fortLng)
            };

            var fortDetailRequest = RequestBuilder.GetRequest(_unknownAuth, CurrentLat, CurrentLng, CurrentAltitude,
                new Request.Types.Requests
                {
                    Type = (int)RequestType.FORT_DETAILS,
                    Message = customRequest.ToByteString()
                });
            return
                await
                    _httpClient.PostProtoPayload<Request, FortDetailsResponse>($"https://{_apiUrl}/rpc",
                        fortDetailRequest);
        }