public async Task <Result> AddFriend(string username, string currentUserOnlineId, UserAuthenticationEntity userAuthenticationEntity, string region = "jp", string language = "ja")
        {
            var url    = string.Format(EndPoints.DenyAddFriend, region, currentUserOnlineId, username);
            var result = await _webManager.PutData(new Uri(url), null, userAuthenticationEntity, language);

            return(new Result(result.IsSuccess, string.Empty));
        }
        public async Task <Result> AddEvent(string id, string username, UserAuthenticationEntity userAuthenticationEntity, string region = "ja")
        {
            var url  = string.Format(EndPoints.AddRemoveEvent, region, id, username);
            var json = new StringContent("{\"autoBootPreference\":{\"autoBootFlag\":false,\"key\":\"\"}}", Encoding.UTF8, "application/json");

            return(await _webManager.PutData(new Uri(url), json, userAuthenticationEntity));
        }
        public async Task <Result> ClearMessages(string messageGroupId, List <float> messageUids, UserAuthenticationEntity userAuthenticationEntity, string region = "jp")
        {
            var url  = string.Format(EndPoints.ClearMessages, region, messageGroupId, string.Join(",", messageUids));
            var json = new StringContent("{\"seenFlag\":true}", Encoding.UTF8, "application/json");

            return(await _webManager.PutData(new Uri(url), json, userAuthenticationEntity));
        }
Esempio n. 4
0
        public async Task <bool> AddFriend(string username, UserAccountEntity userAccountEntity)
        {
            try
            {
                var user   = userAccountEntity.GetUserEntity();
                var url    = string.Format(EndPoints.DenyAddFriend, user.Region, user.OnlineId, username);
                var result = await _webManager.PutData(new Uri(url), null, userAccountEntity);

                return(result.IsSuccess);
            }
            catch (Exception ex)
            {
                throw new Exception("Error adding friend", ex);
            }
        }