Exemplo n.º 1
0
 private void LevelUpRewardsReceived(object sender, LevelUpRewardsResponse e)
 {
     if (e.Result == LevelUpRewardsResponse.Types.Result.Success && e.CalculateSize() > 0)
     {
         LevelUpRewards = new LevelUpRewards(new List <ItemAward>(e.ItemsAwarded), new List <ItemId>(e.ItemsUnlocked));
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Dunno if this works lol
        /// </summary>
        /// <param name="level"></param>
        /// <returns></returns>
        public async Task <LevelUpRewards> GetLevelUpRewards(int level)
        {
            var customRequest = new LevelUpRewards
            {
                Level = level
            };

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

            return
                (await
                 _httpClient.PostProtoPayload <Request, LevelUpRewards>($"https://{_apiUrl}/rpc",
                                                                        GetLvlUpRewards));
        }