/// <summary>
        /// Delete the map with the specified hash id
        /// </summary>
        /// <param name="mapHashId"></param>
        public void DeleteMap(string mapHashId)
        {
            var httpResponse = HttpRequestHelper.DeleteAsync(Endpoint + "/" + mapHashId, UserToken.Token).Result;
            var body         = HttpRequestHelper.GetContent(httpResponse).Result;
            var statusCode   = HttpRequestHelper.GetStatusCode(httpResponse);

            if (statusCode != HttpStatusCode.OK && statusCode != HttpStatusCode.NoContent)
            {
                throw new Exception(body);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Delete the game identified by the given hash id
        /// </summary>
        /// <param name="gameHashId"></param>
        public void DeleteGame(string gameHashId)
        {
            if (string.IsNullOrWhiteSpace(gameHashId))
            {
                return;
            }

            var httpResponse = HttpRequestHelper.DeleteAsync(Endpoint + "/one/" + gameHashId, UserToken.Token).Result;
            var body         = HttpRequestHelper.GetContent(httpResponse).Result;
            var statusCode   = HttpRequestHelper.GetStatusCode(httpResponse);

            if (statusCode != HttpStatusCode.OK && statusCode != HttpStatusCode.NoContent)
            {
                throw new Exception(body);
            }
        }
        /// <summary>
        /// Delete current user
        /// </summary>
        public void DeleteUser()
        {
            if (UserToken.Token == "")
            {
                return;
            }

            var httpResponse = HttpRequestHelper.DeleteAsync(Endpoint, UserToken.Token).Result;
            var body         = HttpRequestHelper.GetContent(httpResponse).Result;
            var statusCode   = HttpRequestHelper.GetStatusCode(httpResponse);

            if (statusCode != HttpStatusCode.OK && statusCode != HttpStatusCode.NoContent)
            {
                throw new Exception(body);
            }
        }