diff --git a/Example/Program.cs b/Example/Program.cs index a16658b..da8f415 100644 --- a/Example/Program.cs +++ b/Example/Program.cs @@ -1,35 +1,25 @@ -using R6Sharp; -using R6Sharp.Endpoint; +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using R6Sharp; using R6Sharp.Response; using R6Sharp.Response.Static; -using R6Sharp.Response.Statistic; using System; -using System.Collections.Generic; using System.IO; using System.Text; using System.Text.Json; -using System.Text.Json.Serialization; +using System.Threading.Tasks; namespace Example { public static class Program { - internal class Credential + + public static void Main() { - [JsonPropertyName("email")] - public string Email { get; set; } + - [JsonPropertyName("password")] - public string Password { get; set; } - } + var api = new R6Api(new Auth ("email", "password", false)); - public static void Main() - { - Console.OutputEncoding = Encoding.UTF8; - // credentials.json = {"email": "email@email.com", "password": "somepassword"} - var json = File.ReadAllText(@"credentials.json"); - var credentials = JsonSerializer.Deserialize(json); - var api = new R6Api(credentials.Email, credentials.Password); var guids = new[] { @@ -41,28 +31,30 @@ public static void Main() }; #region Player Data - var username = "Pseudosin"; - var platform = Platform.Uplay; + var username = Guid.Parse("0a32319d-f7de-4ec1-a845-25ee53f978a7"); + IPlatform platform = Platform.UPLAY; var region = Region.EMEA; - Profile profile = api.Profile.GetProfileAsync(username, platform).Result; + IProfile profile = api.Profile.GetProfileAsync(username, platform).Result; + // var profile = api.GetProfileAsync(guids, platform).Result; Console.WriteLine($"Profile ID: {profile.UserId}"); - PlayerProgression progression = api.PlayerProgression.GetPlayerProgressionAsync(profile.ProfileId, platform).Result; + IPlayerProgression progression = api.PlayerProgression.GetPlayerProgressionAsync(profile.ProfileId, platform).Result; Console.WriteLine($"Level: {progression.Level}"); - Dictionary ranked = api.Player.GetRankedAsync(profile.ProfileId, platform, region).Result; - Console.WriteLine($"Ranked Rank: {ranked[progression.ProfileId.ToString()].Rank}"); - Dictionary casual = api.Player.GetCasualAsync(profile.ProfileId, platform, region).Result; - Console.WriteLine($"Casual Rank: {casual[progression.ProfileId.ToString()].Rank}"); + IBoardInfo ranked = api.Player.GetRankedAsync(profile.ProfileId, platform, region).Result; + Console.WriteLine($"Ranked Rank: {ranked.Rank}"); + + IBoardInfo casual = api.Player.GetCasualAsync(profile.ProfileId, platform, region).Result; + Console.WriteLine($"Casual Rank: {casual.Rank}"); - EquipmentStatistic equipments = api.Statistic.GetEquipmentStatistics(profile.ProfileId, Platform.Uplay).Result; - GamemodeStatistic gamemodes = api.Statistic.GetGamemodeStatistics(profile.ProfileId, Platform.Uplay).Result; - OperatorStatistic operators = api.Statistic.GetOperatorStatistics(profile.ProfileId, Platform.Uplay).Result; - QueueStatistic queues = api.Statistic.GetQueueStatistics(profile.ProfileId, Platform.Uplay).Result; - TerroristHuntMissionStatistic terroristhuntmissions = api.Statistic.GetTerroristHuntMissionsStatistics(profile.ProfileId, Platform.Uplay).Result; + IEquipmentStatistic equipments = api.Statistic.GetEquipmentStatistics(profile.ProfileId, platform).Result; + IGamemodeStatistic gamemodes = api.Statistic.GetGamemodeStatistics(profile.ProfileId, platform).Result; + IOperatorStatistic operators = api.Statistic.GetOperatorStatistics(profile.ProfileId, platform).Result; + IQueueStatistic queues = api.Statistic.GetQueueStatistics(profile.ProfileId, platform).Result; + ITerroristHuntMissionStatistic terroristhuntmissions = api.Statistic.GetTerroristHuntMissionsStatistics(profile.ProfileId, platform).Result; #endregion #region Static Data @@ -73,8 +65,8 @@ public static void Main() // Season season = Season.GetSeasonAsync().Result; Console.WriteLine($"Current Season: {season.Id}"); - Dictionary locales = api.Static.GetLocaleAsync(Language.BritishEnglish).Result; - List seasonDetails = api.Static.GetSeasonDetailsAsync().Result; + var locales = api.Static.GetLocaleAsync(LanguageEndPoint.BritishEnglish).Result; + var seasonDetails = api.Static.GetSeasonDetailsAsync().Result; var seasonId = 18; // Find season details for season 18 @@ -87,5 +79,6 @@ public static void Main() Console.WriteLine($"Highest Rank URL: {highestSeasonRank.Images.Hd}"); #endregion } + } } \ No newline at end of file diff --git a/R6DataAccess/Builder/BuildHelper/BuildHelper.cs b/R6DataAccess/Builder/BuildHelper/BuildHelper.cs new file mode 100644 index 0000000..8ab6e07 --- /dev/null +++ b/R6DataAccess/Builder/BuildHelper/BuildHelper.cs @@ -0,0 +1,138 @@ +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using R6Sharp; +using R6Sharp.Models; +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccess.Builder.BuildHelper +{ + public class BuildHelper + { + + // may need to be broken down into seperate methods overloaded + + + + public static IQuery BuildProfileQuery(string player, IPlatform platform) + { + IQuery query = Factory.GetQueryBuilder() + .NameOnPlatform(player) + .PlatformType(platform) + .Build() + ; + + return query; + } + + + public static IQuery BuildProfileQuery(string[] player, IPlatform platform) + { + IQuery query = Factory.GetQueryBuilder() + .NameOnPlatform(player) + .PlatformType(platform) + .Build() + ; + + return query; + } + + public static IQuery BuildProfileQuery(Guid uuid, IPlatform platform) + { + IQuery query = Factory.GetQueryBuilder() + .IdOnPlatform(uuid) + .PlatformType(platform) + .Build() + ; + + return query; + } + public static IQuery BuildProfileQuery(Guid[] uuid, IPlatform platform) + { + IQuery query = Factory.GetQueryBuilder() + .IdOnPlatform(uuid) + .PlatformType(platform) + .Build() + ; + + return query; + } + + public static IQuery BuildPlayerProgressQuery(Guid[] uuid, IPlatform platform) + { + IQuery query = Factory.GetQueryBuilder() + .ProfileId(uuid) + .PlatformType(platform) + .Build() + ; + + return query; + } + + + public static IQuery BuildPlayerProgressQuery(Guid uuid, IPlatform platform) + { + IQuery query = Factory.GetQueryBuilder() + .ProfileId(uuid) + .PlatformType(platform) + .Build() + ; + + return query; + } + + public static IQuery BuildPlayersQuery(Guid[] uuids, IPlatform platform, IRegion region, string boardId, string season= null) + { + IQuery query = Factory.GetQueryBuilder() + .ProfileId(uuids) + .BoardId(boardId) + .Region(region) + .SeasonId(season) + .PlatformType(platform) + .Build() + ; + + return query; + } + public static IQuery BuildPlayersQuery(Guid uuids, IPlatform platform, IRegion region, string boardId, string season = null) + { + IQuery query = Factory.GetQueryBuilder() + .ProfileId(uuids) + .BoardId(boardId) + .Region(region) + .SeasonId(season) + .PlatformType(platform) + .Build() + ; + + return query; + } + + + public static IQuery BuildStatisticQuery(Guid uuids, IPlatform platform, string statistics) + { + IQuery query = Factory.GetQueryBuilder() + .PlatformType(platform) + .Population(uuids) + .Statistics(statistics) + .Build(); + + + return query; + } + public static IQuery BuildStatisticQuery(Guid[] uuids, IPlatform platform, string statistics) + { + IQuery query = Factory.GetQueryBuilder() + .PlatformType(platform) + .Population(uuids) + .Statistics(statistics) + .Build(); + + + return query; + } + + + } +} diff --git a/R6DataAccess/Builder/BuildHelper/QueryHelper.cs b/R6DataAccess/Builder/BuildHelper/QueryHelper.cs new file mode 100644 index 0000000..a4e3b5a --- /dev/null +++ b/R6DataAccess/Builder/BuildHelper/QueryHelper.cs @@ -0,0 +1,140 @@ +using R6Sharp.Models; +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.Text.Json.Serialization; +using R6DataAccess.Interfaces; +using R6DataAccess.Models; + +namespace R6DataAccess.Builder.BuildHelper +{ + public static class QueryHelper + { + + private static IQuery _query; + private static IEndPoints _endPoints; + + // this could go into queryBuilder + public static string GetQueryString(IQuery query, IEndPoints endPoints) + { + + _query = query; + _endPoints = endPoints; + + + + var queryString = ""; + + foreach(var property in query.GetType().GetProperties()) + { + + var propValue = property.GetValue(query); + + + + + if (propValue != null) + { + var type = property.PropertyType; + + + + + + var propertyName = GetJsonPropertyValue(property); + var propertyValue = GetPropertyValue(type, propValue); + + if (propertyValue != null) + { + + queryString += $"{propertyName}={propertyValue}&"; + } + + + } + + } + + + return cleanUpQueryString(queryString); + } + + + + // as properties get bigger made this method to remove last char as supposed to + private static string cleanUpQueryString(string query) + { + + var lengthOfQuery = query.Length; + + var lastIndex = lengthOfQuery - 1; + + char lastCharInQuery = query[lastIndex]; + + if (lastCharInQuery.Equals('&')) + { + return query.Remove(lastIndex); + } + + + + + return query; + } + + + + + private static string GetJsonPropertyValue(PropertyInfo property) + { + + var jsonPropertyArray = property.GetCustomAttributes(typeof(JsonPropertyNameAttribute), true); + + //get first array + var firstAttributes = (JsonPropertyNameAttribute)jsonPropertyArray[0]; + + return firstAttributes.Name; + } + + private static string GetPropertyValue(Type type, object propertyValue) + { + string propStringValue; + // would need refactoring if there are any other way + + /// would need to change it so object are casted at run time + /// should be able to rewrite later on + /// + if (type == typeof(IPlatform)) + { + //endpoint doesnt need the platform values + + if (!_endPoints.Name.Equals(EndPoints.Statistics.Name)) + { + var platform = (IPlatform)propertyValue; + + propStringValue = platform.Name; + } + else + { + + return null; + } + } + else if (type == typeof(IRegion)) + { + var platform = (IRegion)propertyValue; + + propStringValue = platform.Name; + } + else + { + + propStringValue = propertyValue.ToString(); + } + + + return propStringValue; + } + } +} diff --git a/R6DataAccess/Builder/QueryBuilder.cs b/R6DataAccess/Builder/QueryBuilder.cs new file mode 100644 index 0000000..3ca9dc7 --- /dev/null +++ b/R6DataAccess/Builder/QueryBuilder.cs @@ -0,0 +1,163 @@ +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using R6Sharp; +using R6Sharp.Models; +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccess.Builder +{ + public sealed class QueryBuilder : IQueryBuilder + { + private string _nameOnPlatform { get; set; } + private IPlatform _platformType { get; set; } + + private string _idOnPlatform { get; set; } + + private string _profileId { get; set; } + + private string _boardId { get; set; } + + private IRegion _region { get; set; } + + private string _seasonId { get; set; } + + + private string _population { get; set; } + + private string _statistics { get; set; } + + + + + + public QueryBuilder NameOnPlatform(string player) + { + _nameOnPlatform = player; + + return this; + } + + public QueryBuilder NameOnPlatform(string[] players) + { + if(players != null) + _nameOnPlatform = string.Join(',', players); + + return this; + } + + public QueryBuilder PlatformType(IPlatform platform) + { + _platformType = platform; + + return this; + } + + public QueryBuilder ProfileId(Guid guid) + { + if (guid != Guid.Empty) + _profileId = guid.ToString(); + + return this; + } + + public IQuery Build() + { + + var query = Factory.GetQuery(); + + query.NameOnPlatform = _nameOnPlatform; + + query.PlatformType = _platformType; + + query.IdOnPlatform = _idOnPlatform; + + query.ProfileId = _profileId; + + query.BoardId = _boardId; + + query.Region = _region; + + query.SeasonId = _seasonId; + + query.Population = _population; + + query.Statistics = _statistics; + + return query; + + } + + public QueryBuilder IdOnPlatform(Guid uuid) + { + if (uuid != Guid.Empty) + _idOnPlatform = uuid.ToString(); + + return this; + } + + public QueryBuilder IdOnPlatform(Guid[] uuid) + { + if (uuid != null) + _idOnPlatform = string.Join(',', uuid); + + return this; + } + + public QueryBuilder ProfileId(Guid[] guid) + { + if (guid != null) + _profileId = string.Join(',', guid); + + return this; + } + + public QueryBuilder BoardId(string id) + { + _boardId = id; + return this; + } + + public QueryBuilder Region(IRegion region) + { + _region = region; + + return this; + } + + public QueryBuilder SeasonId(string id) + { + _seasonId = id; + + return this; + } + + public QueryBuilder Population(Guid[] population) + { + _population = string.Join(',', population); + + return this; + } + + public QueryBuilder Statistics(string statistics) + { + _statistics = statistics; + return this; + } + + public QueryBuilder Population(Guid population) + { + _population = population.ToString(); + + return this; + } + + public QueryBuilder Statistics(string[] statistics) + { + _statistics = string.Join(',', statistics); + + return this; + } + } +} diff --git a/R6DataAccess/Converter/ParseStringToInt.cs b/R6DataAccess/Converter/ParseStringToInt.cs new file mode 100644 index 0000000..a194510 --- /dev/null +++ b/R6DataAccess/Converter/ParseStringToInt.cs @@ -0,0 +1,43 @@ +using System; +using System.Buffers; +using System.Buffers.Text; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace R6DataAccess.Converter +{ + + /// + /// Parses string to int from JSON strings. + /// + /// Solution by VahidN/Stack Overflow: https://stackoverflow.com/a/59322077/4339019 + public class ParseStringToInt : JsonConverter + { + public override int Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.String) + { + ReadOnlySpan span = reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan; + if (Utf8Parser.TryParse(span, out int number, out int bytesConsumed) && span.Length == bytesConsumed) + { + return number; + } + + if (int.TryParse(reader.GetString(), out number)) + { + return number; + } + } + + return reader.GetInt32(); + } + + public override void Write(Utf8JsonWriter writer, int value, JsonSerializerOptions options) + { + writer.WriteStringValue(value.ToString()); + } + } + +} diff --git a/R6DataAccess/Converter/ParseStringToRankId.cs b/R6DataAccess/Converter/ParseStringToRankId.cs new file mode 100644 index 0000000..10f60e2 --- /dev/null +++ b/R6DataAccess/Converter/ParseStringToRankId.cs @@ -0,0 +1,33 @@ +using R6Sharp.Response.Static; +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace R6DataAccess.Converter +{ + public class ParseStringToRankId : JsonConverter + { + + public override RankId Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.String) + { + if (Enum.TryParse(reader.GetString(), true, out RankId id)) + { + return id; + } + } + + return Enum.Parse(reader.GetString()); + } + + public override void Write(Utf8JsonWriter writer, RankId value, JsonSerializerOptions options) + { + writer.WriteStringValue(value.ToString()); + } + + + } +} diff --git a/R6DataAccess/DataFactory/EndPointFactory.cs b/R6DataAccess/DataFactory/EndPointFactory.cs new file mode 100644 index 0000000..4f0459e --- /dev/null +++ b/R6DataAccess/DataFactory/EndPointFactory.cs @@ -0,0 +1,48 @@ +using R6DataAccess.Endpoint; +using R6DataAccess.Endpoint.PlayerEndPoint; +using R6DataAccess.Endpoint.StatisticEndPoint; +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using R6Sharp.Endpoint; +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccess.DataFactory +{ + public static class EndPointFactory + { + public static ISessionEndpoint GetSessionEndpoint(IAuth auth) + { + + return new SessionEndpoint(auth); + } + + + public static IProfileEndpoint GetProfileEndpoint(ISessionEndpoint session) + { + return new ProfileEndpoint(session); + } + + public static IPlayerProgressionEndpoint GetPlayerProgressionEndpoint(ISessionEndpoint session) + { + return new PlayerProgressionEndpoint(session); + } + + public static IPlayerEndpoint GetPlayerEndpoint(ISessionEndpoint session) + { + return new PlayerEndpoint(session); + } + + public static IStatisticEndpoint GetStatisticEndpoint(ISessionEndpoint session) + { + return new StatisticEndpoint(session); + } + + public static IStaticEndpoint GetStaticEndpoint(ISessionEndpoint session) + { + return new StaticEndpoint(session); + } + + } +} diff --git a/R6DataAccess/DataFactory/Factory.cs b/R6DataAccess/DataFactory/Factory.cs new file mode 100644 index 0000000..0bda835 --- /dev/null +++ b/R6DataAccess/DataFactory/Factory.cs @@ -0,0 +1,58 @@ +using R6DataAccess.Builder; +using R6DataAccess.Models; +using R6Sharp.Endpoint; +using R6Sharp.Models; +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Text; + +namespace R6Sharp +{ + public static class Factory + { + + public static HttpClient GetHttpclient() + { + var client = new HttpClient(); + + Guid Rainbow6S = Guid.Parse("39baebad-39e5-4552-8c25-2c9b919064e2"); + + + client.DefaultRequestHeaders.Add("Ubi-AppId",Rainbow6S.ToString()); + + + return client; + } + + + public static IQuery GetQuery() + { + return new Query(); + } + + public static IQueryBuilder GetQueryBuilder() + { + return new QueryBuilder(); + } + + public static IRequest GetRequest(IEndPoints endPoint, IQuery query) + { + + return new Request(endPoint, query); + } + + + public static IRequest GetRequest(IEndPoints endPoint, ILanguage language) + { + + return new Request(endPoint, language); + } + + public static IRequest GetRequest(IEndPoints endPoint) + { + + return new Request(endPoint); + } + } +} diff --git a/R6DataAccess/Endpoint/LanguageEndPoint/LanguageEndPoint.cs b/R6DataAccess/Endpoint/LanguageEndPoint/LanguageEndPoint.cs new file mode 100644 index 0000000..1d1ec6c --- /dev/null +++ b/R6DataAccess/Endpoint/LanguageEndPoint/LanguageEndPoint.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace R6DataAccess.Models +{ + public class LanguageEndPoint:ILanguageEndPoint + { + + public static ILanguage AmericanEnglish => + new Language { ShortHand = "en-us", LocalHash = "6eb4f5cd" }; + public static ILanguage AustralianEnglish => + new Language { ShortHand = "en-us", LocalHash = "b505a609" }; + public static ILanguage BrazilianPortuguese => + new Language { ShortHand = "pt-br", LocalHash = "7ad95128" }; + public static ILanguage BritishEnglish => + new Language { ShortHand = "en-us", LocalHash = "b505a609" }; + public static ILanguage CanadianFrench => + new Language { ShortHand = "fr-fr", LocalHash = "657de10f" }; + public static ILanguage Czech => + new Language { ShortHand = "cs-cz", LocalHash = "dc66e300" }; + public static ILanguage Dutch => + new Language { ShortHand = "nl-nl", LocalHash = "80a0b37a" }; + public static ILanguage EuropeanFrench => + new Language { ShortHand = "fr-fr", LocalHash = "4f78c986" }; + public static ILanguage EuropeanSpanish => + new Language { ShortHand = "es-es", LocalHash = "5e27d9fa" }; + public static ILanguage German => + new Language { ShortHand = "de-de", LocalHash = "47a861dd" }; + public static ILanguage Italian => + new Language { ShortHand = "it-it", LocalHash = "4ac66a00" }; + public static ILanguage Japanese => + new Language { ShortHand = "ja-jp", LocalHash = "30330c03" }; + public static ILanguage Korean => + new Language { ShortHand = "ko-kr", LocalHash = "31170d10" }; + public static ILanguage LatinSpanish => + new Language { ShortHand = "es-mx", LocalHash = "979289ed" }; + public static ILanguage NordicEnglish => + new Language { ShortHand = "en-us", LocalHash = "b505a609" }; + public static ILanguage Polish => + new Language { ShortHand = "pl-pl", LocalHash = "845c3d39" }; + public static ILanguage Russian => + new Language { ShortHand = "ru-ru", LocalHash = "22e559b7" }; + public static ILanguage SimplifiedChinese => + new Language { ShortHand = "zh-cn", LocalHash = "23f064e8" }; + public static ILanguage TraditionalChinese => + new Language { ShortHand = "zh-tw", LocalHash = "52f0c5ec" }; + + } +} diff --git a/R6DataAccess/Endpoint/PlayerEndPoint/PlayerEndpoint.cs b/R6DataAccess/Endpoint/PlayerEndPoint/PlayerEndpoint.cs new file mode 100644 index 0000000..562ab25 --- /dev/null +++ b/R6DataAccess/Endpoint/PlayerEndPoint/PlayerEndpoint.cs @@ -0,0 +1,105 @@ +using R6DataAccess.Builder.BuildHelper; +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using R6Sharp; +using R6Sharp.Endpoint; +using R6Sharp.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; +using static R6DataAccess.Models.PlayerProgression; + +namespace R6DataAccess.Endpoint.PlayerEndPoint +{ + public class PlayerEndpoint : IPlayerEndpoint + { + + private readonly ISessionEndpoint _sessionHandler; + + public PlayerEndpoint(ISessionEndpoint sessionHandler) + { + _sessionHandler = sessionHandler; + } + + public async Task> GetCasualAsync(Guid[] uuids, IPlatform platform, IRegion region, int season = -1) + { + IQuery query = BuildHelper.BuildPlayersQuery + (uuids,platform,region,"pvp_casual", season.ToString()); + + + var data = await requestData(query); + + + return data.Players; + } + + + + public async Task GetCasualAsync(Guid uuid, IPlatform platform, IRegion region, int season = -1) + { + IQuery query = BuildHelper.BuildPlayersQuery + (uuid, platform, region, "pvp_casual", season.ToString()); + + + var data = await requestData(query); + + + return data.Players.FirstOrDefault().Value; + } + + + + + public async Task> GetRankedAsync(Guid[] uuids, IPlatform platform, IRegion region, int season = -1) + { + IQuery query = BuildHelper.BuildPlayersQuery + (uuids, platform, region, "pvp_ranked", season.ToString()); + + + + var data = await requestData(query); + + + return data.Players; + } + + + + public async Task GetRankedAsync(Guid uuid, IPlatform platform, IRegion region, int season = -1) + { + IQuery query = BuildHelper.BuildPlayersQuery + (uuid, platform, region, "pvp_ranked", season.ToString()); + + + + var data = await requestData(query); + + + return data.Players.FirstOrDefault().Value; + } + + + + + + + + + + // can go into single helper or something + private async Task requestData(IQuery query) + + { + // build a request + IRequest request = Factory.GetRequest(EndPoints.Players, query); + + var result = await _sessionHandler.GetDataAsync(request); + + return JsonSerializer.Deserialize(result); + + } + } +} diff --git a/R6DataAccess/Endpoint/PlayerProgressionEndPoint/PlayerProgressionEndpoint.cs b/R6DataAccess/Endpoint/PlayerProgressionEndPoint/PlayerProgressionEndpoint.cs new file mode 100644 index 0000000..cf0014f --- /dev/null +++ b/R6DataAccess/Endpoint/PlayerProgressionEndPoint/PlayerProgressionEndpoint.cs @@ -0,0 +1,71 @@ + +using R6DataAccess.Builder.BuildHelper; +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using R6Sharp; +using R6Sharp.Endpoint; +using R6Sharp.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Threading.Tasks; +using static R6DataAccess.Models.PlayerProgression; + +namespace R6DataAccess.Endpoint +{ + public class PlayerProgressionEndpoint : IPlayerProgressionEndpoint + { + + private readonly ISessionEndpoint _sessionHandler; + + public PlayerProgressionEndpoint(ISessionEndpoint sessionHandler) + { + _sessionHandler = sessionHandler; + } + + + public async Task GetPlayerProgressionAsync(Guid uuid, IPlatform platform) + { + + IQuery query = BuildHelper.BuildPlayerProgressQuery(uuid, platform); + + + var data = await requestData(query); + + + return data.PlayerProgressions.FirstOrDefault(); + + + } + + public async Task> GetPlayerProgressionAsync(Guid[] uuid, IPlatform platform) + { + + IQuery query = BuildHelper.BuildPlayerProgressQuery(uuid, platform); + + + var data = await requestData(query); + + + return data.PlayerProgressions.Cast().ToList(); + + + } + + + + // can go into single helper or something + private async Task requestData(IQuery query) + + { + // build a request + IRequest request = Factory.GetRequest(EndPoints.Progressions, query); + + var result = await _sessionHandler.GetDataAsync(request); + + return JsonSerializer.Deserialize(result); + + } + } +} diff --git a/R6DataAccess/Endpoint/ProfileEndPoint/ProfileEndpoint.cs b/R6DataAccess/Endpoint/ProfileEndPoint/ProfileEndpoint.cs new file mode 100644 index 0000000..586657a --- /dev/null +++ b/R6DataAccess/Endpoint/ProfileEndPoint/ProfileEndpoint.cs @@ -0,0 +1,110 @@ +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using R6Sharp.Models; +using R6Sharp.Response; +using System.Text.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using R6DataAccess.Builder.BuildHelper; + +namespace R6Sharp.Endpoint +{ + public class ProfileEndpoint : IProfileEndpoint + { + private readonly ISessionEndpoint _sessionHandler; + + + + + + public ProfileEndpoint(ISessionEndpoint sessionHandler) + { + _sessionHandler = sessionHandler; + } + + /// + /// Search for a player on Rainbow 6 Siege. + /// + /// + /// The player names to search for. + /// + /// + /// The platform the player is on.d + /// + /// + /// A list of players that matched the terms. + /// + + + /// + public async Task GetProfileAsync(string player, IPlatform platform) + { + + + //var ProfileUrlEndPoint = Endpoints.Search; + + IQuery query = BuildHelper.BuildProfileQuery(player, platform); + + var data = await requestData(query); + + // the search result could contain more than one result, return first anyways + return data.Profiles.FirstOrDefault(); + } + + + public async Task> GetProfileAsync(string[] players, IPlatform platform) + { + + IQuery query = BuildHelper.BuildProfileQuery(players, platform); + + var data = await requestData(query); + + return data.Profiles.Cast().ToList(); + } + + + + + public async Task GetProfileAsync(Guid uuid, IPlatform platform) + { + + IQuery query = BuildHelper.BuildProfileQuery(uuid,platform); + + + var data = await requestData(query); + + return data.Profiles.FirstOrDefault(); + } + + public async Task> GetProfileAsync(Guid[] uuids, IPlatform platform) + { + + IQuery query = BuildHelper.BuildProfileQuery(uuids, platform); + + + var data = await requestData(query); + + return data.Profiles.Cast().ToList(); + } + + + + // can go into single helper or something + private async Task requestData(IQuery query) + + { + // build a request + IRequest request = Factory.GetRequest(EndPoints.Search, query); + + var result = await _sessionHandler.GetDataAsync(request); + + return JsonSerializer.Deserialize(result); + + } + + + + } +} diff --git a/R6DataAccess/Endpoint/SessionEndPoint/SessionEndpoint.cs b/R6DataAccess/Endpoint/SessionEndPoint/SessionEndpoint.cs new file mode 100644 index 0000000..9981336 --- /dev/null +++ b/R6DataAccess/Endpoint/SessionEndPoint/SessionEndpoint.cs @@ -0,0 +1,251 @@ + +using R6DataAccess; +using R6DataAccess.Builder; +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using R6Sharp.Models; +using R6Sharp.Response; +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Net.Mime; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; + +namespace R6Sharp.Endpoint +{ + public class SessionEndpoint : ISessionEndpoint + { + /// + /// Credential in base64 acquired from constructor. + /// + private readonly string _credentialsb64; + private string _sessionFileName = "session.json"; + + /// + /// Current session details with Ubisoft. + /// + private ISession _currentSession; + + private ISession _savedSession; + + private HttpClient _httpclient = Factory.GetHttpclient(); + + /// + /// Control if Ubisoft's session handler should remember current session. + /// + private bool RememberMe { get; set; } + + public SessionEndpoint(IAuth auth) + { + + _credentialsb64 = auth.GetCredentialBase64(); + } + + + // only needed if needed to access endpointwithout ticket/authentication + public SessionEndpoint() + { + + + + } + + + private async Task GetTicketAsync() + { + + + + // If Session exists in memory, check if it has expired + + if(!IsTicketInMemoryValid()) + { + // check if json one is valid + if (IsTicketInJsonValid()) + { + //used the saved session + _currentSession = _savedSession; + + return _currentSession.Ticket; + } + + + return await GenerateNewKeyToken(); + + } + + return _currentSession.Ticket; + } + + private bool IsTicketInMemoryValid() + { + if (_currentSession != null) + { + var now = DateTime.UtcNow; + //expired + if (now >= _currentSession.Expiration) + { + return false; + } + + return true; + } + + return false; + } + + private bool IsTicketInJsonValid() + { + + _savedSession = GetSavedSession(); + + if(_savedSession != null && DateTime.UtcNow < _savedSession.Expiration) + { + + return true; + } + + return false; + + } + + private ISession GetSavedSession() + { + + try + { + var json = File.ReadAllText(_sessionFileName); + + + + return JsonSerializer.Deserialize(json); + + + } + catch (FileNotFoundException ) + + { + // Session file was not found or it was malformed/invalid + return null; + } + } + + + private void UpdateSessionJson() + { + // Save new session to file + var serialisedSession = JsonSerializer.Serialize(_currentSession); + + File.WriteAllText(_sessionFileName, serialisedSession); + } + + private async Task GenerateNewKeyToken() + { + // Refresh current session details (will get new session if expired or non-existent) + _currentSession = await GetSessionAsync(); + + return _currentSession.Ticket; + } + + + // need to write check to see if there arent too many request coming through + private async Task GetSessionAsync() + { + + + var data = new StringContent($"{{\"rememberMe\": {(RememberMe ? "true" : "false")}}}"); + + + var response = await HttpPostAsync(data); + + CheckHttpResponseIsValid(response); + + return JsonSerializer.Deserialize(response); + } + + + private void CheckHttpResponseIsValid(string data) + { + var HttpMessage = JsonSerializer.Deserialize(data); + + if(HttpMessage != null) + { + if(HttpMessage.HttpCode > 400) + { + throw new HttpToManyRequestException(HttpMessage.Message); + } + } + + } + // this could probably go and stick with httpclientrequest + public async Task GetDataAsync(IRequest request) + { + await SetTicketHeader(); + + return await HttpclientRequestAsync(request); + + } + + public async Task GetDataNoTicketRequiredAsync(IRequest request) + { + + return await HttpclientRequestAsync(request); + + } + + + private async Task HttpPostAsync(HttpContent content) + { + content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + + // just in case the method gets reused + setAuthorizationHeader(new AuthenticationHeaderValue("Basic", _credentialsb64)); + + //$"Basic {_credentialsb64}") + + var response = await _httpclient.PostAsync(EndPoints.Sessions.Url, content); + + //response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + return await response.Content.ReadAsStringAsync(); + } + + private async Task SetTicketHeader() + { + var ticket = await GetTicketAsync(); + + + setAuthorizationHeader(new AuthenticationHeaderValue("Ubi_v1", $"t={ticket}")); + //$"Ubi_v1 t={ticket}" + + + } + + + private async Task HttpclientRequestAsync(IRequest request) + { + + + + var response = await _httpclient.GetAsync(request.URL); + + return await response.Content.ReadAsStringAsync(); + + } + + + private void setAuthorizationHeader(AuthenticationHeaderValue header) + { + // currently have it in another method in case for future validation is required + _httpclient.DefaultRequestHeaders.Authorization = header; + + } + + + + } +} diff --git a/R6DataAccess/Endpoint/StaticEndPoint/StaticEndpoint.cs b/R6DataAccess/Endpoint/StaticEndPoint/StaticEndpoint.cs new file mode 100644 index 0000000..8d01574 --- /dev/null +++ b/R6DataAccess/Endpoint/StaticEndPoint/StaticEndpoint.cs @@ -0,0 +1,141 @@ +using R6DataAccess.Models; +using R6Sharp.Response.Static; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text.Json; +using System.Threading.Tasks; + +namespace R6Sharp.Endpoint +{ + + + public class StaticEndpoint : IStaticEndpoint + { + + private ISessionEndpoint _sessionEndpoint; + + public StaticEndpoint(ISessionEndpoint sessionEndpoint) + { + _sessionEndpoint = sessionEndpoint; + } + + /// + /// Get locale dictionary based on requested language. + /// + /// + /// Dictionary with list of items (oasisId and value) that contains localization items. + /// + public async Task> GetLocaleAsync(ILanguage language) + { + + + + IRequest request = Factory.GetRequest(EndPoints.Locales, language); + + + var results = await _sessionEndpoint.GetDataNoTicketRequiredAsync(request); + + + return translationAvaliable(results); + } + + + private Dictionary translationAvaliable(string results) + { + try + { + var Deserialize = JsonSerializer.Deserialize>(results); + + return Deserialize; + } + catch(JsonException) + { + // no translation UbiSoft returned 404 + } + + return null; + } + + /// + /// Get overall seasons data (season 2 and onwards). + /// + /// + /// List of seasons with their respective details like ranks and divisions. + /// + public async Task> GetSeasonDetailsAsync() + { + + IRequest request = Factory.GetRequest(EndPoints.Ranks); + + // Fetch ranked static data + var fetch = await _sessionEndpoint.GetDataNoTicketRequiredAsync(request); + + + var deserialized = JsonSerializer.Deserialize(fetch); + // Prefix R6 base URL to the images URL so it is ready to use as it is + + return deserialized.Seasons; + } + + /// + /// Get information based on past and current seasons. + /// + /// + /// Latest season and dictionary of seasons with their respective names and URL to season background. + /// + public async Task GetSeasonsInfoAsync() + { + + IRequest request = Factory.GetRequest(EndPoints.Seasons); + + var results = await _sessionEndpoint.GetDataNoTicketRequiredAsync(request); + + return JsonSerializer.Deserialize(results); + } + + /// + /// Get information specific to a season. + /// + /// + /// The season number, such as 18 for Steel Wave, or -1 for latest. + /// + /// + /// Season details. + /// + public async Task GetSeasonAsync(int id) + { + var info = await GetSeasonsInfoAsync().ConfigureAwait(false); + + + + + if(!isValidSeason(id, info)) + { + id = info.LatestSeason; + } + + var season = info.Seasons[id.ToString()]; + + season.Id = id; + + return season; + } + + private bool isValidSeason(int id , SeasonsInfo seasonsInfo) + { + + // not safe if the dictonary gets added or removed as dictnary is not sorted + var currentSeason = int.Parse(seasonsInfo.Seasons.Keys.Last()); + + + return true ? id < currentSeason && id > 0 : false; + } + + /// + public async Task GetCurrentSeasonAsync() + { + return await GetSeasonAsync(-1).ConfigureAwait(false); + } + } +} diff --git a/R6DataAccess/Endpoint/StatisticEndPoint/StatisticEndpoint.cs b/R6DataAccess/Endpoint/StatisticEndPoint/StatisticEndpoint.cs new file mode 100644 index 0000000..c97c290 --- /dev/null +++ b/R6DataAccess/Endpoint/StatisticEndPoint/StatisticEndpoint.cs @@ -0,0 +1,169 @@ +using R6DataAccess.Builder.BuildHelper; +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using R6DataAccess.Models.Static; +using R6DataAccess.Models.Static.StatisticStatics; +using R6Sharp; +using R6Sharp.Endpoint; +using R6Sharp.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; + +namespace R6DataAccess.Endpoint.StatisticEndPoint +{ + public class StatisticEndpoint: IStatisticEndpoint + { + private readonly ISessionEndpoint _sessionHandler; + + public StatisticEndpoint(ISessionEndpoint sessionHandler) + { + _sessionHandler = sessionHandler; + } + + + public async Task> GetEquipmentStatistics(Guid[] uuids, IPlatform platform) + { + + IQuery query = BuildHelper.BuildStatisticQuery(uuids, platform, EquipmentStatisticStatics.GetStatistic()); + + var data = await requestData(query); + + var deserialised = JsonSerializer.Deserialize(data); + + return deserialised.EquipmentStatistics; + } + + public async Task GetEquipmentStatistics(Guid uuids, IPlatform platform) + { + + IQuery query = BuildHelper.BuildStatisticQuery(uuids, platform, EquipmentStatisticStatics.GetStatistic()); + + + var data = await requestData(query); + + var deserialised = JsonSerializer.Deserialize(data); + + return deserialised.EquipmentStatistics.FirstOrDefault().Value; + } + + + + public async Task> GetGamemodeStatistics(Guid[] uuids, IPlatform platform) + { + IQuery query = BuildHelper.BuildStatisticQuery(uuids, platform, GamemodeStatisticStatics.GetStatistic()); + + var data = await requestData(query); + + var deserialised = JsonSerializer.Deserialize(data); + + return deserialised.GamemodeStatistics; + } + + public async Task GetGamemodeStatistics(Guid uuid, IPlatform platform) + { + IQuery query = BuildHelper.BuildStatisticQuery(uuid, platform, GamemodeStatisticStatics.GetStatistic()); + + var data = await requestData(query); + + var deserialised = JsonSerializer.Deserialize(data); + + + return deserialised.GamemodeStatistics.FirstOrDefault().Value; + + } + + public async Task> GetOperatorStatistics(Guid[] uuids, IPlatform platform) + { + + + IQuery query = BuildHelper.BuildStatisticQuery(uuids, platform, QueueStatisticsStatics.GetStatistic()); + + var data = await requestData(query); + + var deserialised = JsonSerializer.Deserialize(data); + + return deserialised.OperatorStatistics; + } + + public async Task GetOperatorStatistics(Guid uuid, IPlatform platform) + { + + + IQuery query = BuildHelper.BuildStatisticQuery(uuid, platform, QueueStatisticsStatics.GetStatistic()); + + var data = await requestData(query); + + var deserialised = JsonSerializer.Deserialize(data); + + return deserialised.OperatorStatistics.FirstOrDefault().Value; + } + + + + public async Task> GetQueueStatistics(Guid[] uuids, IPlatform platform) + { + + IQuery query = BuildHelper.BuildStatisticQuery(uuids, platform, QueueStatisticsStatics.GetStatistic()); + + var data = await requestData(query); + + var deserialised = JsonSerializer.Deserialize(data); + + return deserialised.QueueStatistics; + } + + public async Task GetQueueStatistics(Guid uuid, IPlatform platform) + { + IQuery query = BuildHelper.BuildStatisticQuery(uuid, platform, QueueStatisticsStatics.GetStatistic()); + + var data = await requestData(query); + + var deserialised = JsonSerializer.Deserialize(data); + + return deserialised.QueueStatistics.FirstOrDefault().Value; + + } + + public async Task> GetTerroristHuntMissionsStatistics(Guid[] uuids, IPlatform platform) + { + + IQuery query = BuildHelper.BuildStatisticQuery(uuids, platform, TerroristHuntMissionStatisticStatics.GetStatistic()); + + var data = await requestData(query); + + var deserialised = JsonSerializer.Deserialize(data); + + return deserialised.TerroristHuntMissionStatistics; + } + + public async Task GetTerroristHuntMissionsStatistics(Guid uuid, IPlatform platform) + { + IQuery query = BuildHelper.BuildStatisticQuery(uuid, platform, TerroristHuntMissionStatisticStatics.GetStatistic()); + + var data = await requestData(query); + + var deserialised = JsonSerializer.Deserialize(data); + + return deserialised.TerroristHuntMissionStatistics.FirstOrDefault().Value; + } + + + + // may need to rewrite this for it to be dynamic + //https://stackoverflow.com/questions/57211425/deserialize-json-object-to-specific-instance-created-on-the-fly-in-run-time-by-s + // can go into single helper or something + private async Task requestData(IQuery query) + + { + // build a request + IRequest request = Factory.GetRequest(EndPoints.Statistics, query); + + return await _sessionHandler.GetDataAsync(request); + + } + } +} diff --git a/R6DataAccess/Exceptions/HttpToManyRequestException.cs b/R6DataAccess/Exceptions/HttpToManyRequestException.cs new file mode 100644 index 0000000..f523806 --- /dev/null +++ b/R6DataAccess/Exceptions/HttpToManyRequestException.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccess +{ + class HttpToManyRequestException : Exception + { + public HttpToManyRequestException() + { + } + public HttpToManyRequestException(string message) : base(message) + { + } + } +} diff --git a/R6DataAccess/Interfaces/EndPointInterface/IEndPoints.cs b/R6DataAccess/Interfaces/EndPointInterface/IEndPoints.cs new file mode 100644 index 0000000..b46f9ad --- /dev/null +++ b/R6DataAccess/Interfaces/EndPointInterface/IEndPoints.cs @@ -0,0 +1,10 @@ +namespace R6DataAccess.Models +{ + public interface IEndPoints + { + + string Url { get; set; } + + string Name { get; set; } + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/EndPointInterface/ILanguageEndPoint.cs b/R6DataAccess/Interfaces/EndPointInterface/ILanguageEndPoint.cs new file mode 100644 index 0000000..d85814f --- /dev/null +++ b/R6DataAccess/Interfaces/EndPointInterface/ILanguageEndPoint.cs @@ -0,0 +1,30 @@ +using System.Threading.Tasks; + +namespace R6DataAccess.Models +{ + public interface ILanguageEndPoint + { + + public static ILanguage AmericanEnglish { get; } + public static ILanguage AustralianEnglish { get; } + public static ILanguage BrazilianPortuguese { get; } + public static ILanguage BritishEnglish { get; } + + public static ILanguage CanadianFrench { get; } + public static ILanguage Czech { get; } + public static ILanguage Dutch { get; } + public static ILanguage EuropeanFrench { get; } + public static ILanguage EuropeanSpanish { get; } + public static ILanguage German { get; } + public static ILanguage Italian { get; } + public static ILanguage Japanese { get; } + public static ILanguage Korean { get; } + public static ILanguage LatinSpanish { get; } + public static ILanguage NordicEnglish { get; } + public static ILanguage Polish { get; } + public static ILanguage Russian { get; } + public static ILanguage SimplifiedChinese { get; } + public static ILanguage TraditionalChinese { get; } + + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/EndPointInterface/IPlayerEndpoint.cs b/R6DataAccess/Interfaces/EndPointInterface/IPlayerEndpoint.cs new file mode 100644 index 0000000..9e41af6 --- /dev/null +++ b/R6DataAccess/Interfaces/EndPointInterface/IPlayerEndpoint.cs @@ -0,0 +1,27 @@ +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace R6DataAccess.Endpoint.PlayerEndPoint +{ + public interface IPlayerEndpoint + { + Task GetRankedAsync(Guid uuid, IPlatform platform, IRegion region, int season = -1); + + + Task> GetRankedAsync(Guid[] uuids, IPlatform platform, IRegion region, int season = -1); + + + Task> GetCasualAsync(Guid[] uuids, IPlatform platform, IRegion region, int season = -1); + + + + Task GetCasualAsync(Guid uuid, IPlatform platform, IRegion region, int season = -1); + + + + + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/EndPointInterface/IPlayerProgressionEndpoint.cs b/R6DataAccess/Interfaces/EndPointInterface/IPlayerProgressionEndpoint.cs new file mode 100644 index 0000000..938d272 --- /dev/null +++ b/R6DataAccess/Interfaces/EndPointInterface/IPlayerProgressionEndpoint.cs @@ -0,0 +1,15 @@ +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace R6DataAccess.Interfaces +{ + public interface IPlayerProgressionEndpoint + { + Task GetPlayerProgressionAsync(Guid uuid, IPlatform platform); + Task> GetPlayerProgressionAsync(Guid[] uuid, IPlatform platform); + + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/EndPointInterface/IProfileEndpoint.cs b/R6DataAccess/Interfaces/EndPointInterface/IProfileEndpoint.cs new file mode 100644 index 0000000..baced8b --- /dev/null +++ b/R6DataAccess/Interfaces/EndPointInterface/IProfileEndpoint.cs @@ -0,0 +1,16 @@ +using R6DataAccess.Interfaces; +using R6Sharp.Response; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace R6Sharp.Endpoint +{ + public interface IProfileEndpoint + { + Task GetProfileAsync(string player, IPlatform platform); + Task> GetProfileAsync(string[] players, IPlatform platform); + Task GetProfileAsync(Guid uuid, IPlatform platform); + Task> GetProfileAsync(Guid[] uuids, IPlatform platform); + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/EndPointInterface/ISessionEndpoint.cs b/R6DataAccess/Interfaces/EndPointInterface/ISessionEndpoint.cs new file mode 100644 index 0000000..5e797a0 --- /dev/null +++ b/R6DataAccess/Interfaces/EndPointInterface/ISessionEndpoint.cs @@ -0,0 +1,17 @@ +using R6DataAccess.Models; +using R6Sharp.Response; +using System.Threading.Tasks; + +namespace R6Sharp.Endpoint +{ + public interface ISessionEndpoint + { + + + Task GetDataAsync(IRequest request); + + Task GetDataNoTicketRequiredAsync(IRequest request); + + + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/EndPointInterface/IStaticEndpoint.cs b/R6DataAccess/Interfaces/EndPointInterface/IStaticEndpoint.cs new file mode 100644 index 0000000..31512b4 --- /dev/null +++ b/R6DataAccess/Interfaces/EndPointInterface/IStaticEndpoint.cs @@ -0,0 +1,17 @@ +using R6DataAccess.Models; +using R6Sharp.Response.Static; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace R6Sharp.Endpoint +{ + public interface IStaticEndpoint + { + Task> GetLocaleAsync(ILanguage language); + Task> GetSeasonDetailsAsync(); + + Task GetSeasonsInfoAsync(); + Task GetCurrentSeasonAsync(); + Task GetSeasonAsync(int id); + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/EndPointInterface/IStatisticEndpoint.cs b/R6DataAccess/Interfaces/EndPointInterface/IStatisticEndpoint.cs new file mode 100644 index 0000000..9ad040d --- /dev/null +++ b/R6DataAccess/Interfaces/EndPointInterface/IStatisticEndpoint.cs @@ -0,0 +1,31 @@ +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace R6DataAccess.Endpoint.StatisticEndPoint +{ + public interface IStatisticEndpoint + { + + Task> GetEquipmentStatistics(Guid[] uuids, IPlatform platform); + Task GetEquipmentStatistics(Guid uuids, IPlatform platform); + + Task> GetGamemodeStatistics(Guid[] uuids, IPlatform platform); + Task GetGamemodeStatistics(Guid uuid, IPlatform platform); + + Task> GetOperatorStatistics(Guid[] uuids, IPlatform platform); + Task GetOperatorStatistics(Guid uuid, IPlatform platform); + + Task> GetQueueStatistics(Guid[] uuids, IPlatform platform); + + Task GetQueueStatistics(Guid uuid, IPlatform platform); + + Task> GetTerroristHuntMissionsStatistics(Guid[] uuids, IPlatform platform); + + Task GetTerroristHuntMissionsStatistics(Guid uuid, IPlatform platform); + + + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/IAuth.cs b/R6DataAccess/Interfaces/IAuth.cs new file mode 100644 index 0000000..af011bb --- /dev/null +++ b/R6DataAccess/Interfaces/IAuth.cs @@ -0,0 +1,7 @@ +namespace R6DataAccess.Models +{ + public interface IAuth + { + string GetCredentialBase64(); + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/IBoardInfo.cs b/R6DataAccess/Interfaces/IBoardInfo.cs new file mode 100644 index 0000000..a9b3457 --- /dev/null +++ b/R6DataAccess/Interfaces/IBoardInfo.cs @@ -0,0 +1,31 @@ +using System; + +namespace R6DataAccess.Models +{ + public interface IBoardInfo + { + int Abandons { get; set; } + string BoardId { get; set; } + int Deaths { get; set; } + int Kills { get; set; } + double LastMatchMMRChange { get; set; } + int LastMatchResult { get; set; } + double LastMatchSkillMeanChange { get; set; } + double LastMatchSkillStdevChange { get; set; } + int Losses { get; set; } + double MaxMMR { get; set; } + int MaxRank { get; set; } + double MMR { get; set; } + double NextRankMMR { get; set; } + double PreviousRankMMR { get; set; } + Guid ProfileId { get; set; } + int Rank { get; set; } + string Region { get; set; } + int Season { get; set; } + double SkillMean { get; set; } + double SkillStdev { get; set; } + int TopRankPosition { get; set; } + DateTime UpdateTime { get; set; } + int Wins { get; set; } + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/ILanguage.cs b/R6DataAccess/Interfaces/ILanguage.cs new file mode 100644 index 0000000..0b878ca --- /dev/null +++ b/R6DataAccess/Interfaces/ILanguage.cs @@ -0,0 +1,8 @@ +namespace R6DataAccess.Models +{ + public interface ILanguage + { + string LocalHash { get; set; } + string ShortHand { get; set; } + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/IPlatform.cs b/R6DataAccess/Interfaces/IPlatform.cs new file mode 100644 index 0000000..692a05c --- /dev/null +++ b/R6DataAccess/Interfaces/IPlatform.cs @@ -0,0 +1,14 @@ +using System; + +namespace R6DataAccess.Interfaces +{ + public interface IPlatform + { + + public string Name { get; } + + public Guid Guid { get; } + + public string SandBox { get; } + } +} diff --git a/R6DataAccess/Interfaces/IPlayerProgression.cs b/R6DataAccess/Interfaces/IPlayerProgression.cs new file mode 100644 index 0000000..76c0d92 --- /dev/null +++ b/R6DataAccess/Interfaces/IPlayerProgression.cs @@ -0,0 +1,13 @@ +using System; + +namespace R6DataAccess.Models +{ + public interface IPlayerProgression + { + int Level { get; set; } + int LootboxProbability { get; set; } + + Guid ProfileId { get; set; } + int XP { get; set; } + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/IProfile.cs b/R6DataAccess/Interfaces/IProfile.cs new file mode 100644 index 0000000..5bafe07 --- /dev/null +++ b/R6DataAccess/Interfaces/IProfile.cs @@ -0,0 +1,15 @@ +using System; + +namespace R6Sharp.Response +{ + public interface IProfile + { + Guid IdOnPlatform { get; set; } + string NameOnPlatform { get; set; } + string PlatformType { get; set; } + Guid ProfileId { get; set; } + Guid UserId { get; set; } + + Uri ProfileIcon { get; } + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/IQuery.cs b/R6DataAccess/Interfaces/IQuery.cs new file mode 100644 index 0000000..5ebfe5e --- /dev/null +++ b/R6DataAccess/Interfaces/IQuery.cs @@ -0,0 +1,27 @@ +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using System; + +namespace R6Sharp.Models +{ + public interface IQuery + { + string NameOnPlatform { get; set; } + + string IdOnPlatform { get; set; } + IPlatform PlatformType { get; set; } + + string ProfileId { get; set; } + + string BoardId { get; set; } + + IRegion Region { get; set; } + + string SeasonId { get; set; } + + string Population { get; set; } + + string Statistics { get; set; } + + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/IQueryBuilder.cs b/R6DataAccess/Interfaces/IQueryBuilder.cs new file mode 100644 index 0000000..1e80bcb --- /dev/null +++ b/R6DataAccess/Interfaces/IQueryBuilder.cs @@ -0,0 +1,34 @@ +using R6DataAccess.Builder; +using R6DataAccess.Interfaces; +using R6Sharp.Models; +using System; + +namespace R6DataAccess.Models +{ + public interface IQueryBuilder + { + IQuery Build(); + QueryBuilder NameOnPlatform(string player); + QueryBuilder PlatformType(IPlatform player); + QueryBuilder NameOnPlatform(string[] players); + + QueryBuilder IdOnPlatform(Guid uuid); + QueryBuilder IdOnPlatform(Guid[] uuid); + + QueryBuilder ProfileId(Guid guid); + + QueryBuilder ProfileId(Guid[] guid); + + QueryBuilder BoardId(string id); + + QueryBuilder Region(IRegion region); + + QueryBuilder Population(Guid[] population); + + QueryBuilder Population(Guid population); + + QueryBuilder Statistics(string[] statistics); + + QueryBuilder SeasonId(string id); + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/IRegion.cs b/R6DataAccess/Interfaces/IRegion.cs new file mode 100644 index 0000000..c2edc75 --- /dev/null +++ b/R6DataAccess/Interfaces/IRegion.cs @@ -0,0 +1,8 @@ +namespace R6DataAccess.Models +{ + public interface IRegion + { + + public string Name { get; } + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/IRequest.cs b/R6DataAccess/Interfaces/IRequest.cs new file mode 100644 index 0000000..f5b332a --- /dev/null +++ b/R6DataAccess/Interfaces/IRequest.cs @@ -0,0 +1,10 @@ +using System; + +namespace R6DataAccess.Models +{ + public interface IRequest + { + string URL { get; } + public Uri GetEndPointUri(); + } +} \ No newline at end of file diff --git a/R6Sharp/Response/Session.cs b/R6DataAccess/Interfaces/ISession.cs similarity index 55% rename from R6Sharp/Response/Session.cs rename to R6DataAccess/Interfaces/ISession.cs index 584b643..74e6b12 100644 --- a/R6Sharp/Response/Session.cs +++ b/R6DataAccess/Interfaces/ISession.cs @@ -3,50 +3,47 @@ namespace R6Sharp.Response { - public class Session + public interface ISession { - [JsonPropertyName("platformType")] + public string PlatformType { get; set; } - [JsonPropertyName("ticket")] public string Ticket { get; set; } - [JsonPropertyName("profileId")] + public Guid ProfileId { get; set; } - [JsonPropertyName("userId")] + public Guid UserId { get; set; } - [JsonPropertyName("nameOnPlatform")] + public string NameOnPlatform { get; set; } - [JsonPropertyName("environment")] + public string Environment { get; set; } - [JsonPropertyName("expiration")] + public DateTime Expiration { get; set; } - [JsonPropertyName("clientIp")] + public string ClientIp { get; set; } - [JsonPropertyName("clientIpCountry")] + public string ClientIpCountry { get; set; } - [JsonPropertyName("serverTime")] + public DateTime ServerTime { get; set; } - [JsonPropertyName("sessionId")] + public Guid SessionId { get; set; } - [JsonPropertyName("sessionKey")] public string SessionKey { get; set; } #nullable enable - [JsonPropertyName("twoFactorAuthenticationTicket")] + public string? TwoFactorAuthenticationTicket { get; set; } - [JsonPropertyName("rememberMeTicket")] + public string? RememberMeTicket { get; set; } -#nullable disable } -} +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/StatisticInterface/IEquipmentStatistic.cs b/R6DataAccess/Interfaces/StatisticInterface/IEquipmentStatistic.cs new file mode 100644 index 0000000..a4b7c9c --- /dev/null +++ b/R6DataAccess/Interfaces/StatisticInterface/IEquipmentStatistic.cs @@ -0,0 +1,162 @@ +namespace R6DataAccess.Models +{ + public interface IEquipmentStatistic + { + int GadgetpveChosen108F856206Infinite { get; set; } + int GadgetpveChosen143D8A7F46Infinite { get; set; } + int GadgetpveChosen1F7D4C789AInfinite { get; set; } + int GadgetpveChosen1FC75DB98Infinite { get; set; } + int GadgetpveChosen2305F2E8CFInfinite { get; set; } + int GadgetpveChosen232803C7B3Infinite { get; set; } + int GadgetpveChosen24F948E748Infinite { get; set; } + int GadgetpveChosen24F9498268Infinite { get; set; } + int GadgetpveChosen24F9498269Infinite { get; set; } + int GadgetpveChosen251D51968CInfinite { get; set; } + int GadgetpveChosen2A4CEB729CInfinite { get; set; } + int GadgetpveChosen2C06F6BBC5Infinite { get; set; } + int GadgetpveChosen37E0A74DD2Infinite { get; set; } + int GadgetpveChosen37E0A74DD4Infinite { get; set; } + int GadgetpveChosen38B9A2CB16Infinite { get; set; } + int GadgetpveChosen38FA6AE7CEInfinite { get; set; } + int GadgetpveChosen38FA6B0D49Infinite { get; set; } + int GadgetpveChosen395EBC0A4EInfinite { get; set; } + int GadgetpveChosen3A39663A6FInfinite { get; set; } + int GadgetpveChosen731005332Infinite { get; set; } + int GadgetpveChosen883555882Infinite { get; set; } + int GadgetpveChosen96ED81DE6Infinite { get; set; } + int GadgetpveChosen9B2CAEBAInfinite { get; set; } + int GadgetpveChosenADC64DD49Infinite { get; set; } + int GadgetpveChosenB793109FInfinite { get; set; } + int GadgetpveChosenB79310A0Infinite { get; set; } + int GadgetpveChosenB79310A1Infinite { get; set; } + int GadgetpveChosenB79310A3Infinite { get; set; } + int GadgetpveChosenB79310A5Infinite { get; set; } + int GadgetpveChosenB79310A7Infinite { get; set; } + int GadgetpveChosenB79310AAInfinite { get; set; } + int GadgetpveChosenB79310ABInfinite { get; set; } + int GadgetpveChosenB79310ACInfinite { get; set; } + int GadgetpveChosenB79310ADInfinite { get; set; } + int GadgetpveChosenB79310AFInfinite { get; set; } + int GadgetpveChosenB79310B4Infinite { get; set; } + int GadgetpveChosenB79310B5Infinite { get; set; } + int GadgetpveChosenB79310B7Infinite { get; set; } + int GadgetpveChosenB79310B9Infinite { get; set; } + int GadgetpveChosenB79310BAInfinite { get; set; } + int GadgetpveChosenB79310BBInfinite { get; set; } + int GadgetpveChosenB79310BCInfinite { get; set; } + int GadgetpveChosenB79310BDInfinite { get; set; } + int GadgetpveChosenE3707E47FInfinite { get; set; } + int GadgetpveChosenFF436317BInfinite { get; set; } + int GadgetpveKills36232BA67DInfinite { get; set; } + int GadgetpveKills38B9A14617Infinite { get; set; } + int GadgetpveKills38B9A2CB16Infinite { get; set; } + int GadgetpveKillsA44721360Infinite { get; set; } + int GadgetpveKillsB79310CBInfinite { get; set; } + int GadgetpvpKills1CBF13F5FBInfinite { get; set; } + int GadgetpvpKills36232BA67DInfinite { get; set; } + int GadgetpvpKills38B9A14617Infinite { get; set; } + int GadgetpvpKills38B9A2CB16Infinite { get; set; } + int GadgetpvpKills80CA9890CInfinite { get; set; } + int GadgetpvpKills9A9F55EF9Infinite { get; set; } + int GadgetpvpKillsA44721360Infinite { get; set; } + int GadgetpvpKillsB79310CBInfinite { get; set; } + int WeapontypepveBulletfired1Infinite { get; set; } + int WeapontypepveBulletfired2Infinite { get; set; } + int WeapontypepveBulletfired3Infinite { get; set; } + int WeapontypepveBulletfired4Infinite { get; set; } + int WeapontypepveBulletfired5Infinite { get; set; } + int WeapontypepveBulletfired6Infinite { get; set; } + int WeapontypepveBulletfired7Infinite { get; set; } + int WeapontypepveBullethit1Infinite { get; set; } + int WeapontypepveBullethit2Infinite { get; set; } + int WeapontypepveBullethit3Infinite { get; set; } + int WeapontypepveBullethit4Infinite { get; set; } + int WeapontypepveBullethit5Infinite { get; set; } + int WeapontypepveBullethit6Infinite { get; set; } + int WeapontypepveBullethit7Infinite { get; set; } + int WeapontypepveChosen1Infinite { get; set; } + int WeapontypepveChosen2Infinite { get; set; } + int WeapontypepveChosen3Infinite { get; set; } + int WeapontypepveChosen4Infinite { get; set; } + int WeapontypepveChosen5Infinite { get; set; } + int WeapontypepveChosen6Infinite { get; set; } + int WeapontypepveChosen7Infinite { get; set; } + int WeapontypepveChosen9Infinite { get; set; } + int WeapontypepveDeath1Infinite { get; set; } + int WeapontypepveDeath5Infinite { get; set; } + int WeapontypepveDeath6Infinite { get; set; } + int WeapontypepveHeadshot1Infinite { get; set; } + int WeapontypepveHeadshot2Infinite { get; set; } + int WeapontypepveHeadshot3Infinite { get; set; } + int WeapontypepveHeadshot4Infinite { get; set; } + int WeapontypepveHeadshot5Infinite { get; set; } + int WeapontypepveHeadshot6Infinite { get; set; } + int WeapontypepveHeadshot7Infinite { get; set; } + int WeapontypepveKills1Infinite { get; set; } + int WeapontypepveKills2Infinite { get; set; } + int WeapontypepveKills3Infinite { get; set; } + int WeapontypepveKills4Infinite { get; set; } + int WeapontypepveKills5Infinite { get; set; } + int WeapontypepveKills6Infinite { get; set; } + int WeapontypepveKills7Infinite { get; set; } + int WeapontypepvpBullethit1Infinite { get; set; } + int WeapontypepvpBullethit2Infinite { get; set; } + int WeapontypepvpBullethit3Infinite { get; set; } + int WeapontypepvpBullethit4Infinite { get; set; } + int WeapontypepvpBullethit5Infinite { get; set; } + int WeapontypepvpBullethit6Infinite { get; set; } + int WeapontypepvpBullethit7Infinite { get; set; } + int WeapontypepvpBullethitBInfinite { get; set; } + int WeapontypepvpBullethitCInfinite { get; set; } + int WeapontypepvpChosen1Infinite { get; set; } + int WeapontypepvpChosen2Infinite { get; set; } + int WeapontypepvpChosen3Infinite { get; set; } + int WeapontypepvpChosen4Infinite { get; set; } + int WeapontypepvpChosen5Infinite { get; set; } + int WeapontypepvpChosen6Infinite { get; set; } + int WeapontypepvpChosen7Infinite { get; set; } + int WeapontypepvpChosen9Infinite { get; set; } + int WeapontypepvpChosenBInfinite { get; set; } + int WeapontypepvpDbno1Infinite { get; set; } + int WeapontypepvpDbno2Infinite { get; set; } + int WeapontypepvpDbno3Infinite { get; set; } + int WeapontypepvpDbno4Infinite { get; set; } + int WeapontypepvpDbno5Infinite { get; set; } + int WeapontypepvpDbno6Infinite { get; set; } + int WeapontypepvpDbno7Infinite { get; set; } + int WeapontypepvpDbnoassists1Infinite { get; set; } + int WeapontypepvpDbnoassists2Infinite { get; set; } + int WeapontypepvpDbnoassists3Infinite { get; set; } + int WeapontypepvpDbnoassists4Infinite { get; set; } + int WeapontypepvpDbnoassists5Infinite { get; set; } + int WeapontypepvpDbnoassists6Infinite { get; set; } + int WeapontypepvpDbnoassists7Infinite { get; set; } + int WeapontypepvpDbnoassists9Infinite { get; set; } + int WeapontypepvpDbnoassistsCInfinite { get; set; } + int WeapontypepvpDbnoBInfinite { get; set; } + int WeapontypepvpDeath1Infinite { get; set; } + int WeapontypepvpDeath2Infinite { get; set; } + int WeapontypepvpDeath3Infinite { get; set; } + int WeapontypepvpDeath4Infinite { get; set; } + int WeapontypepvpDeath5Infinite { get; set; } + int WeapontypepvpDeath6Infinite { get; set; } + int WeapontypepvpDeath7Infinite { get; set; } + int WeapontypepvpDeathBInfinite { get; set; } + int WeapontypepvpHeadshot1Infinite { get; set; } + int WeapontypepvpHeadshot2Infinite { get; set; } + int WeapontypepvpHeadshot3Infinite { get; set; } + int WeapontypepvpHeadshot4Infinite { get; set; } + int WeapontypepvpHeadshot5Infinite { get; set; } + int WeapontypepvpHeadshot6Infinite { get; set; } + int WeapontypepvpHeadshot7Infinite { get; set; } + int WeapontypepvpHeadshotBInfinite { get; set; } + int WeapontypepvpKills1Infinite { get; set; } + int WeapontypepvpKills2Infinite { get; set; } + int WeapontypepvpKills3Infinite { get; set; } + int WeapontypepvpKills4Infinite { get; set; } + int WeapontypepvpKills5Infinite { get; set; } + int WeapontypepvpKills6Infinite { get; set; } + int WeapontypepvpKills7Infinite { get; set; } + int WeapontypepvpKillsBInfinite { get; set; } + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/StatisticInterface/IGamemodeStatistic.cs b/R6DataAccess/Interfaces/StatisticInterface/IGamemodeStatistic.cs new file mode 100644 index 0000000..5681a25 --- /dev/null +++ b/R6DataAccess/Interfaces/StatisticInterface/IGamemodeStatistic.cs @@ -0,0 +1,28 @@ +namespace R6DataAccess.Models +{ + public interface IGamemodeStatistic + { + int PlantbombpveMatchlostInfinite { get; set; } + int PlantbombpveMatchplayedInfinite { get; set; } + int PlantbombpveMatchwonInfinite { get; set; } + int PlantbombpvpMatchlostInfinite { get; set; } + int PlantbombpvpMatchplayedInfinite { get; set; } + int PlantbombpvpMatchwonInfinite { get; set; } + int PlantbombpvpTimeplayedInfinite { get; set; } + int ProtecthostagepveBestscoreInfinite { get; set; } + int ProtecthostagepveHostagedefenseInfinite { get; set; } + int ProtecthostagepveMatchlostInfinite { get; set; } + int ProtecthostagepveMatchplayedInfinite { get; set; } + int ProtecthostagepveMatchwonInfinite { get; set; } + int RescuehostagepveHostagerescueInfinite { get; set; } + int RescuehostagepveMatchlostInfinite { get; set; } + int RescuehostagepveMatchplayedInfinite { get; set; } + int RescuehostagepveMatchwonInfinite { get; set; } + int RescuehostagepvpMatchlostInfinite { get; set; } + int RescuehostagepvpMatchplayedInfinite { get; set; } + int RescuehostagepvpMatchwonInfinite { get; set; } + int SecureareapvpMatchlostInfinite { get; set; } + int SecureareapvpMatchplayedInfinite { get; set; } + int SecureareapvpMatchwonInfinite { get; set; } + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/StatisticInterface/IOperatorStatistic.cs b/R6DataAccess/Interfaces/StatisticInterface/IOperatorStatistic.cs new file mode 100644 index 0000000..9b385a0 --- /dev/null +++ b/R6DataAccess/Interfaces/StatisticInterface/IOperatorStatistic.cs @@ -0,0 +1,1048 @@ +namespace R6DataAccess.Models +{ + public interface IOperatorStatistic + { + int OperatorpveAshBonfirewallbreached32Infinite { get; set; } + int OperatorpveBuckKill26Infinite { get; set; } + int OperatorpveCapitaoLethaldartkills28Infinite { get; set; } + int OperatorpveCastleKevlarbarricadedeployed22Infinite { get; set; } + int OperatorpveDeath11Infinite { get; set; } + int OperatorpveDeath13Infinite { get; set; } + int OperatorpveDeath210Infinite { get; set; } + int OperatorpveDeath211Infinite { get; set; } + int OperatorpveDeath213Infinite { get; set; } + int OperatorpveDeath219Infinite { get; set; } + int OperatorpveDeath22Infinite { get; set; } + int OperatorpveDeath24Infinite { get; set; } + int OperatorpveDeath26Infinite { get; set; } + int OperatorpveDeath28Infinite { get; set; } + int OperatorpveDeath29Infinite { get; set; } + int OperatorpveDeath2BInfinite { get; set; } + int OperatorpveDeath2FInfinite { get; set; } + int OperatorpveDeath32Infinite { get; set; } + int OperatorpveDeath33Infinite { get; set; } + int OperatorpveDeath34Infinite { get; set; } + int OperatorpveDeath35Infinite { get; set; } + int OperatorpveDeath39Infinite { get; set; } + int OperatorpveDeath3BInfinite { get; set; } + int OperatorpveDeath3DInfinite { get; set; } + int OperatorpveDeath41Infinite { get; set; } + int OperatorpveDeath42Infinite { get; set; } + int OperatorpveDeath43Infinite { get; set; } + int OperatorpveDeath4EInfinite { get; set; } + int OperatorpveDeath51Infinite { get; set; } + int OperatorpveDeath52Infinite { get; set; } + int OperatorpveDeath53Infinite { get; set; } + int OperatorpveDeath55Infinite { get; set; } + int OperatorpveFrostBeartrapKill36Infinite { get; set; } + int OperatorpveFuzeClusterchargekill34Infinite { get; set; } + int OperatorpveGlazSniperkill24Infinite { get; set; } + int OperatorpveGlazSniperpenetrationkill24Infinite { get; set; } + int OperatorpveHeadshot11Infinite { get; set; } + int OperatorpveHeadshot12Infinite { get; set; } + int OperatorpveHeadshot13Infinite { get; set; } + int OperatorpveHeadshot210Infinite { get; set; } + int OperatorpveHeadshot212Infinite { get; set; } + int OperatorpveHeadshot213Infinite { get; set; } + int OperatorpveHeadshot218Infinite { get; set; } + int OperatorpveHeadshot219Infinite { get; set; } + int OperatorpveHeadshot21Infinite { get; set; } + int OperatorpveHeadshot22Infinite { get; set; } + int OperatorpveHeadshot23Infinite { get; set; } + int OperatorpveHeadshot24Infinite { get; set; } + int OperatorpveHeadshot25Infinite { get; set; } + int OperatorpveHeadshot26Infinite { get; set; } + int OperatorpveHeadshot28Infinite { get; set; } + int OperatorpveHeadshot29Infinite { get; set; } + int OperatorpveHeadshot2BInfinite { get; set; } + int OperatorpveHeadshot2CInfinite { get; set; } + int OperatorpveHeadshot2FInfinite { get; set; } + int OperatorpveHeadshot311Infinite { get; set; } + int OperatorpveHeadshot312Infinite { get; set; } + int OperatorpveHeadshot32Infinite { get; set; } + int OperatorpveHeadshot33Infinite { get; set; } + int OperatorpveHeadshot34Infinite { get; set; } + int OperatorpveHeadshot35Infinite { get; set; } + int OperatorpveHeadshot36Infinite { get; set; } + int OperatorpveHeadshot37Infinite { get; set; } + int OperatorpveHeadshot39Infinite { get; set; } + int OperatorpveHeadshot3BInfinite { get; set; } + int OperatorpveHeadshot3CInfinite { get; set; } + int OperatorpveHeadshot3DInfinite { get; set; } + int OperatorpveHeadshot3FInfinite { get; set; } + int OperatorpveHeadshot417Infinite { get; set; } + int OperatorpveHeadshot41Infinite { get; set; } + int OperatorpveHeadshot42Infinite { get; set; } + int OperatorpveHeadshot43Infinite { get; set; } + int OperatorpveHeadshot44Infinite { get; set; } + int OperatorpveHeadshot4EInfinite { get; set; } + int OperatorpveHeadshot51Infinite { get; set; } + int OperatorpveHeadshot52Infinite { get; set; } + int OperatorpveHeadshot53Infinite { get; set; } + int OperatorpveHeadshot55Infinite { get; set; } + int OperatorpveHibanaDetonateProjectile29Infinite { get; set; } + int OperatorpveIqGadgetspotbyef35Infinite { get; set; } + int OperatorpveKapkanBoobytrapdeployed44Infinite { get; set; } + int OperatorpveKapkanBoobytrapkill44Infinite { get; set; } + int OperatorpveKills11Infinite { get; set; } + int OperatorpveKills12Infinite { get; set; } + int OperatorpveKills13Infinite { get; set; } + int OperatorpveKills210Infinite { get; set; } + int OperatorpveKills211Infinite { get; set; } + int OperatorpveKills212Infinite { get; set; } + int OperatorpveKills213Infinite { get; set; } + int OperatorpveKills218Infinite { get; set; } + int OperatorpveKills219Infinite { get; set; } + int OperatorpveKills21Infinite { get; set; } + int OperatorpveKills22Infinite { get; set; } + int OperatorpveKills23Infinite { get; set; } + int OperatorpveKills24Infinite { get; set; } + int OperatorpveKills25Infinite { get; set; } + int OperatorpveKills26Infinite { get; set; } + int OperatorpveKills28Infinite { get; set; } + int OperatorpveKills29Infinite { get; set; } + int OperatorpveKills2BInfinite { get; set; } + int OperatorpveKills2CInfinite { get; set; } + int OperatorpveKills2FInfinite { get; set; } + int OperatorpveKills311Infinite { get; set; } + int OperatorpveKills312Infinite { get; set; } + int OperatorpveKills32Infinite { get; set; } + int OperatorpveKills33Infinite { get; set; } + int OperatorpveKills34Infinite { get; set; } + int OperatorpveKills35Infinite { get; set; } + int OperatorpveKills36Infinite { get; set; } + int OperatorpveKills37Infinite { get; set; } + int OperatorpveKills39Infinite { get; set; } + int OperatorpveKills3BInfinite { get; set; } + int OperatorpveKills3CInfinite { get; set; } + int OperatorpveKills3DInfinite { get; set; } + int OperatorpveKills3FInfinite { get; set; } + int OperatorpveKills417Infinite { get; set; } + int OperatorpveKills41Infinite { get; set; } + int OperatorpveKills42Infinite { get; set; } + int OperatorpveKills43Infinite { get; set; } + int OperatorpveKills44Infinite { get; set; } + int OperatorpveKills4EInfinite { get; set; } + int OperatorpveKills51Infinite { get; set; } + int OperatorpveKills52Infinite { get; set; } + int OperatorpveKills53Infinite { get; set; } + int OperatorpveKills55Infinite { get; set; } + int OperatorpveMeleekills210Infinite { get; set; } + int OperatorpveMeleekills211Infinite { get; set; } + int OperatorpveMeleekills212Infinite { get; set; } + int OperatorpveMeleekills213Infinite { get; set; } + int OperatorpveMeleekills219Infinite { get; set; } + int OperatorpveMeleekills23Infinite { get; set; } + int OperatorpveMeleekills24Infinite { get; set; } + int OperatorpveMeleekills26Infinite { get; set; } + int OperatorpveMeleekills28Infinite { get; set; } + int OperatorpveMeleekills29Infinite { get; set; } + int OperatorpveMeleekills2BInfinite { get; set; } + int OperatorpveMeleekills32Infinite { get; set; } + int OperatorpveMeleekills34Infinite { get; set; } + int OperatorpveMeleekills35Infinite { get; set; } + int OperatorpveMeleekills37Infinite { get; set; } + int OperatorpveMeleekills39Infinite { get; set; } + int OperatorpveMeleekills3BInfinite { get; set; } + int OperatorpveMeleekills3CInfinite { get; set; } + int OperatorpveMeleekills41Infinite { get; set; } + int OperatorpveMeleekills43Infinite { get; set; } + int OperatorpveMeleekills44Infinite { get; set; } + int OperatorpveMeleekills4EInfinite { get; set; } + int OperatorpveMeleekills51Infinite { get; set; } + int OperatorpveMeleekills52Infinite { get; set; } + int OperatorpveMeleekills53Infinite { get; set; } + int OperatorpveRookArmorboxdeployed33Infinite { get; set; } + int OperatorpveRookArmortakenourself33Infinite { get; set; } + int OperatorpveRookArmortakenteammate33Infinite { get; set; } + int OperatorpveRoundlost11Infinite { get; set; } + int OperatorpveRoundlost13Infinite { get; set; } + int OperatorpveRoundlost213Infinite { get; set; } + int OperatorpveRoundlost219Infinite { get; set; } + int OperatorpveRoundlost23Infinite { get; set; } + int OperatorpveRoundlost24Infinite { get; set; } + int OperatorpveRoundlost26Infinite { get; set; } + int OperatorpveRoundlost29Infinite { get; set; } + int OperatorpveRoundlost2BInfinite { get; set; } + int OperatorpveRoundlost2FInfinite { get; set; } + int OperatorpveRoundlost32Infinite { get; set; } + int OperatorpveRoundlost33Infinite { get; set; } + int OperatorpveRoundlost35Infinite { get; set; } + int OperatorpveRoundlost39Infinite { get; set; } + int OperatorpveRoundlost3DInfinite { get; set; } + int OperatorpveRoundlost41Infinite { get; set; } + int OperatorpveRoundlost42Infinite { get; set; } + int OperatorpveRoundlost43Infinite { get; set; } + int OperatorpveRoundlost4EInfinite { get; set; } + int OperatorpveRoundlost51Infinite { get; set; } + int OperatorpveRoundlost52Infinite { get; set; } + int OperatorpveRoundlost55Infinite { get; set; } + int OperatorpveRoundplayed11Infinite { get; set; } + int OperatorpveRoundplayed12Infinite { get; set; } + int OperatorpveRoundplayed13Infinite { get; set; } + int OperatorpveRoundplayed210Infinite { get; set; } + int OperatorpveRoundplayed211Infinite { get; set; } + int OperatorpveRoundplayed212Infinite { get; set; } + int OperatorpveRoundplayed213Infinite { get; set; } + int OperatorpveRoundplayed218Infinite { get; set; } + int OperatorpveRoundplayed219Infinite { get; set; } + int OperatorpveRoundplayed21Infinite { get; set; } + int OperatorpveRoundplayed22Infinite { get; set; } + int OperatorpveRoundplayed23Infinite { get; set; } + int OperatorpveRoundplayed24Infinite { get; set; } + int OperatorpveRoundplayed25Infinite { get; set; } + int OperatorpveRoundplayed26Infinite { get; set; } + int OperatorpveRoundplayed28Infinite { get; set; } + int OperatorpveRoundplayed29Infinite { get; set; } + int OperatorpveRoundplayed2BInfinite { get; set; } + int OperatorpveRoundplayed2CInfinite { get; set; } + int OperatorpveRoundplayed2FInfinite { get; set; } + int OperatorpveRoundplayed311Infinite { get; set; } + int OperatorpveRoundplayed312Infinite { get; set; } + int OperatorpveRoundplayed32Infinite { get; set; } + int OperatorpveRoundplayed33Infinite { get; set; } + int OperatorpveRoundplayed34Infinite { get; set; } + int OperatorpveRoundplayed35Infinite { get; set; } + int OperatorpveRoundplayed36Infinite { get; set; } + int OperatorpveRoundplayed37Infinite { get; set; } + int OperatorpveRoundplayed39Infinite { get; set; } + int OperatorpveRoundplayed3BInfinite { get; set; } + int OperatorpveRoundplayed3CInfinite { get; set; } + int OperatorpveRoundplayed3DInfinite { get; set; } + int OperatorpveRoundplayed3FInfinite { get; set; } + int OperatorpveRoundplayed417Infinite { get; set; } + int OperatorpveRoundplayed41Infinite { get; set; } + int OperatorpveRoundplayed42Infinite { get; set; } + int OperatorpveRoundplayed43Infinite { get; set; } + int OperatorpveRoundplayed44Infinite { get; set; } + int OperatorpveRoundplayed4EInfinite { get; set; } + int OperatorpveRoundplayed51Infinite { get; set; } + int OperatorpveRoundplayed52Infinite { get; set; } + int OperatorpveRoundplayed53Infinite { get; set; } + int OperatorpveRoundplayed55Infinite { get; set; } + int OperatorpveRoundwon11Infinite { get; set; } + int OperatorpveRoundwon12Infinite { get; set; } + int OperatorpveRoundwon13Infinite { get; set; } + int OperatorpveRoundwon210Infinite { get; set; } + int OperatorpveRoundwon211Infinite { get; set; } + int OperatorpveRoundwon212Infinite { get; set; } + int OperatorpveRoundwon213Infinite { get; set; } + int OperatorpveRoundwon218Infinite { get; set; } + int OperatorpveRoundwon219Infinite { get; set; } + int OperatorpveRoundwon21Infinite { get; set; } + int OperatorpveRoundwon22Infinite { get; set; } + int OperatorpveRoundwon23Infinite { get; set; } + int OperatorpveRoundwon24Infinite { get; set; } + int OperatorpveRoundwon25Infinite { get; set; } + int OperatorpveRoundwon26Infinite { get; set; } + int OperatorpveRoundwon28Infinite { get; set; } + int OperatorpveRoundwon29Infinite { get; set; } + int OperatorpveRoundwon2BInfinite { get; set; } + int OperatorpveRoundwon2CInfinite { get; set; } + int OperatorpveRoundwon311Infinite { get; set; } + int OperatorpveRoundwon312Infinite { get; set; } + int OperatorpveRoundwon32Infinite { get; set; } + int OperatorpveRoundwon34Infinite { get; set; } + int OperatorpveRoundwon35Infinite { get; set; } + int OperatorpveRoundwon36Infinite { get; set; } + int OperatorpveRoundwon37Infinite { get; set; } + int OperatorpveRoundwon3BInfinite { get; set; } + int OperatorpveRoundwon3CInfinite { get; set; } + int OperatorpveRoundwon3DInfinite { get; set; } + int OperatorpveRoundwon3FInfinite { get; set; } + int OperatorpveRoundwon417Infinite { get; set; } + int OperatorpveRoundwon41Infinite { get; set; } + int OperatorpveRoundwon43Infinite { get; set; } + int OperatorpveRoundwon44Infinite { get; set; } + int OperatorpveRoundwon4EInfinite { get; set; } + int OperatorpveRoundwon51Infinite { get; set; } + int OperatorpveRoundwon52Infinite { get; set; } + int OperatorpveRoundwon53Infinite { get; set; } + int OperatorpveRoundwon55Infinite { get; set; } + int OperatorpveSledgeHammerhole41Infinite { get; set; } + int OperatorpveSledgeHammerkill41Infinite { get; set; } + int OperatorpveSmokePoisongaskill21Infinite { get; set; } + int OperatorpveThatcherGadgetdestroywithemp51Infinite { get; set; } + int OperatorpveThermiteChargedeployed52Infinite { get; set; } + int OperatorpveThermiteReinforcementbreached52Infinite { get; set; } + int OperatorpveTimeplayed11Infinite { get; set; } + int OperatorpveTimeplayed12Infinite { get; set; } + int OperatorpveTimeplayed13Infinite { get; set; } + int OperatorpveTimeplayed210Infinite { get; set; } + int OperatorpveTimeplayed211Infinite { get; set; } + int OperatorpveTimeplayed212Infinite { get; set; } + int OperatorpveTimeplayed213Infinite { get; set; } + int OperatorpveTimeplayed218Infinite { get; set; } + int OperatorpveTimeplayed219Infinite { get; set; } + int OperatorpveTimeplayed21Infinite { get; set; } + int OperatorpveTimeplayed22Infinite { get; set; } + int OperatorpveTimeplayed23Infinite { get; set; } + int OperatorpveTimeplayed24Infinite { get; set; } + int OperatorpveTimeplayed25Infinite { get; set; } + int OperatorpveTimeplayed26Infinite { get; set; } + int OperatorpveTimeplayed28Infinite { get; set; } + int OperatorpveTimeplayed29Infinite { get; set; } + int OperatorpveTimeplayed2BInfinite { get; set; } + int OperatorpveTimeplayed2CInfinite { get; set; } + int OperatorpveTimeplayed2FInfinite { get; set; } + int OperatorpveTimeplayed311Infinite { get; set; } + int OperatorpveTimeplayed312Infinite { get; set; } + int OperatorpveTimeplayed32Infinite { get; set; } + int OperatorpveTimeplayed33Infinite { get; set; } + int OperatorpveTimeplayed34Infinite { get; set; } + int OperatorpveTimeplayed35Infinite { get; set; } + int OperatorpveTimeplayed36Infinite { get; set; } + int OperatorpveTimeplayed37Infinite { get; set; } + int OperatorpveTimeplayed39Infinite { get; set; } + int OperatorpveTimeplayed3BInfinite { get; set; } + int OperatorpveTimeplayed3CInfinite { get; set; } + int OperatorpveTimeplayed3DInfinite { get; set; } + int OperatorpveTimeplayed3FInfinite { get; set; } + int OperatorpveTimeplayed417Infinite { get; set; } + int OperatorpveTimeplayed41Infinite { get; set; } + int OperatorpveTimeplayed42Infinite { get; set; } + int OperatorpveTimeplayed43Infinite { get; set; } + int OperatorpveTimeplayed44Infinite { get; set; } + int OperatorpveTimeplayed4EInfinite { get; set; } + int OperatorpveTimeplayed51Infinite { get; set; } + int OperatorpveTimeplayed52Infinite { get; set; } + int OperatorpveTimeplayed53Infinite { get; set; } + int OperatorpveTimeplayed55Infinite { get; set; } + int OperatorpveTotalxp11Infinite { get; set; } + int OperatorpveTotalxp12Infinite { get; set; } + int OperatorpveTotalxp13Infinite { get; set; } + int OperatorpveTotalxp210Infinite { get; set; } + int OperatorpveTotalxp211Infinite { get; set; } + int OperatorpveTotalxp212Infinite { get; set; } + int OperatorpveTotalxp213Infinite { get; set; } + int OperatorpveTotalxp218Infinite { get; set; } + int OperatorpveTotalxp219Infinite { get; set; } + int OperatorpveTotalxp21Infinite { get; set; } + int OperatorpveTotalxp22Infinite { get; set; } + int OperatorpveTotalxp23Infinite { get; set; } + int OperatorpveTotalxp24Infinite { get; set; } + int OperatorpveTotalxp25Infinite { get; set; } + int OperatorpveTotalxp26Infinite { get; set; } + int OperatorpveTotalxp28Infinite { get; set; } + int OperatorpveTotalxp29Infinite { get; set; } + int OperatorpveTotalxp2BInfinite { get; set; } + int OperatorpveTotalxp2CInfinite { get; set; } + int OperatorpveTotalxp2FInfinite { get; set; } + int OperatorpveTotalxp311Infinite { get; set; } + int OperatorpveTotalxp312Infinite { get; set; } + int OperatorpveTotalxp32Infinite { get; set; } + int OperatorpveTotalxp33Infinite { get; set; } + int OperatorpveTotalxp34Infinite { get; set; } + int OperatorpveTotalxp35Infinite { get; set; } + int OperatorpveTotalxp36Infinite { get; set; } + int OperatorpveTotalxp37Infinite { get; set; } + int OperatorpveTotalxp39Infinite { get; set; } + int OperatorpveTotalxp3BInfinite { get; set; } + int OperatorpveTotalxp3CInfinite { get; set; } + int OperatorpveTotalxp3DInfinite { get; set; } + int OperatorpveTotalxp3FInfinite { get; set; } + int OperatorpveTotalxp417Infinite { get; set; } + int OperatorpveTotalxp41Infinite { get; set; } + int OperatorpveTotalxp42Infinite { get; set; } + int OperatorpveTotalxp43Infinite { get; set; } + int OperatorpveTotalxp44Infinite { get; set; } + int OperatorpveTotalxp4EInfinite { get; set; } + int OperatorpveTotalxp51Infinite { get; set; } + int OperatorpveTotalxp52Infinite { get; set; } + int OperatorpveTotalxp53Infinite { get; set; } + int OperatorpveTotalxp55Infinite { get; set; } + int OperatorpveTwitchGadgetdestroybyshockdrone43Infinite { get; set; } + int OperatorpvpAmaruDistancereeled216Infinite { get; set; } + int OperatorpvpAshBonfirekill32Infinite { get; set; } + int OperatorpvpAshBonfirewallbreached32Infinite { get; set; } + int OperatorpvpAttackerdroneDiminishedrealitymode3DInfinite { get; set; } + int OperatorpvpBarrageKillswithturret2FInfinite { get; set; } + int OperatorpvpBlackbeardGunshieldblockdamage27Infinite { get; set; } + int OperatorpvpBlackMirrorGadgetDeployed3AInfinite { get; set; } + int OperatorpvpBlitzFlashedenemy25Infinite { get; set; } + int OperatorpvpBlitzFlashfollowupkills25Infinite { get; set; } + int OperatorpvpBlitzFlashshieldassist25Infinite { get; set; } + int OperatorpvpBuckKill26Infinite { get; set; } + int OperatorpvpCaltropEnemyAffected3BInfinite { get; set; } + int OperatorpvpCapitaoLethaldartkills28Infinite { get; set; } + int OperatorpvpCastleKevlarbarricadedeployed22Infinite { get; set; } + int OperatorpvpCaveiraInterrogations38Infinite { get; set; } + int OperatorpvpCazadorAssistKill2AInfinite { get; set; } + int OperatorpvpConcussiongrenadeDetonate3CInfinite { get; set; } + int OperatorpvpConcussionmineDetonate2CInfinite { get; set; } + int OperatorpvpDazzlerGadgetDetonate2BInfinite { get; set; } + int OperatorpvpDbno11BInfinite { get; set; } + int OperatorpvpDbno12Infinite { get; set; } + int OperatorpvpDbno13Infinite { get; set; } + int OperatorpvpDbno15Infinite { get; set; } + int OperatorpvpDbno210Infinite { get; set; } + int OperatorpvpDbno212Infinite { get; set; } + int OperatorpvpDbno213Infinite { get; set; } + int OperatorpvpDbno214Infinite { get; set; } + int OperatorpvpDbno215Infinite { get; set; } + int OperatorpvpDbno216Infinite { get; set; } + int OperatorpvpDbno218Infinite { get; set; } + int OperatorpvpDbno219Infinite { get; set; } + int OperatorpvpDbno21AInfinite { get; set; } + int OperatorpvpDbno21Infinite { get; set; } + int OperatorpvpDbno22Infinite { get; set; } + int OperatorpvpDbno23Infinite { get; set; } + int OperatorpvpDbno24Infinite { get; set; } + int OperatorpvpDbno25Infinite { get; set; } + int OperatorpvpDbno26Infinite { get; set; } + int OperatorpvpDbno27Infinite { get; set; } + int OperatorpvpDbno28Infinite { get; set; } + int OperatorpvpDbno29Infinite { get; set; } + int OperatorpvpDbno2AInfinite { get; set; } + int OperatorpvpDbno2BInfinite { get; set; } + int OperatorpvpDbno2CInfinite { get; set; } + int OperatorpvpDbno2FInfinite { get; set; } + int OperatorpvpDbno311Infinite { get; set; } + int OperatorpvpDbno312Infinite { get; set; } + int OperatorpvpDbno317Infinite { get; set; } + int OperatorpvpDbno31AInfinite { get; set; } + int OperatorpvpDbno31Infinite { get; set; } + int OperatorpvpDbno32Infinite { get; set; } + int OperatorpvpDbno33Infinite { get; set; } + int OperatorpvpDbno34Infinite { get; set; } + int OperatorpvpDbno35Infinite { get; set; } + int OperatorpvpDbno36Infinite { get; set; } + int OperatorpvpDbno37Infinite { get; set; } + int OperatorpvpDbno38Infinite { get; set; } + int OperatorpvpDbno3AInfinite { get; set; } + int OperatorpvpDbno3BInfinite { get; set; } + int OperatorpvpDbno3CInfinite { get; set; } + int OperatorpvpDbno3DInfinite { get; set; } + int OperatorpvpDbno3EInfinite { get; set; } + int OperatorpvpDbno3FInfinite { get; set; } + int OperatorpvpDbno416Infinite { get; set; } + int OperatorpvpDbno417Infinite { get; set; } + int OperatorpvpDbno41Infinite { get; set; } + int OperatorpvpDbno42Infinite { get; set; } + int OperatorpvpDbno43Infinite { get; set; } + int OperatorpvpDbno44Infinite { get; set; } + int OperatorpvpDbno45Infinite { get; set; } + int OperatorpvpDbno4EInfinite { get; set; } + int OperatorpvpDbno516Infinite { get; set; } + int OperatorpvpDbno51Infinite { get; set; } + int OperatorpvpDbno52Infinite { get; set; } + int OperatorpvpDbno53Infinite { get; set; } + int OperatorpvpDbno54Infinite { get; set; } + int OperatorpvpDbno55Infinite { get; set; } + int OperatorpvpDeath11BInfinite { get; set; } + int OperatorpvpDeath11Infinite { get; set; } + int OperatorpvpDeath12Infinite { get; set; } + int OperatorpvpDeath13Infinite { get; set; } + int OperatorpvpDeath14Infinite { get; set; } + int OperatorpvpDeath15Infinite { get; set; } + int OperatorpvpDeath210Infinite { get; set; } + int OperatorpvpDeath211Infinite { get; set; } + int OperatorpvpDeath212Infinite { get; set; } + int OperatorpvpDeath213Infinite { get; set; } + int OperatorpvpDeath214Infinite { get; set; } + int OperatorpvpDeath215Infinite { get; set; } + int OperatorpvpDeath216Infinite { get; set; } + int OperatorpvpDeath218Infinite { get; set; } + int OperatorpvpDeath219Infinite { get; set; } + int OperatorpvpDeath21AInfinite { get; set; } + int OperatorpvpDeath21Infinite { get; set; } + int OperatorpvpDeath22Infinite { get; set; } + int OperatorpvpDeath23Infinite { get; set; } + int OperatorpvpDeath24Infinite { get; set; } + int OperatorpvpDeath25Infinite { get; set; } + int OperatorpvpDeath26Infinite { get; set; } + int OperatorpvpDeath27Infinite { get; set; } + int OperatorpvpDeath28Infinite { get; set; } + int OperatorpvpDeath29Infinite { get; set; } + int OperatorpvpDeath2AInfinite { get; set; } + int OperatorpvpDeath2BInfinite { get; set; } + int OperatorpvpDeath2CInfinite { get; set; } + int OperatorpvpDeath2DInfinite { get; set; } + int OperatorpvpDeath2FInfinite { get; set; } + int OperatorpvpDeath310Infinite { get; set; } + int OperatorpvpDeath311Infinite { get; set; } + int OperatorpvpDeath312Infinite { get; set; } + int OperatorpvpDeath316Infinite { get; set; } + int OperatorpvpDeath317Infinite { get; set; } + int OperatorpvpDeath31AInfinite { get; set; } + int OperatorpvpDeath31Infinite { get; set; } + int OperatorpvpDeath32Infinite { get; set; } + int OperatorpvpDeath33Infinite { get; set; } + int OperatorpvpDeath34Infinite { get; set; } + int OperatorpvpDeath35Infinite { get; set; } + int OperatorpvpDeath36Infinite { get; set; } + int OperatorpvpDeath37Infinite { get; set; } + int OperatorpvpDeath38Infinite { get; set; } + int OperatorpvpDeath39Infinite { get; set; } + int OperatorpvpDeath3AInfinite { get; set; } + int OperatorpvpDeath3BInfinite { get; set; } + int OperatorpvpDeath3CInfinite { get; set; } + int OperatorpvpDeath3DInfinite { get; set; } + int OperatorpvpDeath3EInfinite { get; set; } + int OperatorpvpDeath3FInfinite { get; set; } + int OperatorpvpDeath416Infinite { get; set; } + int OperatorpvpDeath417Infinite { get; set; } + int OperatorpvpDeath41AInfinite { get; set; } + int OperatorpvpDeath41Infinite { get; set; } + int OperatorpvpDeath42Infinite { get; set; } + int OperatorpvpDeath43Infinite { get; set; } + int OperatorpvpDeath44Infinite { get; set; } + int OperatorpvpDeath45Infinite { get; set; } + int OperatorpvpDeath4EInfinite { get; set; } + int OperatorpvpDeath516Infinite { get; set; } + int OperatorpvpDeath51Infinite { get; set; } + int OperatorpvpDeath52Infinite { get; set; } + int OperatorpvpDeath53Infinite { get; set; } + int OperatorpvpDeath54Infinite { get; set; } + int OperatorpvpDeath55Infinite { get; set; } + int OperatorpvpDeath616Infinite { get; set; } + int OperatorpvpDeath61AInfinite { get; set; } + int OperatorpvpDeath716Infinite { get; set; } + int OperatorpvpDeath816Infinite { get; set; } + int OperatorpvpDeceiverRevealedattackers3FInfinite { get; set; } + int OperatorpvpDocHostagerevive23Infinite { get; set; } + int OperatorpvpDocSelfrevive23Infinite { get; set; } + int OperatorpvpDocTeammaterevive23Infinite { get; set; } + int OperatorpvpEchoEnemySonicburstAffected39Infinite { get; set; } + int OperatorpvpFrostDbno36Infinite { get; set; } + int OperatorpvpFuzeClusterchargekill34Infinite { get; set; } + int OperatorpvpGlazSniperkill24Infinite { get; set; } + int OperatorpvpGlazSniperpenetrationkill24Infinite { get; set; } + int OperatorpvpGoyoVolcandetonate215Infinite { get; set; } + int OperatorpvpGridlockTraxdeployed312Infinite { get; set; } + int OperatorpvpHeadshot11BInfinite { get; set; } + int OperatorpvpHeadshot12Infinite { get; set; } + int OperatorpvpHeadshot15Infinite { get; set; } + int OperatorpvpHeadshot210Infinite { get; set; } + int OperatorpvpHeadshot211Infinite { get; set; } + int OperatorpvpHeadshot212Infinite { get; set; } + int OperatorpvpHeadshot213Infinite { get; set; } + int OperatorpvpHeadshot214Infinite { get; set; } + int OperatorpvpHeadshot215Infinite { get; set; } + int OperatorpvpHeadshot216Infinite { get; set; } + int OperatorpvpHeadshot218Infinite { get; set; } + int OperatorpvpHeadshot219Infinite { get; set; } + int OperatorpvpHeadshot21AInfinite { get; set; } + int OperatorpvpHeadshot21Infinite { get; set; } + int OperatorpvpHeadshot22Infinite { get; set; } + int OperatorpvpHeadshot23Infinite { get; set; } + int OperatorpvpHeadshot24Infinite { get; set; } + int OperatorpvpHeadshot25Infinite { get; set; } + int OperatorpvpHeadshot26Infinite { get; set; } + int OperatorpvpHeadshot27Infinite { get; set; } + int OperatorpvpHeadshot28Infinite { get; set; } + int OperatorpvpHeadshot29Infinite { get; set; } + int OperatorpvpHeadshot2AInfinite { get; set; } + int OperatorpvpHeadshot2BInfinite { get; set; } + int OperatorpvpHeadshot2CInfinite { get; set; } + int OperatorpvpHeadshot2FInfinite { get; set; } + int OperatorpvpHeadshot311Infinite { get; set; } + int OperatorpvpHeadshot312Infinite { get; set; } + int OperatorpvpHeadshot317Infinite { get; set; } + int OperatorpvpHeadshot31Infinite { get; set; } + int OperatorpvpHeadshot32Infinite { get; set; } + int OperatorpvpHeadshot33Infinite { get; set; } + int OperatorpvpHeadshot34Infinite { get; set; } + int OperatorpvpHeadshot35Infinite { get; set; } + int OperatorpvpHeadshot36Infinite { get; set; } + int OperatorpvpHeadshot37Infinite { get; set; } + int OperatorpvpHeadshot38Infinite { get; set; } + int OperatorpvpHeadshot39Infinite { get; set; } + int OperatorpvpHeadshot3AInfinite { get; set; } + int OperatorpvpHeadshot3BInfinite { get; set; } + int OperatorpvpHeadshot3CInfinite { get; set; } + int OperatorpvpHeadshot3DInfinite { get; set; } + int OperatorpvpHeadshot3EInfinite { get; set; } + int OperatorpvpHeadshot3FInfinite { get; set; } + int OperatorpvpHeadshot417Infinite { get; set; } + int OperatorpvpHeadshot41Infinite { get; set; } + int OperatorpvpHeadshot42Infinite { get; set; } + int OperatorpvpHeadshot43Infinite { get; set; } + int OperatorpvpHeadshot44Infinite { get; set; } + int OperatorpvpHeadshot45Infinite { get; set; } + int OperatorpvpHeadshot4EInfinite { get; set; } + int OperatorpvpHeadshot51Infinite { get; set; } + int OperatorpvpHeadshot52Infinite { get; set; } + int OperatorpvpHeadshot53Infinite { get; set; } + int OperatorpvpHeadshot54Infinite { get; set; } + int OperatorpvpHeadshot55Infinite { get; set; } + int OperatorpvpHibanaDetonateProjectile29Infinite { get; set; } + int OperatorpvpIanaKillsafterreplicator219Infinite { get; set; } + int OperatorpvpIqGadgetspotbyef35Infinite { get; set; } + int OperatorpvpJagerGadgetdestroybycatcher45Infinite { get; set; } + int OperatorpvpKaidElectroclawelectrify311Infinite { get; set; } + int OperatorpvpKapkanBoobytrapdeployed44Infinite { get; set; } + int OperatorpvpKapkanBoobytrapkill44Infinite { get; set; } + int OperatorpvpKills116Infinite { get; set; } + int OperatorpvpKills11BInfinite { get; set; } + int OperatorpvpKills12Infinite { get; set; } + int OperatorpvpKills13Infinite { get; set; } + int OperatorpvpKills14Infinite { get; set; } + int OperatorpvpKills15Infinite { get; set; } + int OperatorpvpKills210Infinite { get; set; } + int OperatorpvpKills211Infinite { get; set; } + int OperatorpvpKills212Infinite { get; set; } + int OperatorpvpKills213Infinite { get; set; } + int OperatorpvpKills214Infinite { get; set; } + int OperatorpvpKills215Infinite { get; set; } + int OperatorpvpKills216Infinite { get; set; } + int OperatorpvpKills218Infinite { get; set; } + int OperatorpvpKills219Infinite { get; set; } + int OperatorpvpKills21AInfinite { get; set; } + int OperatorpvpKills21Infinite { get; set; } + int OperatorpvpKills22Infinite { get; set; } + int OperatorpvpKills23Infinite { get; set; } + int OperatorpvpKills24Infinite { get; set; } + int OperatorpvpKills25Infinite { get; set; } + int OperatorpvpKills26Infinite { get; set; } + int OperatorpvpKills27Infinite { get; set; } + int OperatorpvpKills28Infinite { get; set; } + int OperatorpvpKills29Infinite { get; set; } + int OperatorpvpKills2AInfinite { get; set; } + int OperatorpvpKills2BInfinite { get; set; } + int OperatorpvpKills2CInfinite { get; set; } + int OperatorpvpKills2DInfinite { get; set; } + int OperatorpvpKills2FInfinite { get; set; } + int OperatorpvpKills310Infinite { get; set; } + int OperatorpvpKills311Infinite { get; set; } + int OperatorpvpKills312Infinite { get; set; } + int OperatorpvpKills316Infinite { get; set; } + int OperatorpvpKills317Infinite { get; set; } + int OperatorpvpKills31AInfinite { get; set; } + int OperatorpvpKills31Infinite { get; set; } + int OperatorpvpKills32Infinite { get; set; } + int OperatorpvpKills33Infinite { get; set; } + int OperatorpvpKills34Infinite { get; set; } + int OperatorpvpKills35Infinite { get; set; } + int OperatorpvpKills36Infinite { get; set; } + int OperatorpvpKills37Infinite { get; set; } + int OperatorpvpKills38Infinite { get; set; } + int OperatorpvpKills39Infinite { get; set; } + int OperatorpvpKills3AInfinite { get; set; } + int OperatorpvpKills3BInfinite { get; set; } + int OperatorpvpKills3CInfinite { get; set; } + int OperatorpvpKills3DInfinite { get; set; } + int OperatorpvpKills3EInfinite { get; set; } + int OperatorpvpKills3FInfinite { get; set; } + int OperatorpvpKills417Infinite { get; set; } + int OperatorpvpKills41Infinite { get; set; } + int OperatorpvpKills42Infinite { get; set; } + int OperatorpvpKills43Infinite { get; set; } + int OperatorpvpKills44Infinite { get; set; } + int OperatorpvpKills45Infinite { get; set; } + int OperatorpvpKills4EInfinite { get; set; } + int OperatorpvpKills516Infinite { get; set; } + int OperatorpvpKills51Infinite { get; set; } + int OperatorpvpKills52Infinite { get; set; } + int OperatorpvpKills53Infinite { get; set; } + int OperatorpvpKills54Infinite { get; set; } + int OperatorpvpKills55Infinite { get; set; } + int OperatorpvpMaverickWallbreached210Infinite { get; set; } + int OperatorpvpMeleekills11BInfinite { get; set; } + int OperatorpvpMeleekills12Infinite { get; set; } + int OperatorpvpMeleekills15Infinite { get; set; } + int OperatorpvpMeleekills210Infinite { get; set; } + int OperatorpvpMeleekills213Infinite { get; set; } + int OperatorpvpMeleekills219Infinite { get; set; } + int OperatorpvpMeleekills21AInfinite { get; set; } + int OperatorpvpMeleekills22Infinite { get; set; } + int OperatorpvpMeleekills23Infinite { get; set; } + int OperatorpvpMeleekills25Infinite { get; set; } + int OperatorpvpMeleekills26Infinite { get; set; } + int OperatorpvpMeleekills28Infinite { get; set; } + int OperatorpvpMeleekills29Infinite { get; set; } + int OperatorpvpMeleekills2AInfinite { get; set; } + int OperatorpvpMeleekills2BInfinite { get; set; } + int OperatorpvpMeleekills2CInfinite { get; set; } + int OperatorpvpMeleekills2FInfinite { get; set; } + int OperatorpvpMeleekills32Infinite { get; set; } + int OperatorpvpMeleekills33Infinite { get; set; } + int OperatorpvpMeleekills34Infinite { get; set; } + int OperatorpvpMeleekills35Infinite { get; set; } + int OperatorpvpMeleekills36Infinite { get; set; } + int OperatorpvpMeleekills37Infinite { get; set; } + int OperatorpvpMeleekills3CInfinite { get; set; } + int OperatorpvpMeleekills3DInfinite { get; set; } + int OperatorpvpMeleekills3FInfinite { get; set; } + int OperatorpvpMeleekills42Infinite { get; set; } + int OperatorpvpMeleekills43Infinite { get; set; } + int OperatorpvpMeleekills44Infinite { get; set; } + int OperatorpvpMeleekills45Infinite { get; set; } + int OperatorpvpMeleekills4EInfinite { get; set; } + int OperatorpvpMeleekills51Infinite { get; set; } + int OperatorpvpMeleekills52Infinite { get; set; } + int OperatorpvpMeleekills53Infinite { get; set; } + int OperatorpvpMeleekills55Infinite { get; set; } + int OperatorpvpMelusiSloweddown21AInfinite { get; set; } + int OperatorpvpMontagneShieldblockdamage53Infinite { get; set; } + int OperatorpvpMozzieDroneshacked212Infinite { get; set; } + int OperatorpvpMuteGadgetjammed31Infinite { get; set; } + int OperatorpvpMuteJammerdeployed31Infinite { get; set; } + int OperatorpvpNokkObservationtooldeceived213Infinite { get; set; } + int OperatorpvpNomadAirjabdetonate211Infinite { get; set; } + int OperatorpvpPulseHeartbeatassist42Infinite { get; set; } + int OperatorpvpPulseHeartbeatspot42Infinite { get; set; } + int OperatorpvpRookArmorboxdeployed33Infinite { get; set; } + int OperatorpvpRookArmortakenourself33Infinite { get; set; } + int OperatorpvpRookArmortakenteammate33Infinite { get; set; } + int OperatorpvpRoundlost11BInfinite { get; set; } + int OperatorpvpRoundlost11Infinite { get; set; } + int OperatorpvpRoundlost12Infinite { get; set; } + int OperatorpvpRoundlost13Infinite { get; set; } + int OperatorpvpRoundlost14Infinite { get; set; } + int OperatorpvpRoundlost15Infinite { get; set; } + int OperatorpvpRoundlost210Infinite { get; set; } + int OperatorpvpRoundlost211Infinite { get; set; } + int OperatorpvpRoundlost212Infinite { get; set; } + int OperatorpvpRoundlost213Infinite { get; set; } + int OperatorpvpRoundlost214Infinite { get; set; } + int OperatorpvpRoundlost215Infinite { get; set; } + int OperatorpvpRoundlost216Infinite { get; set; } + int OperatorpvpRoundlost218Infinite { get; set; } + int OperatorpvpRoundlost219Infinite { get; set; } + int OperatorpvpRoundlost21AInfinite { get; set; } + int OperatorpvpRoundlost21Infinite { get; set; } + int OperatorpvpRoundlost22Infinite { get; set; } + int OperatorpvpRoundlost23Infinite { get; set; } + int OperatorpvpRoundlost24Infinite { get; set; } + int OperatorpvpRoundlost25Infinite { get; set; } + int OperatorpvpRoundlost26Infinite { get; set; } + int OperatorpvpRoundlost27Infinite { get; set; } + int OperatorpvpRoundlost28Infinite { get; set; } + int OperatorpvpRoundlost29Infinite { get; set; } + int OperatorpvpRoundlost2AInfinite { get; set; } + int OperatorpvpRoundlost2BInfinite { get; set; } + int OperatorpvpRoundlost2CInfinite { get; set; } + int OperatorpvpRoundlost2FInfinite { get; set; } + int OperatorpvpRoundlost311Infinite { get; set; } + int OperatorpvpRoundlost312Infinite { get; set; } + int OperatorpvpRoundlost316Infinite { get; set; } + int OperatorpvpRoundlost317Infinite { get; set; } + int OperatorpvpRoundlost31AInfinite { get; set; } + int OperatorpvpRoundlost31Infinite { get; set; } + int OperatorpvpRoundlost32Infinite { get; set; } + int OperatorpvpRoundlost33Infinite { get; set; } + int OperatorpvpRoundlost34Infinite { get; set; } + int OperatorpvpRoundlost35Infinite { get; set; } + int OperatorpvpRoundlost36Infinite { get; set; } + int OperatorpvpRoundlost37Infinite { get; set; } + int OperatorpvpRoundlost38Infinite { get; set; } + int OperatorpvpRoundlost39Infinite { get; set; } + int OperatorpvpRoundlost3AInfinite { get; set; } + int OperatorpvpRoundlost3BInfinite { get; set; } + int OperatorpvpRoundlost3CInfinite { get; set; } + int OperatorpvpRoundlost3DInfinite { get; set; } + int OperatorpvpRoundlost3EInfinite { get; set; } + int OperatorpvpRoundlost3FInfinite { get; set; } + int OperatorpvpRoundlost416Infinite { get; set; } + int OperatorpvpRoundlost417Infinite { get; set; } + int OperatorpvpRoundlost41AInfinite { get; set; } + int OperatorpvpRoundlost41Infinite { get; set; } + int OperatorpvpRoundlost42Infinite { get; set; } + int OperatorpvpRoundlost43Infinite { get; set; } + int OperatorpvpRoundlost44Infinite { get; set; } + int OperatorpvpRoundlost45Infinite { get; set; } + int OperatorpvpRoundlost4EInfinite { get; set; } + int OperatorpvpRoundlost516Infinite { get; set; } + int OperatorpvpRoundlost51Infinite { get; set; } + int OperatorpvpRoundlost52Infinite { get; set; } + int OperatorpvpRoundlost53Infinite { get; set; } + int OperatorpvpRoundlost54Infinite { get; set; } + int OperatorpvpRoundlost55Infinite { get; set; } + int OperatorpvpRoundlost616Infinite { get; set; } + int OperatorpvpRoundlost61AInfinite { get; set; } + int OperatorpvpRoundlost716Infinite { get; set; } + int OperatorpvpRoundlost816Infinite { get; set; } + int OperatorpvpRoundplayed116Infinite { get; set; } + int OperatorpvpRoundplayed11BInfinite { get; set; } + int OperatorpvpRoundplayed11Infinite { get; set; } + int OperatorpvpRoundplayed12Infinite { get; set; } + int OperatorpvpRoundplayed13Infinite { get; set; } + int OperatorpvpRoundplayed14Infinite { get; set; } + int OperatorpvpRoundplayed15Infinite { get; set; } + int OperatorpvpRoundplayed210Infinite { get; set; } + int OperatorpvpRoundplayed211Infinite { get; set; } + int OperatorpvpRoundplayed212Infinite { get; set; } + int OperatorpvpRoundplayed213Infinite { get; set; } + int OperatorpvpRoundplayed214Infinite { get; set; } + int OperatorpvpRoundplayed215Infinite { get; set; } + int OperatorpvpRoundplayed216Infinite { get; set; } + int OperatorpvpRoundplayed218Infinite { get; set; } + int OperatorpvpRoundplayed219Infinite { get; set; } + int OperatorpvpRoundplayed21AInfinite { get; set; } + int OperatorpvpRoundplayed21Infinite { get; set; } + int OperatorpvpRoundplayed22Infinite { get; set; } + int OperatorpvpRoundplayed23Infinite { get; set; } + int OperatorpvpRoundplayed24Infinite { get; set; } + int OperatorpvpRoundplayed25Infinite { get; set; } + int OperatorpvpRoundplayed26Infinite { get; set; } + int OperatorpvpRoundplayed27Infinite { get; set; } + int OperatorpvpRoundplayed28Infinite { get; set; } + int OperatorpvpRoundplayed29Infinite { get; set; } + int OperatorpvpRoundplayed2AInfinite { get; set; } + int OperatorpvpRoundplayed2BInfinite { get; set; } + int OperatorpvpRoundplayed2CInfinite { get; set; } + int OperatorpvpRoundplayed2DInfinite { get; set; } + int OperatorpvpRoundplayed2FInfinite { get; set; } + int OperatorpvpRoundplayed310Infinite { get; set; } + int OperatorpvpRoundplayed311Infinite { get; set; } + int OperatorpvpRoundplayed312Infinite { get; set; } + int OperatorpvpRoundplayed316Infinite { get; set; } + int OperatorpvpRoundplayed317Infinite { get; set; } + int OperatorpvpRoundplayed31AInfinite { get; set; } + int OperatorpvpRoundplayed31Infinite { get; set; } + int OperatorpvpRoundplayed32Infinite { get; set; } + int OperatorpvpRoundplayed33Infinite { get; set; } + int OperatorpvpRoundplayed34Infinite { get; set; } + int OperatorpvpRoundplayed35Infinite { get; set; } + int OperatorpvpRoundplayed36Infinite { get; set; } + int OperatorpvpRoundplayed37Infinite { get; set; } + int OperatorpvpRoundplayed38Infinite { get; set; } + int OperatorpvpRoundplayed39Infinite { get; set; } + int OperatorpvpRoundplayed3AInfinite { get; set; } + int OperatorpvpRoundplayed3BInfinite { get; set; } + int OperatorpvpRoundplayed3CInfinite { get; set; } + int OperatorpvpRoundplayed3DInfinite { get; set; } + int OperatorpvpRoundplayed3EInfinite { get; set; } + int OperatorpvpRoundplayed3FInfinite { get; set; } + int OperatorpvpRoundplayed416Infinite { get; set; } + int OperatorpvpRoundplayed417Infinite { get; set; } + int OperatorpvpRoundplayed41AInfinite { get; set; } + int OperatorpvpRoundplayed41Infinite { get; set; } + int OperatorpvpRoundplayed42Infinite { get; set; } + int OperatorpvpRoundplayed43Infinite { get; set; } + int OperatorpvpRoundplayed44Infinite { get; set; } + int OperatorpvpRoundplayed45Infinite { get; set; } + int OperatorpvpRoundplayed4EInfinite { get; set; } + int OperatorpvpRoundplayed516Infinite { get; set; } + int OperatorpvpRoundplayed51Infinite { get; set; } + int OperatorpvpRoundplayed52Infinite { get; set; } + int OperatorpvpRoundplayed53Infinite { get; set; } + int OperatorpvpRoundplayed54Infinite { get; set; } + int OperatorpvpRoundplayed55Infinite { get; set; } + int OperatorpvpRoundplayed616Infinite { get; set; } + int OperatorpvpRoundplayed61AInfinite { get; set; } + int OperatorpvpRoundplayed716Infinite { get; set; } + int OperatorpvpRoundplayed816Infinite { get; set; } + int OperatorpvpRoundwon116Infinite { get; set; } + int OperatorpvpRoundwon11BInfinite { get; set; } + int OperatorpvpRoundwon12Infinite { get; set; } + int OperatorpvpRoundwon13Infinite { get; set; } + int OperatorpvpRoundwon14Infinite { get; set; } + int OperatorpvpRoundwon15Infinite { get; set; } + int OperatorpvpRoundwon210Infinite { get; set; } + int OperatorpvpRoundwon211Infinite { get; set; } + int OperatorpvpRoundwon212Infinite { get; set; } + int OperatorpvpRoundwon213Infinite { get; set; } + int OperatorpvpRoundwon214Infinite { get; set; } + int OperatorpvpRoundwon215Infinite { get; set; } + int OperatorpvpRoundwon216Infinite { get; set; } + int OperatorpvpRoundwon218Infinite { get; set; } + int OperatorpvpRoundwon219Infinite { get; set; } + int OperatorpvpRoundwon21AInfinite { get; set; } + int OperatorpvpRoundwon21Infinite { get; set; } + int OperatorpvpRoundwon22Infinite { get; set; } + int OperatorpvpRoundwon23Infinite { get; set; } + int OperatorpvpRoundwon24Infinite { get; set; } + int OperatorpvpRoundwon25Infinite { get; set; } + int OperatorpvpRoundwon26Infinite { get; set; } + int OperatorpvpRoundwon27Infinite { get; set; } + int OperatorpvpRoundwon28Infinite { get; set; } + int OperatorpvpRoundwon29Infinite { get; set; } + int OperatorpvpRoundwon2AInfinite { get; set; } + int OperatorpvpRoundwon2BInfinite { get; set; } + int OperatorpvpRoundwon2CInfinite { get; set; } + int OperatorpvpRoundwon2DInfinite { get; set; } + int OperatorpvpRoundwon2FInfinite { get; set; } + int OperatorpvpRoundwon310Infinite { get; set; } + int OperatorpvpRoundwon311Infinite { get; set; } + int OperatorpvpRoundwon312Infinite { get; set; } + int OperatorpvpRoundwon316Infinite { get; set; } + int OperatorpvpRoundwon317Infinite { get; set; } + int OperatorpvpRoundwon31AInfinite { get; set; } + int OperatorpvpRoundwon31Infinite { get; set; } + int OperatorpvpRoundwon32Infinite { get; set; } + int OperatorpvpRoundwon33Infinite { get; set; } + int OperatorpvpRoundwon34Infinite { get; set; } + int OperatorpvpRoundwon35Infinite { get; set; } + int OperatorpvpRoundwon36Infinite { get; set; } + int OperatorpvpRoundwon37Infinite { get; set; } + int OperatorpvpRoundwon38Infinite { get; set; } + int OperatorpvpRoundwon39Infinite { get; set; } + int OperatorpvpRoundwon3AInfinite { get; set; } + int OperatorpvpRoundwon3BInfinite { get; set; } + int OperatorpvpRoundwon3CInfinite { get; set; } + int OperatorpvpRoundwon3DInfinite { get; set; } + int OperatorpvpRoundwon3FInfinite { get; set; } + int OperatorpvpRoundwon416Infinite { get; set; } + int OperatorpvpRoundwon417Infinite { get; set; } + int OperatorpvpRoundwon41Infinite { get; set; } + int OperatorpvpRoundwon42Infinite { get; set; } + int OperatorpvpRoundwon43Infinite { get; set; } + int OperatorpvpRoundwon44Infinite { get; set; } + int OperatorpvpRoundwon45Infinite { get; set; } + int OperatorpvpRoundwon4EInfinite { get; set; } + int OperatorpvpRoundwon516Infinite { get; set; } + int OperatorpvpRoundwon51Infinite { get; set; } + int OperatorpvpRoundwon52Infinite { get; set; } + int OperatorpvpRoundwon53Infinite { get; set; } + int OperatorpvpRoundwon54Infinite { get; set; } + int OperatorpvpRoundwon55Infinite { get; set; } + int OperatorpvpRoundwon716Infinite { get; set; } + int OperatorpvpRushAdrenalinerush4EInfinite { get; set; } + int OperatorpvpSledgeHammerhole41Infinite { get; set; } + int OperatorpvpSledgeHammerkill41Infinite { get; set; } + int OperatorpvpSmokePoisongaskill21Infinite { get; set; } + int OperatorpvpTachankaTurretdeployed54Infinite { get; set; } + int OperatorpvpTachankaTurretkill54Infinite { get; set; } + int OperatorpvpThatcherGadgetdestroywithemp51Infinite { get; set; } + int OperatorpvpThermiteChargedeployed52Infinite { get; set; } + int OperatorpvpThermiteChargekill52Infinite { get; set; } + int OperatorpvpThermiteReinforcementbreached52Infinite { get; set; } + int OperatorpvpTimeplayed116Infinite { get; set; } + int OperatorpvpTimeplayed11BInfinite { get; set; } + int OperatorpvpTimeplayed11Infinite { get; set; } + int OperatorpvpTimeplayed12Infinite { get; set; } + int OperatorpvpTimeplayed13Infinite { get; set; } + int OperatorpvpTimeplayed14Infinite { get; set; } + int OperatorpvpTimeplayed15Infinite { get; set; } + int OperatorpvpTimeplayed210Infinite { get; set; } + int OperatorpvpTimeplayed211Infinite { get; set; } + int OperatorpvpTimeplayed212Infinite { get; set; } + int OperatorpvpTimeplayed213Infinite { get; set; } + int OperatorpvpTimeplayed214Infinite { get; set; } + int OperatorpvpTimeplayed215Infinite { get; set; } + int OperatorpvpTimeplayed216Infinite { get; set; } + int OperatorpvpTimeplayed218Infinite { get; set; } + int OperatorpvpTimeplayed219Infinite { get; set; } + int OperatorpvpTimeplayed21AInfinite { get; set; } + int OperatorpvpTimeplayed21Infinite { get; set; } + int OperatorpvpTimeplayed22Infinite { get; set; } + int OperatorpvpTimeplayed23Infinite { get; set; } + int OperatorpvpTimeplayed24Infinite { get; set; } + int OperatorpvpTimeplayed25Infinite { get; set; } + int OperatorpvpTimeplayed26Infinite { get; set; } + int OperatorpvpTimeplayed27Infinite { get; set; } + int OperatorpvpTimeplayed28Infinite { get; set; } + int OperatorpvpTimeplayed29Infinite { get; set; } + int OperatorpvpTimeplayed2AInfinite { get; set; } + int OperatorpvpTimeplayed2BInfinite { get; set; } + int OperatorpvpTimeplayed2CInfinite { get; set; } + int OperatorpvpTimeplayed2DInfinite { get; set; } + int OperatorpvpTimeplayed2FInfinite { get; set; } + int OperatorpvpTimeplayed310Infinite { get; set; } + int OperatorpvpTimeplayed311Infinite { get; set; } + int OperatorpvpTimeplayed312Infinite { get; set; } + int OperatorpvpTimeplayed316Infinite { get; set; } + int OperatorpvpTimeplayed317Infinite { get; set; } + int OperatorpvpTimeplayed31AInfinite { get; set; } + int OperatorpvpTimeplayed31Infinite { get; set; } + int OperatorpvpTimeplayed32Infinite { get; set; } + int OperatorpvpTimeplayed33Infinite { get; set; } + int OperatorpvpTimeplayed34Infinite { get; set; } + int OperatorpvpTimeplayed35Infinite { get; set; } + int OperatorpvpTimeplayed36Infinite { get; set; } + int OperatorpvpTimeplayed37Infinite { get; set; } + int OperatorpvpTimeplayed38Infinite { get; set; } + int OperatorpvpTimeplayed39Infinite { get; set; } + int OperatorpvpTimeplayed3AInfinite { get; set; } + int OperatorpvpTimeplayed3BInfinite { get; set; } + int OperatorpvpTimeplayed3CInfinite { get; set; } + int OperatorpvpTimeplayed3DInfinite { get; set; } + int OperatorpvpTimeplayed3EInfinite { get; set; } + int OperatorpvpTimeplayed3FInfinite { get; set; } + int OperatorpvpTimeplayed416Infinite { get; set; } + int OperatorpvpTimeplayed417Infinite { get; set; } + int OperatorpvpTimeplayed41AInfinite { get; set; } + int OperatorpvpTimeplayed41Infinite { get; set; } + int OperatorpvpTimeplayed42Infinite { get; set; } + int OperatorpvpTimeplayed43Infinite { get; set; } + int OperatorpvpTimeplayed44Infinite { get; set; } + int OperatorpvpTimeplayed45Infinite { get; set; } + int OperatorpvpTimeplayed4EInfinite { get; set; } + int OperatorpvpTimeplayed516Infinite { get; set; } + int OperatorpvpTimeplayed51Infinite { get; set; } + int OperatorpvpTimeplayed52Infinite { get; set; } + int OperatorpvpTimeplayed53Infinite { get; set; } + int OperatorpvpTimeplayed54Infinite { get; set; } + int OperatorpvpTimeplayed55Infinite { get; set; } + int OperatorpvpTimeplayed616Infinite { get; set; } + int OperatorpvpTimeplayed61AInfinite { get; set; } + int OperatorpvpTimeplayed716Infinite { get; set; } + int OperatorpvpTimeplayed816Infinite { get; set; } + int OperatorpvpTotalxp116Infinite { get; set; } + int OperatorpvpTotalxp11BInfinite { get; set; } + int OperatorpvpTotalxp11Infinite { get; set; } + int OperatorpvpTotalxp12Infinite { get; set; } + int OperatorpvpTotalxp13Infinite { get; set; } + int OperatorpvpTotalxp14Infinite { get; set; } + int OperatorpvpTotalxp15Infinite { get; set; } + int OperatorpvpTotalxp210Infinite { get; set; } + int OperatorpvpTotalxp211Infinite { get; set; } + int OperatorpvpTotalxp212Infinite { get; set; } + int OperatorpvpTotalxp213Infinite { get; set; } + int OperatorpvpTotalxp214Infinite { get; set; } + int OperatorpvpTotalxp215Infinite { get; set; } + int OperatorpvpTotalxp216Infinite { get; set; } + int OperatorpvpTotalxp218Infinite { get; set; } + int OperatorpvpTotalxp219Infinite { get; set; } + int OperatorpvpTotalxp21AInfinite { get; set; } + int OperatorpvpTotalxp21Infinite { get; set; } + int OperatorpvpTotalxp22Infinite { get; set; } + int OperatorpvpTotalxp23Infinite { get; set; } + int OperatorpvpTotalxp24Infinite { get; set; } + int OperatorpvpTotalxp25Infinite { get; set; } + int OperatorpvpTotalxp26Infinite { get; set; } + int OperatorpvpTotalxp27Infinite { get; set; } + int OperatorpvpTotalxp28Infinite { get; set; } + int OperatorpvpTotalxp29Infinite { get; set; } + int OperatorpvpTotalxp2AInfinite { get; set; } + int OperatorpvpTotalxp2BInfinite { get; set; } + int OperatorpvpTotalxp2CInfinite { get; set; } + int OperatorpvpTotalxp2DInfinite { get; set; } + int OperatorpvpTotalxp2FInfinite { get; set; } + int OperatorpvpTotalxp310Infinite { get; set; } + int OperatorpvpTotalxp311Infinite { get; set; } + int OperatorpvpTotalxp312Infinite { get; set; } + int OperatorpvpTotalxp316Infinite { get; set; } + int OperatorpvpTotalxp317Infinite { get; set; } + int OperatorpvpTotalxp31AInfinite { get; set; } + int OperatorpvpTotalxp31Infinite { get; set; } + int OperatorpvpTotalxp32Infinite { get; set; } + int OperatorpvpTotalxp33Infinite { get; set; } + int OperatorpvpTotalxp34Infinite { get; set; } + int OperatorpvpTotalxp35Infinite { get; set; } + int OperatorpvpTotalxp36Infinite { get; set; } + int OperatorpvpTotalxp37Infinite { get; set; } + int OperatorpvpTotalxp38Infinite { get; set; } + int OperatorpvpTotalxp39Infinite { get; set; } + int OperatorpvpTotalxp3AInfinite { get; set; } + int OperatorpvpTotalxp3BInfinite { get; set; } + int OperatorpvpTotalxp3CInfinite { get; set; } + int OperatorpvpTotalxp3DInfinite { get; set; } + int OperatorpvpTotalxp3EInfinite { get; set; } + int OperatorpvpTotalxp3FInfinite { get; set; } + int OperatorpvpTotalxp416Infinite { get; set; } + int OperatorpvpTotalxp417Infinite { get; set; } + int OperatorpvpTotalxp41AInfinite { get; set; } + int OperatorpvpTotalxp41Infinite { get; set; } + int OperatorpvpTotalxp42Infinite { get; set; } + int OperatorpvpTotalxp43Infinite { get; set; } + int OperatorpvpTotalxp44Infinite { get; set; } + int OperatorpvpTotalxp45Infinite { get; set; } + int OperatorpvpTotalxp4EInfinite { get; set; } + int OperatorpvpTotalxp516Infinite { get; set; } + int OperatorpvpTotalxp51Infinite { get; set; } + int OperatorpvpTotalxp52Infinite { get; set; } + int OperatorpvpTotalxp53Infinite { get; set; } + int OperatorpvpTotalxp54Infinite { get; set; } + int OperatorpvpTotalxp55Infinite { get; set; } + int OperatorpvpTotalxp61AInfinite { get; set; } + int OperatorpvpTotalxp716Infinite { get; set; } + int OperatorpvpTotalxp816Infinite { get; set; } + int OperatorpvpTwitchGadgetdestroybyshockdrone43Infinite { get; set; } + int OperatorpvpValkyrieCamdeployed37Infinite { get; set; } + int OperatorpvpWamaiGadgetdestroybymagnet317Infinite { get; set; } + int OperatorpvpWardenKillswithglasses214Infinite { get; set; } + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/StatisticInterface/IQueueStatistic.cs b/R6DataAccess/Interfaces/StatisticInterface/IQueueStatistic.cs new file mode 100644 index 0000000..3e8c16d --- /dev/null +++ b/R6DataAccess/Interfaces/StatisticInterface/IQueueStatistic.cs @@ -0,0 +1,69 @@ +namespace R6DataAccess.Models + +{ + public interface IQueueStatistic + { + int CasualpvpDeathInfinite { get; set; } + int CasualpvpKillsInfinite { get; set; } + int CasualpvpMatchlostInfinite { get; set; } + int CasualpvpMatchplayedInfinite { get; set; } + int CasualpvpMatchwonInfinite { get; set; } + int GeneralpveBarricadedeployedInfinite { get; set; } + int GeneralpveBlindkillsInfinite { get; set; } + int GeneralpveBulletfiredInfinite { get; set; } + int GeneralpveBullethitInfinite { get; set; } + int GeneralpveDeathInfinite { get; set; } + int GeneralpveDistancetravelledInfinite { get; set; } + int GeneralpveGadgetdestroyInfinite { get; set; } + int GeneralpveHeadshotInfinite { get; set; } + int GeneralpveHostagedefenseInfinite { get; set; } + int GeneralpveHostagerescueInfinite { get; set; } + int GeneralpveKillassistsInfinite { get; set; } + int GeneralpveKillsInfinite { get; set; } + int GeneralpveMatchlostInfinite { get; set; } + int GeneralpveMatchplayedInfinite { get; set; } + int GeneralpveMatchwonInfinite { get; set; } + int GeneralpveMeleekillsInfinite { get; set; } + int GeneralpvePenetrationkillsInfinite { get; set; } + int GeneralpveReinforcementdeployInfinite { get; set; } + int GeneralpveReviveInfinite { get; set; } + int GeneralpveServershackedInfinite { get; set; } + int GeneralpveSuicideInfinite { get; set; } + int GeneralpveTimeplayedInfinite { get; set; } + int GeneralpvpBarricadedeployedInfinite { get; set; } + int GeneralpvpBlindkillsInfinite { get; set; } + int GeneralpvpBullethitInfinite { get; set; } + int GeneralpvpDbnoassistsInfinite { get; set; } + int GeneralpvpDbnoInfinite { get; set; } + int GeneralpvpDeathInfinite { get; set; } + int GeneralpvpDistancetravelledInfinite { get; set; } + int GeneralpvpGadgetdestroyInfinite { get; set; } + int GeneralpvpHeadshotInfinite { get; set; } + int GeneralpvpHostagedefenseInfinite { get; set; } + int GeneralpvpHostagerescueInfinite { get; set; } + int GeneralpvpKillassistsInfinite { get; set; } + int GeneralpvpKillsInfinite { get; set; } + int GeneralpvpMatchlostInfinite { get; set; } + int GeneralpvpMatchplayedInfinite { get; set; } + int GeneralpvpMatchwonInfinite { get; set; } + int GeneralpvpMeleekillsInfinite { get; set; } + int GeneralpvpPenetrationkillsInfinite { get; set; } + int GeneralpvpReinforcementdeployInfinite { get; set; } + int GeneralpvpReviveInfinite { get; set; } + int GeneralpvpServeraggressionInfinite { get; set; } + int GeneralpvpServerdefenderInfinite { get; set; } + int GeneralpvpServershackedInfinite { get; set; } + int GeneralpvpSuicideInfinite { get; set; } + int GeneralpvpTimeplayedInfinite { get; set; } + int NormalpvpMatchplayedInfinite { get; set; } + int NormalpvpMatchwonInfinite { get; set; } + int RankedpvpDeathInfinite { get; set; } + double RankedpvpKdratio { get; set; } + int RankedpvpKillsInfinite { get; set; } + int RankedpvpMatchlostInfinite { get; set; } + int RankedpvpMatchplayedInfinite { get; set; } + double RankedpvpMatchwlratio { get; set; } + int RankedpvpMatchwonInfinite { get; set; } + int RankedpvpTimeplayedInfinite { get; set; } + } +} \ No newline at end of file diff --git a/R6DataAccess/Interfaces/StatisticInterface/ITerroristHuntMissionStatistic.cs b/R6DataAccess/Interfaces/StatisticInterface/ITerroristHuntMissionStatistic.cs new file mode 100644 index 0000000..24cf02c --- /dev/null +++ b/R6DataAccess/Interfaces/StatisticInterface/ITerroristHuntMissionStatistic.cs @@ -0,0 +1,15 @@ +namespace R6DataAccess.Models +{ + public interface ITerroristHuntMissionStatistic + { + int AllterrohuntcoopHardBestscoreInfinite { get; set; } + int AllterrohuntcoopNormalBestscoreInfinite { get; set; } + int AllterrohuntcoopRealisticBestscoreInfinite { get; set; } + int AllterrohuntsoloHardBestscoreInfinite { get; set; } + int AllterrohuntsoloNormalBestscoreInfinite { get; set; } + int MissionsoloNormalBestscoreInfinite { get; set; } + int TerrohuntclassicpveMatchlostInfinite { get; set; } + int TerrohuntclassicpveMatchplayedInfinite { get; set; } + int TerrohuntclassicpveMatchwonInfinite { get; set; } + } +} \ No newline at end of file diff --git a/R6DataAccess/Models/Auth.cs b/R6DataAccess/Models/Auth.cs new file mode 100644 index 0000000..cb90f2d --- /dev/null +++ b/R6DataAccess/Models/Auth.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccess.Models +{ + public class Auth : IAuth + { + + private string _email; + private string _password; + private bool? _rememberMe; + + public Auth(string email, string password, bool? rememberMe) + { + _email = email; + _password = password; + _rememberMe = rememberMe; + + validateAuth(); + } + + private void validateAuth() + { + if (string.IsNullOrWhiteSpace(_email)) + { + throw new ArgumentNullException(this.GetType().FullName, "Email address cannot be null or empty."); + } + else if (string.IsNullOrWhiteSpace(_password)) + { + throw new ArgumentNullException(this.GetType().FullName, "Password cannot be null or empty."); + } + + } + + public string GetCredentialBase64() + { + + // Generate an auth for acquiring a token + var auth = $"{_email}:{_password}"; + var bytes = Encoding.UTF8.GetBytes(auth); + + return Convert.ToBase64String(bytes); + } + } +} diff --git a/R6Sharp/Response/BoardInfo.cs b/R6DataAccess/Models/BoardInfo.cs similarity index 95% rename from R6Sharp/Response/BoardInfo.cs rename to R6DataAccess/Models/BoardInfo.cs index 0faaa96..e884379 100644 --- a/R6Sharp/Response/BoardInfo.cs +++ b/R6DataAccess/Models/BoardInfo.cs @@ -1,16 +1,21 @@ using System; using System.Collections.Generic; +using System.Text; using System.Text.Json.Serialization; -namespace R6Sharp.Response +namespace R6DataAccess.Models { public class BoardInfoFetch { + + [JsonPropertyName("players")] public Dictionary Players { get; set; } } - public class BoardInfo + + + public class BoardInfo : IBoardInfo { [JsonPropertyName("kills")] public int Kills { get; set; } @@ -81,4 +86,4 @@ public class BoardInfo [JsonPropertyName("profile_id")] public Guid ProfileId { get; set; } } -} \ No newline at end of file +} diff --git a/R6DataAccess/Models/EndPoints.cs b/R6DataAccess/Models/EndPoints.cs new file mode 100644 index 0000000..3391e18 --- /dev/null +++ b/R6DataAccess/Models/EndPoints.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccess.Models +{ + sealed class EndPoints : IEndPoints + { + + // API access + public static IEndPoints Base => new EndPoints() { Url = "https://game-rainbow6.ubi.com", Name = "Base" }; + public static IEndPoints Sessions => new EndPoints() { Url = "https://public-ubiservices.ubi.com/v3/profiles/sessions", Name= "Session" }; + public static IEndPoints Search => new EndPoints() { Url = "https://public-ubiservices.ubi.com/v2/profiles" , Name="Search"}; + + // These endpoints need to be formatted to correct space uuids (uplay, psn, xbl) + public static IEndPoints Progressions => new EndPoints() + { Url = "https://public-ubiservices.ubi.com/v1/spaces/{0}/sandboxes/{1}/r6playerprofile/playerprofile/progressions", Name= "Progression" }; + public static IEndPoints Players => new EndPoints() { Url = "https://public-ubiservices.ubi.com/v1/spaces/{0}/sandboxes/{1}/r6karma/players" , Name="Players"}; + public static IEndPoints Statistics => new EndPoints() { Url = "https://public-ubiservices.ubi.com/v1/spaces/{0}/sandboxes/{1}/playerstats2/statistics", Name = "Statistics" }; + + // These are metadata endpoints, places where static data is stored + public static IEndPoints Avatar => new EndPoints() { Url = "https://ubisoft-avatars.akamaized.net/{0}/default_146_146.png?appId={1}", Name = "Avatar" }; + public static IEndPoints Seasons => new EndPoints() { Url = "https://game-rainbow6.ubi.com/assets/data/seasons.152c15ea.json", Name="Seasons" }; + public static IEndPoints Locales => new EndPoints() { Url = "https://game-rainbow6.ubi.com/assets/locales/locale.{0}.{1}.json", Name="Locales" }; + public static IEndPoints Ranks => new EndPoints() { Url = "https://game-rainbow6.ubi.com/assets/data/ranks.754ab452.json" , Name="Ranks"}; + public static IEndPoints Operators => new EndPoints() { Url = "https://game-rainbow6.ubi.com/assets/data/operators.f660ac39.json" , Name = "Operators"}; + public static IEndPoints Weapons => new EndPoints() { Url = "https://game-rainbow6.ubi.com/assets/data/weapons.8a9b3d9e.json" , Name = "Weapons" }; + public string Url { get; set; } + + public string Name { get; set; } + } +} diff --git a/R6DataAccess/Models/HttpError.cs b/R6DataAccess/Models/HttpError.cs new file mode 100644 index 0000000..92fd651 --- /dev/null +++ b/R6DataAccess/Models/HttpError.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.Json.Serialization; + +namespace R6DataAccess.Models +{ + public class HttpError + { + + [JsonPropertyName("message")] + public string Message { get; set; } + + + [JsonPropertyName("errorCode")] + public int ErrorCode { get; set; } + + [JsonPropertyName("httpCode")] + public int HttpCode { get; set; } + [JsonPropertyName("errorContext")] + public string ErrorContext { get; set; } + [JsonPropertyName("moreInfo")] + public string MoreInfo { get; set; } + [JsonPropertyName("transactionTime")] + public string TransactionTime { get; set; } + } +} diff --git a/R6DataAccess/Models/Language.cs b/R6DataAccess/Models/Language.cs new file mode 100644 index 0000000..b937bdc --- /dev/null +++ b/R6DataAccess/Models/Language.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccess.Models +{ + public class Language : ILanguage + { + //public static ILanguage AmericanEnglish + //{ get { return new Language() { ShortHand = "en-us", LocalHash = "6eb4f5cd" }; } } + + //public static ILanguage AustralianEnglish + //{ get { return new Language() { ShortHand = "en-au", LocalHash = null }; } } + + + + //public static ILanguage BrazilianPortuguese + //{ get { return new Language() { ShortHand = "pt - br", LocalHash = "7ad95128" }; } } + + //public static ILanguage BritishEnglish + //{ get { return new Language() { ShortHand = "en-gb", LocalHash = null }; } } + + //public static ILanguage CanadianFrench + //{ get { return new Language() { ShortHand = "fr-ca", LocalHash = null }; } } + + //public static ILanguage Czech + //{ get { return new Language() { ShortHand = "cs-cz", LocalHash = "dc66e300" }; } } + + //public static ILanguage Dutch + //{ get { return new Language() { ShortHand = "nl-nl", LocalHash = "80a0b37a" }; } } + //public static ILanguage EuropeanFrench + //{ get { return new Language() { ShortHand = "fr-fr", LocalHash = "4f78c986" }; } } + //public static ILanguage EuropeanSpanish + //{ get { return new Language() { ShortHand = "es-es", LocalHash = "5e27d9fa" }; } } + + //public static ILanguage German + //{ get { return new Language() { ShortHand = "de-de", LocalHash = "47a861dd" }; } } + //public static ILanguage Italian + //{ get { return new Language() { ShortHand = "it-it", LocalHash = "4ac66a00" }; } } + + //public static ILanguage Japanese + //{ get { return new Language() { ShortHand = "ja-jp", LocalHash = "30330c03" }; } } + //public static ILanguage Korean + //{ get { return new Language() { ShortHand = "ko-kr", LocalHash = "31170d10" }; } } + //public static ILanguage LatinSpanish + //{ get { return new Language() { ShortHand = "es-mx", LocalHash = "979289ed" }; } } + + + //public static ILanguage NordicEnglish + //{ get { return new Language() { ShortHand = "en-nordic", LocalHash = null }; } } + + //public static ILanguage Polish + //{ get { return new Language() { ShortHand = "pl-pl", LocalHash = "845c3d39" }; } } + //public static ILanguage Russian + //{ get { return new Language() { ShortHand = "ru-ru", LocalHash = "22e559b7" }; } } + + //public static ILanguage SimplifiedChinese + //{ get { return new Language() { ShortHand = "zh-cn", LocalHash = "23f064e8" }; } } + //public static ILanguage TraditionalChinese + //{ get { return new Language() { ShortHand = "zh-tw", LocalHash = "52f0c5ec" }; } } + + public string LocalHash { get; set; } + + public string ShortHand { get; set; } + } +} diff --git a/R6DataAccess/Models/Platform.cs b/R6DataAccess/Models/Platform.cs new file mode 100644 index 0000000..1ddcd24 --- /dev/null +++ b/R6DataAccess/Models/Platform.cs @@ -0,0 +1,42 @@ +using R6DataAccess.Interfaces; +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccess.Models +{ + public class Platform : IPlatform + { + + public static IPlatform UPLAY => new Platform + { + Name = "uplay", + Guid = Guid.Parse("5172a557-50b5-4665-b7db-e3f2e8c5041d"), + SandBox = "OSBOR_PC_LNCH_A" + + + }; + + public static IPlatform PSN => new Platform + { + Name = "psn", + Guid = Guid.Parse("05bfb3f7-6c21-4c42-be1f-97a33fb5cf66"), + SandBox = "OSBOR_PS4_LNCH_A" + + }; + + public static IPlatform XBL => new Platform + { + Name = "xbl", + Guid= Guid.Parse("98a601e5-ca91-4440-b1c5-753f601a2c90"), + SandBox = "OSBOR_XBOXONE_LNCH_A" + }; + + + public string Name { get; set; } + + public Guid Guid { get; set; } + + public string SandBox { get; set; } + } +} diff --git a/R6Sharp/Response/PlayerProgression.cs b/R6DataAccess/Models/PlayerProgression.cs similarity index 58% rename from R6Sharp/Response/PlayerProgression.cs rename to R6DataAccess/Models/PlayerProgression.cs index 0acb587..40282d0 100644 --- a/R6Sharp/Response/PlayerProgression.cs +++ b/R6DataAccess/Models/PlayerProgression.cs @@ -1,17 +1,20 @@ using System; using System.Collections.Generic; +using System.Text; using System.Text.Json.Serialization; -namespace R6Sharp.Response +namespace R6DataAccess.Models { - public class PlayerProgressionFetch + public class PlayerProgression : IPlayerProgression { - [JsonPropertyName("player_profiles")] - public List PlayerProgressions { get; set; } - } - public class PlayerProgression - { + public class PlayerProgressionFetch + { + [JsonPropertyName("player_profiles")] + public List PlayerProgressions { get; set; } + } + + [JsonPropertyName("xp")] public int XP { get; set; } @@ -24,6 +27,7 @@ public class PlayerProgression [JsonPropertyName("level")] public int Level { get; set; } - public Uri ProfileIcon { get; set; } + + } -} \ No newline at end of file +} diff --git a/R6Sharp/Response/Profile.cs b/R6DataAccess/Models/Profile.cs similarity index 58% rename from R6Sharp/Response/Profile.cs rename to R6DataAccess/Models/Profile.cs index e30021a..9a9cfe7 100644 --- a/R6Sharp/Response/Profile.cs +++ b/R6DataAccess/Models/Profile.cs @@ -1,16 +1,12 @@ -using System; +using R6DataAccess.Models; +using System; using System.Collections.Generic; using System.Text.Json.Serialization; namespace R6Sharp.Response { - public class ProfileSearch - { - [JsonPropertyName("profiles")] - public List Profiles { get; set; } - } - public class Profile + public class Profile : IProfile { [JsonPropertyName("profileId")] public Guid ProfileId { get; set; } @@ -26,5 +22,23 @@ public class Profile [JsonPropertyName("nameOnPlatform")] public string NameOnPlatform { get; set; } + + + private Guid Rainbow6S = Guid.Parse("39baebad-39e5-4552-8c25-2c9b919064e2"); + + // need to double check where else rainbow6s is being used + public Uri ProfileIcon { + get { + return new Uri(string.Format(EndPoints.Avatar.Url, ProfileId, Rainbow6S)); + } + } } + + public class ProfileSearch + { + [JsonPropertyName("profiles")] + public List Profiles { get; set; } + + } + } diff --git a/R6DataAccess/Models/Query.cs b/R6DataAccess/Models/Query.cs new file mode 100644 index 0000000..efdb914 --- /dev/null +++ b/R6DataAccess/Models/Query.cs @@ -0,0 +1,44 @@ +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace R6Sharp.Models +{ + public class Query : IQuery + { + + [JsonPropertyName("nameOnPlatform")] + public string NameOnPlatform { get; set; } + + [JsonPropertyName("platformType")] + public IPlatform PlatformType { get; set; } + + [JsonPropertyName("idOnPlatform")] + public string IdOnPlatform { get ; set ; } + + [JsonPropertyName("profile_ids")] + public string ProfileId { get ; set ; } + + [JsonPropertyName("board_id")] + public string BoardId { get ; set ; } + + [JsonPropertyName("region_id")] + public IRegion Region { get ; set ; } + + [JsonPropertyName("season_id")] + public string SeasonId { get ; set ; } + + [JsonPropertyName("populations")] + public string Population { get ; set ; } + + [JsonPropertyName("statistics")] + public string Statistics { get ; set ; } + + + } +} diff --git a/R6DataAccess/Models/Region.cs b/R6DataAccess/Models/Region.cs new file mode 100644 index 0000000..c76ac30 --- /dev/null +++ b/R6DataAccess/Models/Region.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccess.Models +{ + public class Region:IRegion + { + /// + /// Region the player is based in. + /// + + public static IRegion APAC { get; } = new Region { Name = "apac" }; // Asia Pacific :( + + public static IRegion EMEA { get; } = new Region { Name = "emea" };// Europe, Middle East and Africa + + public static IRegion NCSA { get; } = new Region { Name = "ncsa" }; // North, Central and South America + + public string Name { get; private set; } + } + + +} diff --git a/R6DataAccess/Models/Request.cs b/R6DataAccess/Models/Request.cs new file mode 100644 index 0000000..81a2c50 --- /dev/null +++ b/R6DataAccess/Models/Request.cs @@ -0,0 +1,106 @@ +using R6DataAccess.Builder.BuildHelper; +using R6Sharp.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace R6DataAccess.Models +{ + public class Request : IRequest + { + + + + private readonly IEndPoints _endPoints; + + private readonly IQuery _query; + + private readonly ILanguage _language; + + + + public string URL { get; set; } + + //endpoints that require more information passed + //such as platform guid and sandbox + private string[] endPointsThatRequireFormat() + { + + return new string[] { + EndPoints.Progressions.Name , + EndPoints.Players.Name, + EndPoints.Statistics.Name + }; + } + + private string getFullEndpoint() + { + + var endPointName = _endPoints.Name; + + // yhp, cant come up with a name + var endpointsWithMoreInfo = endPointsThatRequireFormat(); + + if (endpointsWithMoreInfo.Contains(endPointName)) + { + + return string.Format(_endPoints.Url, _query.PlatformType.Guid, _query.PlatformType.SandBox); + } + else + { + + return _endPoints.Url; + } + + + } + public Request(IEndPoints endPoints, IQuery query) + { + _endPoints = endPoints; + _query = query; + setUpUrlWithQuery(); + } + public Request(IEndPoints endPoints, ILanguage language) + { + _endPoints = endPoints; + _language = language; + updateEndpointLanguage(); + + + + } + public Request(IEndPoints endPoints) + { + _endPoints = endPoints; + + URL = _endPoints.Url; + + + } + + + private void setUpUrlWithQuery() + { + var queryString = QueryHelper.GetQueryString(_query, _endPoints); + + + URL = $"{getFullEndpoint()}?{queryString}"; + } + + + private void updateEndpointLanguage() + { + URL = string.Format(_endPoints.Url, _language.ShortHand, _language.LocalHash); + } + + public Uri GetEndPointUri() + { + + + return new Uri(URL); + } + + + } +} diff --git a/R6DataAccess/Models/Session.cs b/R6DataAccess/Models/Session.cs new file mode 100644 index 0000000..54f3b6a --- /dev/null +++ b/R6DataAccess/Models/Session.cs @@ -0,0 +1,42 @@ +using System; +using System.Text.Json.Serialization; + +namespace R6Sharp.Response +{ + public class Session : ISession + { + [JsonPropertyName("platformType")] + public string PlatformType { get ; set; } + + [JsonPropertyName("ticket")] + public string Ticket { get ; set ; } + [JsonPropertyName("profileId")] + public Guid ProfileId { get ; set ; } + [JsonPropertyName("userId")] + public Guid UserId { get ; set; } + [JsonPropertyName("nameOnPlatform")] + public string NameOnPlatform { get ; set ; } + [JsonPropertyName("environment")] + public string Environment { get ; set ; } + [JsonPropertyName("expiration")] + public DateTime Expiration { get ; set ; } + [JsonPropertyName("clientIp")] + public string ClientIp { get ; set ; } + [JsonPropertyName("clientIpCountry")] + public string ClientIpCountry { get ; set ; } + [JsonPropertyName("serverTime")] + public DateTime ServerTime { get ; set ; } + [JsonPropertyName("sessionId")] + public Guid SessionId { get ; set ; } + + [JsonPropertyName("sessionKey")] + public string SessionKey { get ; set; } + [JsonPropertyName("twoFactorAuthenticationTicket")] + +#nullable enable + public string? TwoFactorAuthenticationTicket { get ; set ; } + [JsonPropertyName("rememberMeTicket")] + public string? RememberMeTicket { get; set ; } +#nullable disable + } +} diff --git a/R6Sharp/Response/Static/Rank.cs b/R6DataAccess/Models/Static/Rank.cs similarity index 75% rename from R6Sharp/Response/Static/Rank.cs rename to R6DataAccess/Models/Static/Rank.cs index 3203512..7247cfe 100644 --- a/R6Sharp/Response/Static/Rank.cs +++ b/R6DataAccess/Models/Static/Rank.cs @@ -1,4 +1,6 @@ -using System.Collections.Generic; +using R6DataAccess.Converter; +using R6DataAccess.Models; +using System.Collections.Generic; using System.Text.Json.Serialization; namespace R6Sharp.Response.Static @@ -38,7 +40,7 @@ public class SeasonDetail public class Division { [JsonPropertyName("id")] - [JsonConverter(typeof(ApiHelper.ParseStringToId))] + [JsonConverter(typeof(ParseStringToRankId))] public RankId Id { get; set; } [JsonPropertyName("name")] @@ -60,7 +62,7 @@ public class Rank public Name Name { get; set; } [JsonPropertyName("images")] - public Images Images { get; set; } + public Images Images { get; set; } [JsonPropertyName("range")] public List Range { get; set; } @@ -68,10 +70,14 @@ public class Rank public class Images { + private string _default; + [JsonPropertyName("default")] - public string Default { get; set; } + public string Default { get { return _default; } set { _default = $"{EndPoints.Base.Url}/{value}"; } } + + private string _hd; [JsonPropertyName("hd")] - public string Hd { get; set; } + public string Hd { get { return _hd; } set { _hd = $"{EndPoints.Base.Url}/{value}"; } } } } \ No newline at end of file diff --git a/R6Sharp/Response/Static/Season.cs b/R6DataAccess/Models/Static/Season.cs similarity index 62% rename from R6Sharp/Response/Static/Season.cs rename to R6DataAccess/Models/Static/Season.cs index 6424a6b..d81c051 100644 --- a/R6Sharp/Response/Static/Season.cs +++ b/R6DataAccess/Models/Static/Season.cs @@ -1,5 +1,8 @@ -using System; +using R6DataAccess.Converter; +using R6DataAccess.Models; +using System; using System.Collections.Generic; +using System.ComponentModel; using System.Text.Json.Serialization; namespace R6Sharp.Response.Static @@ -9,8 +12,11 @@ public class SeasonsInfo [JsonPropertyName("seasons")] public Dictionary Seasons { get; set; } + + + [JsonPropertyName("latestSeason")] - [JsonConverter(typeof(ApiHelper.ParseStringToInt))] + [JsonConverter(typeof(ParseStringToInt))] public int LatestSeason { get; set; } } @@ -21,7 +27,10 @@ public class Season [JsonPropertyName("name")] public string Name { get; set; } + + private string _background; + [JsonPropertyName("background")] - public Uri Background { get; set; } + public string Background { get { return _background; } set { _background = $"{EndPoints.Base.Url}/{value}"; } } } } diff --git a/R6DataAccess/Models/Static/StatisticStatics/EquipmentStatisticStatics.cs b/R6DataAccess/Models/Static/StatisticStatics/EquipmentStatisticStatics.cs new file mode 100644 index 0000000..ccbfa14 --- /dev/null +++ b/R6DataAccess/Models/Static/StatisticStatics/EquipmentStatisticStatics.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccess.Models.Static +{ + public static class EquipmentStatisticStatics + { + + private const string GadgetPve = "gadgetpve_chosen,gadgetpve_gadgetdestroy,gadgetpve_kills,gadgetpve_mostused"; + private const string GadgetPvp = "gadgetpvp_chosen,gadgetpvp_gadgetdestroy,gadgetpvp_kills,gadgetpvp_mostused"; + private const string WeaponPve = "weaponpve_mostkills,weaponpve_mostused"; + private const string WeaponPvp = "weaponpvp_mostkills,weaponpvp_mostused"; + private const string WeaponTypePve = "weapontypepve_accuracy,weapontypepve_bulletfired,weapontypepve_bullethit,weapontypepve_chosen,weapontypepve_dbno,weapontypepve_dbnoassists,weapontypepve_death,weapontypepve_deaths,weapontypepve_efficiency,weapontypepve_headshot,weapontypepve_headshotratio,weapontypepve_kdratio,weapontypepve_killassists,weapontypepve_kills,weapontypepve_mostkills,weapontypepve_power"; + private const string WeaponTypePvp = "weapontypepvp_accuracy,weapontypepvp_bulletfired,weapontypepvp_bullethit,weapontypepvp_chosen,weapontypepvp_dbno,weapontypepvp_dbnoassists,weapontypepvp_death,weapontypepvp_deaths,weapontypepvp_efficiency,weapontypepvp_headshot,weapontypepvp_headshotratio,weapontypepvp_kdratio,weapontypepvp_killassists,weapontypepvp_kills,weapontypepvp_mostkills,weapontypepvp_power"; + + public static string GetStatistic() + { + return string.Join(",", GadgetPve, GadgetPvp, WeaponPve, WeaponTypePve, WeaponTypePvp); + } + } +} diff --git a/R6DataAccess/Models/Static/StatisticStatics/GamemodeStatisticStatics.cs b/R6DataAccess/Models/Static/StatisticStatics/GamemodeStatisticStatics.cs new file mode 100644 index 0000000..274b2ae --- /dev/null +++ b/R6DataAccess/Models/Static/StatisticStatics/GamemodeStatisticStatics.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccess.Models.Static +{ + public class GamemodeStatisticStatics + { + + private const string ProtectHostagePve = "protecthostagepve_bestscore,protecthostagepve_hostagedefense,protecthostagepve_hostagerescue,protecthostagepve_matchlost,protecthostagepve_matchplayed,protecthostagepve_matchwlratio,protecthostagepve_matchwon,protecthostagepve_timeplayed"; + private const string PlantBombPve = "plantbombpve_bestscore,plantbombpve_matchlost,plantbombpve_matchplayed,plantbombpve_matchwlratio,plantbombpve_matchwon,plantbombpve_timeplayed"; + private const string PlantBombPvp = "plantbombpvp_bestscore,plantbombpvp_matchlost,plantbombpvp_matchplayed,plantbombpvp_matchwlratio,plantbombpvp_matchwon,plantbombpvp_timeplayed,plantbombpvp_totalxp"; + private const string RescueHostagePve = "rescuehostagepve_bestscore,rescuehostagepve_hostagedefense,rescuehostagepve_hostagerescue,rescuehostagepve_matchlost,rescuehostagepve_matchplayed,rescuehostagepve_matchwlratio,rescuehostagepve_matchwon,rescuehostagepve_timeplayed"; + private const string RescueHostagePvp = "rescuehostagepvp_bestscore,rescuehostagepvp_matchlost,rescuehostagepvp_matchplayed,rescuehostagepvp_matchwlratio,rescuehostagepvp_matchwon,rescuehostagepvp_totalxp"; + private const string SecureAreaPve = "secureareapve_bestscore,secureareapve_matchlost,secureareapve_matchplayed,secureareapve_matchwlratio,secureareapve_matchwon,secureareapve_serveraggression,secureareapve_serverdefender,secureareapve_servershacked,secureareapve_timeplayed"; + private const string SecureAreaPvp = "secureareapvp_bestscore,secureareapvp_matchlost,secureareapvp_matchplayed,secureareapvp_matchwlratio,secureareapvp_matchwon,secureareapvp_totalxp"; + public static string GetStatistic() + { + return string.Join(",", ProtectHostagePve, PlantBombPve, PlantBombPvp, RescueHostagePve, RescueHostagePvp, SecureAreaPve, SecureAreaPvp); + } + } +} diff --git a/R6DataAccess/Models/Static/StatisticStatics/OperatorStatisticStatics.cs b/R6DataAccess/Models/Static/StatisticStatics/OperatorStatisticStatics.cs new file mode 100644 index 0000000..534d67a --- /dev/null +++ b/R6DataAccess/Models/Static/StatisticStatics/OperatorStatisticStatics.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccess.Models.Static.StatisticStatics +{ + class QueueStatisticsStatics + { + // Operator specific + private const string OperatorPve = "operatorpve_ash_bonfirekill,operatorpve_ash_bonfirewallbreached,operatorpve_bandit_batterykill,operatorpve_black_mirror_gadget_deployed,operatorpve_blackbeard_gunshieldblockdamage,operatorpve_blitz_flashedenemy,operatorpve_blitz_flashfollowupkills,operatorpve_blitz_flashshieldassist,operatorpve_buck_kill,operatorpve_capitao_lethaldartkills,operatorpve_capitao_smokedartslaunched,operatorpve_castle_kevlarbarricadedeployed,operatorpve_caveira_aikilledinstealth,operatorpve_cazador_assist_kill,operatorpve_dbno,operatorpve_death,operatorpve_doc_hostagerevive,operatorpve_doc_selfrevive,operatorpve_doc_teammaterevive,operatorpve_echo_enemy_sonicburst_affected,operatorpve_frost_beartrap_kill,operatorpve_fuze_clusterchargekill,operatorpve_glaz_sniperkill,operatorpve_glaz_sniperpenetrationkill,operatorpve_headshot,operatorpve_hibana_detonate_projectile,operatorpve_iq_gadgetspotbyef,operatorpve_jager_gadgetdestroybycatcher,operatorpve_kapkan_boobytrapdeployed,operatorpve_kapkan_boobytrapkill,operatorpve_kdratio,operatorpve_kills,operatorpve_meleekills,operatorpve_montagne_shieldblockdamage,operatorpve_mostused,operatorpve_mute_gadgetjammed,operatorpve_mute_jammerdeployed,operatorpve_pulse_heartbeatassist,operatorpve_pulse_heartbeatspot,operatorpve_rook_armorboxdeployed,operatorpve_rook_armortakenourself,operatorpve_rook_armortakenteammate,operatorpve_roundlost,operatorpve_roundplayed,operatorpve_roundwlratio,operatorpve_roundwon,operatorpve_sledge_hammerhole,operatorpve_sledge_hammerkill,operatorpve_smoke_poisongaskill,operatorpve_tachanka_turretdeployed,operatorpve_tachanka_turretkill,operatorpve_thatcher_gadgetdestroywithemp,operatorpve_thermite_chargedeployed,operatorpve_thermite_chargekill,operatorpve_thermite_reinforcementbreached,operatorpve_timeplayed,operatorpve_totalxp,operatorpve_twitch_gadgetdestroybyshockdrone,operatorpve_twitch_shockdronekill,operatorpve_valkyrie_camdeployed"; + private const string OperatorPvp = "operatorpvp_ace_selmadetonate,operatorpvp_amaru_distancereeled,operatorpvp_ash_bonfirekill,operatorpvp_ash_bonfirewallbreached,operatorpvp_attackerdrone_diminishedrealitymode,operatorpvp_bandit_batterykill,operatorpvp_barrage_killswithturret,operatorpvp_black_mirror_gadget_deployed,operatorpvp_blackbeard_gunshieldblockdamage,operatorpvp_blitz_flashedenemy,operatorpvp_blitz_flashfollowupkills,operatorpvp_blitz_flashshieldassist,operatorpvp_buck_kill,operatorpvp_caltrop_enemy_affected,operatorpvp_capitao_lethaldartkills,operatorpvp_capitao_smokedartslaunched,operatorpvp_castle_kevlarbarricadedeployed,operatorpvp_caveira_interrogations,operatorpvp_cazador_assist_kill,operatorpvp_clash_sloweddown,operatorpvp_concussiongrenade_detonate,operatorpvp_concussionmine_detonate,operatorpvp_dazzler_gadget_detonate,operatorpvp_dbno,operatorpvp_death,operatorpvp_deceiver_revealedattackers,operatorpvp_doc_hostagerevive,operatorpvp_doc_selfrevive,operatorpvp_doc_teammaterevive,operatorpvp_echo_enemy_sonicburst_affected,operatorpvp_frost_dbno,operatorpvp_fuze_clusterchargekill,operatorpvp_glaz_sniperkill,operatorpvp_glaz_sniperpenetrationkill,operatorpvp_goyo_volcandetonate,operatorpvp_gridlock_traxdeployed,operatorpvp_headshot,operatorpvp_hibana_detonate_projectile,operatorpvp_iana_killsafterreplicator,operatorpvp_iq_gadgetspotbyef,operatorpvp_jager_gadgetdestroybycatcher,operatorpvp_kaid_electroclawelectrify,operatorpvp_kali_gadgetdestroywithexplosivelance,operatorpvp_kapkan_boobytrapdeployed,operatorpvp_kapkan_boobytrapkill,operatorpvp_kdratio,operatorpvp_kills,operatorpvp_maverick_wallbreached,operatorpvp_meleekills,operatorpvp_melusi_sloweddown,operatorpvp_montagne_shieldblockdamage,operatorpvp_mostused,operatorpvp_mozzie_droneshacked,operatorpvp_mute_gadgetjammed,operatorpvp_mute_jammerdeployed,operatorpvp_nokk_observationtooldeceived,operatorpvp_nomad_airjabdetonate,operatorpvp_oryx_killsafterdash,operatorpvp_phoneshacked,operatorpvp_pulse_heartbeatassist,operatorpvp_pulse_heartbeatspot,operatorpvp_rook_armorboxdeployed,operatorpvp_rook_armortakenourself,operatorpvp_rook_armortakenteammate,operatorpvp_roundlost,operatorpvp_roundplayed,operatorpvp_roundwlratio,operatorpvp_roundwon,operatorpvp_rush_adrenalinerush,operatorpvp_sledge_hammerhole,operatorpvp_sledge_hammerkill,operatorpvp_smoke_poisongaskill,operatorpvp_tachanka_turretdeployed,operatorpvp_tachanka_turretkill,operatorpvp_tagger_tagdevice_spot,operatorpvp_thatcher_gadgetdestroywithemp,operatorpvp_thermite_chargedeployed,operatorpvp_thermite_chargekill,operatorpvp_thermite_reinforcementbreached,operatorpvp_timeplayed,operatorpvp_totalxp,operatorpvp_twitch_gadgetdestroybyshockdrone,operatorpvp_twitch_shockdronekill,operatorpvp_valkyrie_camdeployed,operatorpvp_wamai_gadgetdestroybymagnet,operatorpvp_warden_killswithglasses,operatorpvp_zero_gadgetsdestroyed"; + + public static string GetStatistic() + { + return string.Join(",", OperatorPve, OperatorPvp); + } + } +} diff --git a/R6DataAccess/Models/Static/StatisticStatics/QueueStatisticStatics.cs b/R6DataAccess/Models/Static/StatisticStatics/QueueStatisticStatics.cs new file mode 100644 index 0000000..17622f5 --- /dev/null +++ b/R6DataAccess/Models/Static/StatisticStatics/QueueStatisticStatics.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccess.Models.Static.StatisticStatics +{ + class QueueStatisticStatics + { + + // General and queues + private const string GeneralPve = "generalpve_accuracy,generalpve_barricadedeployed,generalpve_blindkills,generalpve_bulletfired,generalpve_bullethit,generalpve_dbno,generalpve_dbnoassists,generalpve_death,generalpve_death:infinite,generalpve_distancetravelled,generalpve_gadgetdestroy,generalpve_headshot,generalpve_hostagedefense,generalpve_hostagerescue,generalpve_kdratio,generalpve_killassists,generalpve_kills,generalpve_kills:infinite,generalpve_matchlost,generalpve_matchlost:infinite,generalpve_matchplayed,generalpve_matchplayed:infinite,generalpve_matchwlratio,generalpve_matchwon,generalpve_matchwon:infinite,generalpve_meleekills,generalpve_penetrationkills,generalpve_rappelbreach,generalpve_reinforcementdeploy,generalpve_revive,generalpve_revivedenied,generalpve_serveraggression,generalpve_serverdefender,generalpve_servershacked,generalpve_suicide,generalpve_timeplayed,generalpve_timeplayed:infinite,generalpve_totalxp"; + private const string GeneralPvp = "generalpvp_accuracy,generalpvp_barricadedeployed,generalpvp_barricadedeployed:infinite,generalpvp_blindkills,generalpvp_bulletfired,generalpvp_bulletfired:infinite,generalpvp_bullethit,generalpvp_bullethit:infinite,generalpvp_dbno,generalpvp_dbno:infinite,generalpvp_dbnoassists,generalpvp_death,generalpvp_death:infinite,generalpvp_distancetravelled,generalpvp_gadgetdestroy,generalpvp_headshot,generalpvp_headshot:infinite,generalpvp_hostagedefense,generalpvp_hostagerescue,generalpvp_kdratio,generalpvp_killassists,generalpvp_killassists:infinite,generalpvp_kills,generalpvp_kills:infinite,generalpvp_matchlost,generalpvp_matchlost:infinite,generalpvp_matchplayed,generalpvp_matchplayed:infinite,generalpvp_matchwlratio,generalpvp_matchwon,generalpvp_matchwon:infinite,generalpvp_meleekills,generalpvp_penetrationkills,generalpvp_rappelbreach,generalpvp_reinforcementdeploy,generalpvp_reinforcementdeploy:infinite,generalpvp_revive,generalpvp_revive:infinite,generalpvp_revivedenied,generalpvp_serveraggression,generalpvp_serverdefender,generalpvp_servershacked,generalpvp_suicide,generalpvp_suicide:infinite,generalpvp_timeplayed,generalpvp_timeplayed:infinite,generalpvp_totalxp"; + private const string NormalPvp = "normalpvp_matchlost,normalpvp_matchplayed,normalpvp_matchwlratio,normalpvp_matchwon,normalpvp_timeplayed"; + private const string CasualPvp = "casualpvp_death,casualpvp_death:infinite,casualpvp_kdratio,casualpvp_kills,casualpvp_kills:infinite,casualpvp_matchlost,casualpvp_matchlost:infinite,casualpvp_matchplayed,casualpvp_matchplayed:infinite,casualpvp_matchwlratio,casualpvp_matchwon,casualpvp_matchwon:infinite,casualpvp_timeplayed,casualpvp_timeplayed:infinite"; + private const string RankedPvp = "rankedpvp_death,rankedpvp_death:infinite,rankedpvp_kdratio,rankedpvp_kills,rankedpvp_kills:infinite,rankedpvp_matchlost,rankedpvp_matchlost:infinite,rankedpvp_matchplayed,rankedpvp_matchplayed:infinite,rankedpvp_matchwlratio,rankedpvp_matchwon,rankedpvp_matchwon:infinite,rankedpvp_timeplayed,rankedpvp_timeplayed:infinite"; + private const string CustomPvp = "custompvp_timeplayed"; + + public static string GetStatistic() + { + return string.Join(",", GeneralPve, GeneralPvp, NormalPvp, CasualPvp, RankedPvp, CustomPvp); + } + } +} + diff --git a/R6DataAccess/Models/Static/StatisticStatics/TerroristHuntMissionStatisticStatics.cs b/R6DataAccess/Models/Static/StatisticStatics/TerroristHuntMissionStatisticStatics.cs new file mode 100644 index 0000000..bd48751 --- /dev/null +++ b/R6DataAccess/Models/Static/StatisticStatics/TerroristHuntMissionStatisticStatics.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccess.Models.Static.StatisticStatics +{ + class TerroristHuntMissionStatisticStatics + { + + // Terrorist Hunt/Training Grounds and missions + private const string AllTerroHunt = "allterrohuntcoop_hard_bestscore,allterrohuntcoop_normal_bestscore,allterrohuntcoop_realistic_bestscore,allterrohuntsolo_hard_bestscore,allterrohuntsolo_normal_bestscore,allterrohuntsolo_realistic_bestscore"; + private const string TerroHuntClassic = "terrohuntclassicpve_bestscore,terrohuntclassicpve_matchlost,terrohuntclassicpve_matchplayed,terrohuntclassicpve_matchwlratio,terrohuntclassicpve_matchwon,terrohuntclassicpve_timeplayed"; + private const string MissionSolo = "missionsolo_hard_bestscore,missionsolo_normal_bestscore,missionsolo_realistic_bestscore"; + private const string MissionCoop = "missioncoop_hard_bestscore,missioncoop_normal_bestscore,missioncoop_realistic_bestscore"; + private const string MissionsByPlaylist = "missionsbyplaylistpve_bestscore"; + + + public static string GetStatistic() + { + return string.Join(",", AllTerroHunt, TerroHuntClassic, MissionCoop, MissionSolo, MissionsByPlaylist); + } + } +} + diff --git a/R6Sharp/Response/Statistic/EquipmentStatistic.cs b/R6DataAccess/Models/StatisticModel/EquipmentStatistic.cs similarity index 99% rename from R6Sharp/Response/Statistic/EquipmentStatistic.cs rename to R6DataAccess/Models/StatisticModel/EquipmentStatistic.cs index 0b8e3e6..a36f764 100644 --- a/R6Sharp/Response/Statistic/EquipmentStatistic.cs +++ b/R6DataAccess/Models/StatisticModel/EquipmentStatistic.cs @@ -1,16 +1,20 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Text; using System.Text.Json.Serialization; -namespace R6Sharp.Response.Statistic +namespace R6DataAccess.Models { - internal class EquipmentStatisticsFetch + public class EquipmentStatisticsFetch { [JsonPropertyName("results")] public Dictionary EquipmentStatistics { get; set; } } + public class EquipmentStatistic : IEquipmentStatistic - public class EquipmentStatistic { + + [JsonPropertyName("weapontypepvp_headshot:B:infinite")] public int WeapontypepvpHeadshotBInfinite { get; set; } diff --git a/R6Sharp/Response/Statistic/GamemodeStatistic.cs b/R6DataAccess/Models/StatisticModel/GamemodeStatistic.cs similarity index 95% rename from R6Sharp/Response/Statistic/GamemodeStatistic.cs rename to R6DataAccess/Models/StatisticModel/GamemodeStatistic.cs index 6d104a4..c6a520c 100644 --- a/R6Sharp/Response/Statistic/GamemodeStatistic.cs +++ b/R6DataAccess/Models/StatisticModel/GamemodeStatistic.cs @@ -1,7 +1,9 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Text; using System.Text.Json.Serialization; -namespace R6Sharp.Response.Statistic +namespace R6DataAccess.Models { internal class GamemodeStatisticFetch { @@ -9,7 +11,7 @@ internal class GamemodeStatisticFetch public Dictionary GamemodeStatistics { get; set; } } - public class GamemodeStatistic + public class GamemodeStatistic : IGamemodeStatistic { [JsonPropertyName("plantbombpvp_timeplayed:infinite")] public int PlantbombpvpTimeplayedInfinite { get; set; } diff --git a/R6Sharp/Response/Statistic/OperatorStatistic.cs b/R6DataAccess/Models/StatisticModel/OperatorStatistic.cs similarity index 99% rename from R6Sharp/Response/Statistic/OperatorStatistic.cs rename to R6DataAccess/Models/StatisticModel/OperatorStatistic.cs index 83b5251..7e938f0 100644 --- a/R6Sharp/Response/Statistic/OperatorStatistic.cs +++ b/R6DataAccess/Models/StatisticModel/OperatorStatistic.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace R6Sharp.Response.Statistic +namespace R6DataAccess.Models { internal class OperatorStatisticFetch { @@ -9,7 +9,7 @@ internal class OperatorStatisticFetch public Dictionary OperatorStatistics { get; set; } } - public class OperatorStatistic + public class OperatorStatistic : IOperatorStatistic { [JsonPropertyName("operatorpvp_headshot:3:8:infinite")] public int OperatorpvpHeadshot38Infinite { get; set; } diff --git a/R6Sharp/Response/Statistic/QueueStatistic.cs b/R6DataAccess/Models/StatisticModel/QueueStatistic.cs similarity index 99% rename from R6Sharp/Response/Statistic/QueueStatistic.cs rename to R6DataAccess/Models/StatisticModel/QueueStatistic.cs index 60533f8..8f486a8 100644 --- a/R6Sharp/Response/Statistic/QueueStatistic.cs +++ b/R6DataAccess/Models/StatisticModel/QueueStatistic.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace R6Sharp.Response.Statistic +namespace R6DataAccess.Models { internal class QueueStatisticFetch { @@ -9,7 +9,7 @@ internal class QueueStatisticFetch public Dictionary QueueStatistics { get; set; } } - public class QueueStatistic + public class QueueStatistic : IQueueStatistic { [JsonPropertyName("generalpvp_gadgetdestroy:infinite")] public int GeneralpvpGadgetdestroyInfinite { get; set; } diff --git a/R6Sharp/Response/Statistic/TerroristHuntMissionStatistic.cs b/R6DataAccess/Models/StatisticModel/TerroristHuntMissionStatistic.cs similarity index 93% rename from R6Sharp/Response/Statistic/TerroristHuntMissionStatistic.cs rename to R6DataAccess/Models/StatisticModel/TerroristHuntMissionStatistic.cs index d0637df..8e707ac 100644 --- a/R6Sharp/Response/Statistic/TerroristHuntMissionStatistic.cs +++ b/R6DataAccess/Models/StatisticModel/TerroristHuntMissionStatistic.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace R6Sharp.Response.Statistic +namespace R6DataAccess.Models { internal class TerroristHuntMissionStatisticFetch { @@ -9,7 +9,7 @@ internal class TerroristHuntMissionStatisticFetch public Dictionary TerroristHuntMissionStatistics { get; set; } } - public class TerroristHuntMissionStatistic + public class TerroristHuntMissionStatistic : ITerroristHuntMissionStatistic { [JsonPropertyName("terrohuntclassicpve_matchlost:infinite")] public int TerrohuntclassicpveMatchlostInfinite { get; set; } diff --git a/R6DataAccess/R6DataAccess.csproj b/R6DataAccess/R6DataAccess.csproj new file mode 100644 index 0000000..2c6563c --- /dev/null +++ b/R6DataAccess/R6DataAccess.csproj @@ -0,0 +1,9 @@ + + + + netcoreapp3.1 + true + + + + diff --git a/R6DataAccessTest/EndpointTest/PlayerEndPointTest/PlayerEndPointTest.cs b/R6DataAccessTest/EndpointTest/PlayerEndPointTest/PlayerEndPointTest.cs new file mode 100644 index 0000000..bbb1a1c --- /dev/null +++ b/R6DataAccessTest/EndpointTest/PlayerEndPointTest/PlayerEndPointTest.cs @@ -0,0 +1,65 @@ +using R6DataAccess.DataFactory; +using R6DataAccess.Endpoint.PlayerEndPoint; +using R6DataAccess.Models; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace R6DataAccessTest.EndpointTest +{ + public class PlayerEndPointTest : IClassFixture + { + + private readonly SessionEndPointFixture _fixture; + + private readonly IPlayerEndpoint _playerEndpoint; + + private Guid testRankAccount = Guid.Parse("0a32319d-f7de-4ec1-a845-25ee53f978a7"); + + public PlayerEndPointTest(SessionEndPointFixture fixture) + { + _fixture = fixture; + _playerEndpoint = EndPointFactory.GetPlayerEndpoint(_fixture.sessionEndpoint); + } + + + [Fact] + public async Task TestUserRank_ShouldReturnKillsGreaterThan1WithSession() + { + + var player = await _playerEndpoint.GetRankedAsync(_fixture.TestAccount, Platform.UPLAY, Region.EMEA, -1); + + Assert.True(player.Kills > 1); + } + + [Fact] + public async Task TestUserRank_ShouldReturnKillsGreaterThan1WithoutSession() + { + + var player = await _playerEndpoint.GetRankedAsync(_fixture.TestAccount, Platform.UPLAY, Region.EMEA); + + Assert.True(player.Kills > 1); + } + + [Fact] + public async Task TestUsersRank_ShouldReturnKillsGreaterThan1WithoutSession() + { + var guids = new Guid[] + { + Guid.Parse("00000000-0000-0000-0000-000000000000"), + Guid.Parse("11111111-1111-1111-1111-111111111111"), + Guid.Parse("22222222-2222-2222-2222-222222222222"), + Guid.Parse("33333333-3333-3333-3333-333333333333"), + Guid.Parse("44444444-4444-4444-4444-444444444444") + }; + + var players = await _playerEndpoint.GetRankedAsync(guids, Platform.UPLAY, Region.EMEA); + + Assert.True(players.Count > 1); + } + + + } +} diff --git a/R6DataAccessTest/EndpointTest/PlayerProgressionEndPointTest/PlayerProgressionEndPointTest.cs b/R6DataAccessTest/EndpointTest/PlayerProgressionEndPointTest/PlayerProgressionEndPointTest.cs new file mode 100644 index 0000000..1d7bd88 --- /dev/null +++ b/R6DataAccessTest/EndpointTest/PlayerProgressionEndPointTest/PlayerProgressionEndPointTest.cs @@ -0,0 +1,100 @@ +using R6DataAccess.DataFactory; +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using R6Sharp.Endpoint; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace R6DataAccessTest.EndpointTest.PlayerProgressionEndPointTest +{ + + + public class PlayerProgressionEndPointTest:IClassFixture + { + + private readonly SessionEndPointFixture _fixture; + + private readonly IPlayerProgressionEndpoint _playerProgressionEndpoint; + + public PlayerProgressionEndPointTest(SessionEndPointFixture fixture) + { + _fixture = fixture; + _playerProgressionEndpoint = EndPointFactory.GetPlayerProgressionEndpoint(_fixture.sessionEndpoint); + } + + + IPlatform platform = Platform.UPLAY; + + [Fact] + public async Task GetPlayerProgressionTest() + { + + Guid ProfileId = Guid.Parse("3e22dc81-bb7e-42ac-88b9-2e6fcac447eb"); + + //arrange + + var expectedLevel = 187; + + //expected + + var progression = await _playerProgressionEndpoint.GetPlayerProgressionAsync(ProfileId, platform); + + var actualLevel = progression.Level; + + //assert + + Assert.Equal(expectedLevel, actualLevel); + + } + + [Fact] + public async Task GetPlayersProgressionTest() + { + + Guid ProfileId = Guid.Parse("3e22dc81-bb7e-42ac-88b9-2e6fcac447eb"); + + //arrange + + + //expected + + var progression = await _playerProgressionEndpoint.GetPlayerProgressionAsync(new Guid[] { ProfileId }, platform); + + + + //assert + + Assert.True(progression.Count >= 1); + + } + + + [Fact] + public async Task ValidUserButDifferentPlatform() + { + + //arrange + + var expectedExp = 0; + + Guid profileId = Guid.Parse("3e22dc81-bb7e-42ac-88b9-2e6fcac447eb"); + + //expected + //following user does not exist on PSN + var profile = await _playerProgressionEndpoint.GetPlayerProgressionAsync(profileId, Platform.PSN); + + + + //assert + + // should return null for invalid + Assert.Equal(expectedExp, profile.XP); + + + } + + } +} diff --git a/R6DataAccessTest/EndpointTest/ProfileEndpointTest/ProfileEndpointTest.cs b/R6DataAccessTest/EndpointTest/ProfileEndpointTest/ProfileEndpointTest.cs new file mode 100644 index 0000000..029ebd7 --- /dev/null +++ b/R6DataAccessTest/EndpointTest/ProfileEndpointTest/ProfileEndpointTest.cs @@ -0,0 +1,171 @@ +using R6DataAccess.DataFactory; +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using R6Sharp; +using R6Sharp.Endpoint; +using R6Sharp.Models; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace R6DataAccessTest.EndpointTest.ProfileEndpointTest +{ + public class ProfileEndpointTest:IClassFixture + { + + private readonly SessionEndPointFixture _fixture; + + private readonly IProfileEndpoint _profileEndpoint; + + public ProfileEndpointTest(SessionEndPointFixture fixture) + { + _fixture = fixture; + _profileEndpoint = EndPointFactory.GetProfileEndpoint(_fixture.sessionEndpoint); + } + + + + + private const string username = "itspizzatimeXDD"; + + + IPlatform platform = Platform.UPLAY; + + [Fact] + public async Task UserMatchesTheCorrectProfileId() + { + + //arrange + + Guid expectedProfileId = Guid.Parse("3e22dc81-bb7e-42ac-88b9-2e6fcac447eb"); + + //expected + + var profile = await _profileEndpoint.GetProfileAsync(username, platform); + + var actualId = profile.ProfileId; + + //assert + + Assert.Equal(expectedProfileId, actualId); + + + } + + [Fact] + public async Task TestUserButDifferentPlatform_ShouldReturnNull() + { + + //arrange + + Guid expectedProfileId = Guid.Parse("3e22dc81-bb7e-42ac-88b9-2e6fcac447eb"); + + //expected + //following user does not exist on PSN + var profile = await _profileEndpoint.GetProfileAsync(username, Platform.PSN); + + + + //assert + + // should return null for invalid + Assert.Null(profile); + + + } + + [Fact] + public async Task ProvideInvalidProfile() + { + + //arrange + + //EXPECTING NULL + + var randomMadeUpName = "aosdjoajsd0asd"; + + var platform = Platform.PSN; + + //expected + + var profile = await _profileEndpoint.GetProfileAsync(randomMadeUpName, platform); + + + //assert + + // should return null for invalid + Assert.Null(profile); + + + } + + + + + [Fact] + public async Task Get_MultipleProfilesFromUbSoft() + { + + + //expected + + var profile = await _profileEndpoint.GetProfileAsync(new string[] { username }, platform); + + + //assert + + Assert.True(profile.Count >= 1); + + + + + } + + + [Fact] + public async Task Get_GuidProfileFromUbSoft() + { + + //arrange + + Guid expectedProfileId = Guid.Parse("3e22dc81-bb7e-42ac-88b9-2e6fcac447eb"); + + //expected + + var profile = await _profileEndpoint.GetProfileAsync(expectedProfileId, platform); + + var actualTotal = profile.ProfileId; + + //assert + + Assert.Equal(expectedProfileId, actualTotal); + + + } + + [Fact] + public async Task Get_MultipleGuidProfileFromUbSoft() + { + + //arrange + + + Guid profileId = Guid.Parse("3e22dc81-bb7e-42ac-88b9-2e6fcac447eb"); + + //expected + + var profile = await _profileEndpoint.GetProfileAsync(new Guid[] { profileId }, platform); + + + + + //assert + + Assert.True(profile.Count >= 1 ); + + + } + } +} diff --git a/R6DataAccessTest/EndpointTest/SessionEndPointFixture.cs b/R6DataAccessTest/EndpointTest/SessionEndPointFixture.cs new file mode 100644 index 0000000..2dbdb48 --- /dev/null +++ b/R6DataAccessTest/EndpointTest/SessionEndPointFixture.cs @@ -0,0 +1,29 @@ +using R6DataAccess.DataFactory; +using R6DataAccess.Models; +using R6Sharp.Endpoint; +using System; +using System.Collections.Generic; +using System.Text; + +namespace R6DataAccessTest.EndpointTest +{ + public class SessionEndPointFixture : IDisposable + { + + public ISessionEndpoint sessionEndpoint { get; private set; } + + public Guid TestAccount { get; set; } = Guid.Parse("3e22dc81-bb7e-42ac-88b9-2e6fcac447eb"); + public Guid serkanTestAccount = Guid.Parse("0a32319d-f7de-4ec1-a845-25ee53f978a7"); + + + public SessionEndPointFixture() + { + sessionEndpoint = EndPointFactory.GetSessionEndpoint(new Auth("email", "password", false)); + } + + public void Dispose() + { + + } + } +} diff --git a/R6DataAccessTest/EndpointTest/SessionEndpointTest/SessionEndpointTest.cs b/R6DataAccessTest/EndpointTest/SessionEndpointTest/SessionEndpointTest.cs new file mode 100644 index 0000000..38e00c7 --- /dev/null +++ b/R6DataAccessTest/EndpointTest/SessionEndpointTest/SessionEndpointTest.cs @@ -0,0 +1,53 @@ +using R6DataAccess.DataFactory; +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using R6Sharp.Endpoint; +using R6Sharp.Response; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace R6DataAccessTest.EndpointTest.SessionEndpointTest +{ + public class SessionEndpointTest:IClassFixture + { + + private readonly SessionEndPointFixture _fixture; + + public SessionEndpointTest(SessionEndPointFixture fixture) + { + _fixture = fixture; + } + + + // not much test can be done here apart from get data + + //[Fact] + //public async Task Get_SessionTicketFromUbiSoft() + //{ + + // //Arrange - expected value + + // Guid expectedProfileId = Guid.Parse("f883c40b-1bb9-48b6-96bc-22252aa3692b"); + + // //Act actual value + + // ISession session = await _fixture.sessionEndpoint.GetSessionAsync(); + + // var actual = session.ProfileId; + + // //Assert - testing + + + // Assert.Equal(expectedProfileId, actual); + + + //} + + + + + } +} diff --git a/R6DataAccessTest/EndpointTest/StaticEndpointTest/StaticEndPointTest.cs b/R6DataAccessTest/EndpointTest/StaticEndpointTest/StaticEndPointTest.cs new file mode 100644 index 0000000..8e18d7d --- /dev/null +++ b/R6DataAccessTest/EndpointTest/StaticEndpointTest/StaticEndPointTest.cs @@ -0,0 +1,123 @@ +using R6DataAccess.DataFactory; +using R6DataAccess.Models; +using R6Sharp.Endpoint; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using Xunit; +using Xunit.Abstractions; + +namespace R6DataAccessTest.EndpointTest.StaticEndpointTest +{ + public class StaticEndPointTest:IClassFixture + { + + private IStaticEndpoint _staticEndpoint; + + private SessionEndPointFixture _fixture; + + private readonly ITestOutputHelper output; + + private ILanguage _testLanguage; + + public StaticEndPointTest(SessionEndPointFixture fixture, ITestOutputHelper output) + { + _fixture = fixture; + + _staticEndpoint = EndPointFactory.GetStaticEndpoint(_fixture.sessionEndpoint); + + _testLanguage = LanguageEndPoint.SimplifiedChinese; + + this.output = output; + + + } + + [Fact] + public async Task Language_TranslatedAll100Translated() + { + + var translation = await _staticEndpoint.GetLocaleAsync(_testLanguage); + + Assert.True(translation.Count > 50); + + + } + + [Fact] + public async Task Language_AllShouldReturnTranslation() + { + var languageEndPoint = new LanguageEndPoint(); + + var languages = languageEndPoint.GetType().GetProperties(); + + var InvalidLanguages = new List(); + + foreach(var language in languages) + { + var languageProp = (ILanguage) language.GetValue(languageEndPoint); + + var translation = await _staticEndpoint.GetLocaleAsync(languageProp); + + if(translation is null) + { + InvalidLanguages.Add(languageProp); + + output.WriteLine(languageProp.ShortHand); + } + + + } + + + + Assert.Empty(InvalidLanguages); + + + + + } + + + + + [Fact] + public async Task SeasonDetail_FirstSeasonShouldReturnId2() + { + var expected = 2; + + var seasonDetail = await _staticEndpoint.GetSeasonDetailsAsync(); + + var actual = seasonDetail[0].Id; + + Assert.Equal(expected, actual); + + } + + + [Fact] + public async Task GetSeason_ShouldReturnDustLineForSeason2() + { + var expected = "DUST LINE"; + + var season = await _staticEndpoint.GetSeasonAsync(2); + + Assert.Equal(expected, season.Name); + + } + [Fact] + public async Task GetSeason_Season20ShouldReturnCurrentSeason18() + { + // current season + var expected = 18; + + var season = await _staticEndpoint.GetSeasonAsync(20); + + + Assert.Equal(expected, season.Id); + + } + + } +} diff --git a/R6DataAccessTest/EndpointTest/StatisticEndPointTest/StatisticEndPointTest.cs b/R6DataAccessTest/EndpointTest/StatisticEndPointTest/StatisticEndPointTest.cs new file mode 100644 index 0000000..bcac0f4 --- /dev/null +++ b/R6DataAccessTest/EndpointTest/StatisticEndPointTest/StatisticEndPointTest.cs @@ -0,0 +1,144 @@ +using R6DataAccess.DataFactory; +using R6DataAccess.Endpoint.StatisticEndPoint; +using R6DataAccess.Models; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace R6DataAccessTest.EndpointTest.StatisticEndPointTest +{ + public class StatisticEndPointTest:IClassFixture + { + + + + private readonly SessionEndPointFixture _fixture; + + private readonly IStatisticEndpoint _statisticEndpoint; + + public StatisticEndPointTest(SessionEndPointFixture fixture) + { + _fixture = fixture; + _statisticEndpoint = EndPointFactory.GetStatisticEndpoint(_fixture.sessionEndpoint); + } + + + + [Fact] + + public async Task TestUser_GetEquipmentKillGreaterThan10() + { + var weaponStatistic = await _statisticEndpoint.GetEquipmentStatistics(_fixture.serkanTestAccount, Platform.UPLAY); + + Assert.True(weaponStatistic.WeapontypepveBulletfired1Infinite > 10); + + + } + + + [Fact] + + public async Task TestUser_GetEquipmentsFromMultipleAccount() + { + var weaponStatistic = await _statisticEndpoint.GetEquipmentStatistics(new Guid[] { _fixture.serkanTestAccount, _fixture.TestAccount }, Platform.UPLAY); + + Assert.True(weaponStatistic.Count >= 2); + + + } + + + [Fact] + + public async Task TestUser_GetGameModeFromMultipleAccount() + { + var weaponStatistic = await _statisticEndpoint.GetEquipmentStatistics(new Guid[] { _fixture.serkanTestAccount, _fixture.TestAccount }, Platform.UPLAY); + + Assert.True(weaponStatistic.Count >= 2); + + + } + + [Fact] + + public async Task TestUser_GetGameModeStatsGreaterThan5() + { + var gameStatistic = await _statisticEndpoint.GetGamemodeStatistics(_fixture.serkanTestAccount, Platform.UPLAY); + + Assert.True(gameStatistic.PlantbombpvpMatchlostInfinite > 10); + + } + + + + [Fact] + + public async Task TestUser_GetOperatorFromMultipleAccount() + { + var OperatorStatistic = await _statisticEndpoint.GetOperatorStatistics(new Guid[] { _fixture.serkanTestAccount, _fixture.TestAccount }, Platform.UPLAY); + + Assert.True(OperatorStatistic.Count >= 2); + + + } + + [Fact] + + public async Task TestUser_GetOperatorStatsGreaterThan5() + { + var OperatorStatistic = await _statisticEndpoint.GetOperatorStatistics(_fixture.serkanTestAccount, Platform.UPLAY); + + Assert.True(OperatorStatistic.OperatorpveAshBonfirewallbreached32Infinite > 10); + + } + + + + [Fact] + + public async Task TestUser_GetQueueFromMultipleAccount() + { + var QueueStatistic = await _statisticEndpoint.GetQueueStatistics(new Guid[] { _fixture.serkanTestAccount, _fixture.TestAccount }, Platform.UPLAY); + + Assert.True(QueueStatistic.Count >= 2); + + + } + + [Fact] + + public async Task TestUser_GetQueueStatsGreaterThan5() + { + var QueueStatistic = await _statisticEndpoint.GetQueueStatistics(_fixture.serkanTestAccount, Platform.UPLAY); + + Assert.True(QueueStatistic != null); + + } + + + + [Fact] + + public async Task TestUser_GetTerroristHuntMissionsFromMultipleAccount() + { + var TerroristHuntMissionsStatistic = await _statisticEndpoint.GetTerroristHuntMissionsStatistics(new Guid[] { _fixture.serkanTestAccount, _fixture.TestAccount }, Platform.UPLAY); + + Assert.True(TerroristHuntMissionsStatistic.Count >= 2); + + + } + + [Fact] + + public async Task TestUser_GetTerroristHuntMissionsStatsGreaterThan5() + { + var TerroristHuntMissionsStatistic = await _statisticEndpoint.GetTerroristHuntMissionsStatistics(_fixture.serkanTestAccount, Platform.UPLAY); + + Assert.True(TerroristHuntMissionsStatistic.AllterrohuntcoopNormalBestscoreInfinite > 10); + + } + + } +} diff --git a/R6DataAccessTest/R6DataAccessTest.csproj b/R6DataAccessTest/R6DataAccessTest.csproj new file mode 100644 index 0000000..88f19cf --- /dev/null +++ b/R6DataAccessTest/R6DataAccessTest.csproj @@ -0,0 +1,20 @@ + + + + netcoreapp3.1 + + false + + + + + + + + + + + + + + diff --git a/R6Sharp.csproj b/R6Sharp.csproj new file mode 100644 index 0000000..5b1791f --- /dev/null +++ b/R6Sharp.csproj @@ -0,0 +1,16 @@ + + + + netcoreapp3.1 + + false + + + + + + + + + + diff --git a/R6Sharp.sln b/R6Sharp.sln index b3c25a7..c284b8b 100644 --- a/R6Sharp.sln +++ b/R6Sharp.sln @@ -3,9 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29806.167 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "R6Sharp", "R6Sharp\R6Sharp.csproj", "{CC2EC2FB-0B68-4335-BD76-1CD91DAFABF1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "R6Sharp", "R6Sharp\R6Sharp.csproj", "{CC2EC2FB-0B68-4335-BD76-1CD91DAFABF1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example", "Example\Example.csproj", "{F1A69831-D694-48F0-A53A-195079D9B5FF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example", "Example\Example.csproj", "{F1A69831-D694-48F0-A53A-195079D9B5FF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "R6DataAccess", "R6DataAccess\R6DataAccess.csproj", "{025CD2BF-0E9D-44BE-9AAA-B4E9EEBB4F54}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "R6DataAccessTest", "R6DataAccessTest\R6DataAccessTest.csproj", "{68C4E6B7-1B65-49EB-8827-FDEFB749823A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,6 +25,14 @@ Global {F1A69831-D694-48F0-A53A-195079D9B5FF}.Debug|Any CPU.Build.0 = Debug|Any CPU {F1A69831-D694-48F0-A53A-195079D9B5FF}.Release|Any CPU.ActiveCfg = Release|Any CPU {F1A69831-D694-48F0-A53A-195079D9B5FF}.Release|Any CPU.Build.0 = Release|Any CPU + {025CD2BF-0E9D-44BE-9AAA-B4E9EEBB4F54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {025CD2BF-0E9D-44BE-9AAA-B4E9EEBB4F54}.Debug|Any CPU.Build.0 = Debug|Any CPU + {025CD2BF-0E9D-44BE-9AAA-B4E9EEBB4F54}.Release|Any CPU.ActiveCfg = Release|Any CPU + {025CD2BF-0E9D-44BE-9AAA-B4E9EEBB4F54}.Release|Any CPU.Build.0 = Release|Any CPU + {68C4E6B7-1B65-49EB-8827-FDEFB749823A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {68C4E6B7-1B65-49EB-8827-FDEFB749823A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {68C4E6B7-1B65-49EB-8827-FDEFB749823A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {68C4E6B7-1B65-49EB-8827-FDEFB749823A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/R6Sharp/ApiHelper.cs b/R6Sharp/ApiHelper.cs deleted file mode 100644 index b4c4483..0000000 --- a/R6Sharp/ApiHelper.cs +++ /dev/null @@ -1,166 +0,0 @@ -using R6Sharp.Response; -using R6Sharp.Response.Static; -using R6Sharp.Response.Statistic; -using System; -using System.Buffers; -using System.Buffers.Text; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.IO; -using System.Net; -using System.Net.Mime; -using System.Text.Json; -using System.Text.Json.Serialization; -using System.Threading.Tasks; -using System.Web; - -namespace R6Sharp -{ - internal static class ApiHelper - { - /// - /// Parses string to int from JSON strings. - /// - /// Solution by VahidN/Stack Overflow: https://stackoverflow.com/a/59322077/4339019 - internal class ParseStringToInt : JsonConverter - { - public override int Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options) - { - if (reader.TokenType == JsonTokenType.String) - { - ReadOnlySpan span = reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan; - if (Utf8Parser.TryParse(span, out int number, out int bytesConsumed) && span.Length == bytesConsumed) - { - return number; - } - - if (int.TryParse(reader.GetString(), out number)) - { - return number; - } - } - - return reader.GetInt32(); - } - - public override void Write(Utf8JsonWriter writer, int value, JsonSerializerOptions options) - { - writer.WriteStringValue(value.ToString()); - } - } - - internal class ParseStringToUri : JsonConverter - { - public override Uri Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options) - { - if (reader.TokenType == JsonTokenType.String) - { - if (Uri.TryCreate(reader.GetString(), UriKind.RelativeOrAbsolute, out Uri uri)) - { - return uri; - } - } - - return new Uri(reader.GetString()); - } - - public override void Write(Utf8JsonWriter writer, Uri value, JsonSerializerOptions options) - { - writer.WriteStringValue(value.ToString()); - } - } - - internal class ParseStringToId : JsonConverter - { - public override RankId Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options) - { - if (reader.TokenType == JsonTokenType.String) - { - if (Enum.TryParse(reader.GetString(), true, out RankId id)) - { - return id; - } - } - - return Enum.Parse(reader.GetString()); - } - - public override void Write(Utf8JsonWriter writer, RankId value, JsonSerializerOptions options) - { - writer.WriteStringValue(value.ToString()); - } - } - - internal static async Task GetDataAsync(string url, Platform? platform, IEnumerable> queries, string ticket) - { - if (platform != null) - { - if (url.Equals(Endpoints.Progressions) || url.Equals(Endpoints.Players) || url.Equals(Endpoints.Statistics)) - { - url = string.Format(url, Constant.PlatformToGuid(platform ?? default), Constant.PlatformToSandbox(platform ?? default)); - } - else - { - url = string.Format(url, Constant.PlatformToGuid(platform ?? default)); - } - } - if (queries != null) - { - // TO-DO: find a better, more secure way of doing this - var completeQueries = new List(); - foreach (var query in queries) - { - completeQueries.Add(string.Join('=', query.Key, query.Value)); - } - - url = string.Join('?', url, string.Join('&', completeQueries)); - } - - var uri = new Uri(url); - // Add authorization header with ticket (may be null, for requests that are static) - var headerValuePairs = new KeyValuePair[1]; - if (ticket != null) - { - headerValuePairs[0] = new KeyValuePair(HttpRequestHeader.Authorization, $"Ubi_v1 t={ticket}"); - } - return await BuildRequestAsync(uri, headerValuePairs, null, true).ConfigureAwait(false); - } - - internal static async Task BuildRequestAsync(Uri uri, KeyValuePair[] additionalHeaderValues, byte[] data, bool get) - { - // Build a web request to endpoint - var request = WebRequest.CreateHttp(uri); - // Set request method - request.Method = get ? WebRequestMethods.Http.Get : WebRequestMethods.Http.Post; - // Apply usual request headers that should be in all requests to Ubisoft - request.Headers.Add(HttpRequestHeader.ContentType, MediaTypeNames.Application.Json); - request.Headers.Add("Ubi-AppId", Constant.Rainbow6S.ToString()); - // Apply auxiliary headers supplied to method - foreach (var additionalHeaderValue in additionalHeaderValues) - { - request.Headers.Add(additionalHeaderValue.Key, additionalHeaderValue.Value); - } - - // If we have some data to send, write it to stream (make sure it is POST) - if (data != null && request.Method.Equals("POST")) - { - request.ContentLength = data.Length; - using (var stream = request.GetRequestStream()) - { - await stream.WriteAsync(data).ConfigureAwait(false); - } - } - - string result; - // Get result from Ubisoft and grab the json - using (var response = (HttpWebResponse)request.GetResponse()) - using (var stream = response.GetResponseStream()) - using (var reader = new StreamReader(stream)) - { - result = await reader.ReadToEndAsync().ConfigureAwait(false); - } - - return result; - } - } -} diff --git a/R6Sharp/Constant.cs b/R6Sharp/Constant.cs deleted file mode 100644 index c407073..0000000 --- a/R6Sharp/Constant.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace R6Sharp -{ - public enum StatisticsType - { - Equipments, - Gamemodes, - Operators, - TerroristHuntMissions, - Queues - } - - internal static class Constant - { - internal const string EquipmentsStatisticsVariable = GadgetPve + GadgetPvp + WeaponPve + - WeaponPvp + WeaponTypePve + WeaponTypePvp; - - internal const string GamemodesStatisticsVariables = ProtectHostagePve + PlantBombPve + PlantBombPvp + - RescueHostagePve + RescueHostagePvp + SecureAreaPve + - SecureAreaPvp; - - internal const string OperatorsStatisticsVariables = OperatorPve + OperatorPvp; - - internal const string QueuesStatisticsVariables = GeneralPve + GeneralPvp + NormalPvp + - CasualPvp + RankedPvp + CustomPvp; - - internal const string TerroristHuntMissionsStatisticsVariables = AllTerroHunt + TerroHuntClassic + MissionSolo + - MissionCoop + MissionsByPlaylist; - - // General and queues - private const string GeneralPve = "generalpve_accuracy,generalpve_barricadedeployed,generalpve_blindkills,generalpve_bulletfired,generalpve_bullethit,generalpve_dbno,generalpve_dbnoassists,generalpve_death,generalpve_death:infinite,generalpve_distancetravelled,generalpve_gadgetdestroy,generalpve_headshot,generalpve_hostagedefense,generalpve_hostagerescue,generalpve_kdratio,generalpve_killassists,generalpve_kills,generalpve_kills:infinite,generalpve_matchlost,generalpve_matchlost:infinite,generalpve_matchplayed,generalpve_matchplayed:infinite,generalpve_matchwlratio,generalpve_matchwon,generalpve_matchwon:infinite,generalpve_meleekills,generalpve_penetrationkills,generalpve_rappelbreach,generalpve_reinforcementdeploy,generalpve_revive,generalpve_revivedenied,generalpve_serveraggression,generalpve_serverdefender,generalpve_servershacked,generalpve_suicide,generalpve_timeplayed,generalpve_timeplayed:infinite,generalpve_totalxp"; - private const string GeneralPvp = "generalpvp_accuracy,generalpvp_barricadedeployed,generalpvp_barricadedeployed:infinite,generalpvp_blindkills,generalpvp_bulletfired,generalpvp_bulletfired:infinite,generalpvp_bullethit,generalpvp_bullethit:infinite,generalpvp_dbno,generalpvp_dbno:infinite,generalpvp_dbnoassists,generalpvp_death,generalpvp_death:infinite,generalpvp_distancetravelled,generalpvp_gadgetdestroy,generalpvp_headshot,generalpvp_headshot:infinite,generalpvp_hostagedefense,generalpvp_hostagerescue,generalpvp_kdratio,generalpvp_killassists,generalpvp_killassists:infinite,generalpvp_kills,generalpvp_kills:infinite,generalpvp_matchlost,generalpvp_matchlost:infinite,generalpvp_matchplayed,generalpvp_matchplayed:infinite,generalpvp_matchwlratio,generalpvp_matchwon,generalpvp_matchwon:infinite,generalpvp_meleekills,generalpvp_penetrationkills,generalpvp_rappelbreach,generalpvp_reinforcementdeploy,generalpvp_reinforcementdeploy:infinite,generalpvp_revive,generalpvp_revive:infinite,generalpvp_revivedenied,generalpvp_serveraggression,generalpvp_serverdefender,generalpvp_servershacked,generalpvp_suicide,generalpvp_suicide:infinite,generalpvp_timeplayed,generalpvp_timeplayed:infinite,generalpvp_totalxp"; - private const string NormalPvp = "normalpvp_matchlost,normalpvp_matchplayed,normalpvp_matchwlratio,normalpvp_matchwon,normalpvp_timeplayed"; - private const string CasualPvp = "casualpvp_death,casualpvp_death:infinite,casualpvp_kdratio,casualpvp_kills,casualpvp_kills:infinite,casualpvp_matchlost,casualpvp_matchlost:infinite,casualpvp_matchplayed,casualpvp_matchplayed:infinite,casualpvp_matchwlratio,casualpvp_matchwon,casualpvp_matchwon:infinite,casualpvp_timeplayed,casualpvp_timeplayed:infinite"; - private const string RankedPvp = "rankedpvp_death,rankedpvp_death:infinite,rankedpvp_kdratio,rankedpvp_kills,rankedpvp_kills:infinite,rankedpvp_matchlost,rankedpvp_matchlost:infinite,rankedpvp_matchplayed,rankedpvp_matchplayed:infinite,rankedpvp_matchwlratio,rankedpvp_matchwon,rankedpvp_matchwon:infinite,rankedpvp_timeplayed,rankedpvp_timeplayed:infinite"; - private const string CustomPvp = "custompvp_timeplayed"; - - // Gamemode specific - private const string ProtectHostagePve = "protecthostagepve_bestscore,protecthostagepve_hostagedefense,protecthostagepve_hostagerescue,protecthostagepve_matchlost,protecthostagepve_matchplayed,protecthostagepve_matchwlratio,protecthostagepve_matchwon,protecthostagepve_timeplayed"; - private const string PlantBombPve = "plantbombpve_bestscore,plantbombpve_matchlost,plantbombpve_matchplayed,plantbombpve_matchwlratio,plantbombpve_matchwon,plantbombpve_timeplayed"; - private const string PlantBombPvp = "plantbombpvp_bestscore,plantbombpvp_matchlost,plantbombpvp_matchplayed,plantbombpvp_matchwlratio,plantbombpvp_matchwon,plantbombpvp_timeplayed,plantbombpvp_totalxp"; - private const string RescueHostagePve = "rescuehostagepve_bestscore,rescuehostagepve_hostagedefense,rescuehostagepve_hostagerescue,rescuehostagepve_matchlost,rescuehostagepve_matchplayed,rescuehostagepve_matchwlratio,rescuehostagepve_matchwon,rescuehostagepve_timeplayed"; - private const string RescueHostagePvp = "rescuehostagepvp_bestscore,rescuehostagepvp_matchlost,rescuehostagepvp_matchplayed,rescuehostagepvp_matchwlratio,rescuehostagepvp_matchwon,rescuehostagepvp_totalxp"; - private const string SecureAreaPve = "secureareapve_bestscore,secureareapve_matchlost,secureareapve_matchplayed,secureareapve_matchwlratio,secureareapve_matchwon,secureareapve_serveraggression,secureareapve_serverdefender,secureareapve_servershacked,secureareapve_timeplayed"; - private const string SecureAreaPvp = "secureareapvp_bestscore,secureareapvp_matchlost,secureareapvp_matchplayed,secureareapvp_matchwlratio,secureareapvp_matchwon,secureareapvp_totalxp"; - - // Terrorist Hunt/Training Grounds and missions - private const string AllTerroHunt = "allterrohuntcoop_hard_bestscore,allterrohuntcoop_normal_bestscore,allterrohuntcoop_realistic_bestscore,allterrohuntsolo_hard_bestscore,allterrohuntsolo_normal_bestscore,allterrohuntsolo_realistic_bestscore"; - private const string TerroHuntClassic = "terrohuntclassicpve_bestscore,terrohuntclassicpve_matchlost,terrohuntclassicpve_matchplayed,terrohuntclassicpve_matchwlratio,terrohuntclassicpve_matchwon,terrohuntclassicpve_timeplayed"; - private const string MissionSolo = "missionsolo_hard_bestscore,missionsolo_normal_bestscore,missionsolo_realistic_bestscore"; - private const string MissionCoop = "missioncoop_hard_bestscore,missioncoop_normal_bestscore,missioncoop_realistic_bestscore"; - private const string MissionsByPlaylist = "missionsbyplaylistpve_bestscore"; - - // Operator specific - private const string OperatorPve = "operatorpve_ash_bonfirekill,operatorpve_ash_bonfirewallbreached,operatorpve_bandit_batterykill,operatorpve_black_mirror_gadget_deployed,operatorpve_blackbeard_gunshieldblockdamage,operatorpve_blitz_flashedenemy,operatorpve_blitz_flashfollowupkills,operatorpve_blitz_flashshieldassist,operatorpve_buck_kill,operatorpve_capitao_lethaldartkills,operatorpve_capitao_smokedartslaunched,operatorpve_castle_kevlarbarricadedeployed,operatorpve_caveira_aikilledinstealth,operatorpve_cazador_assist_kill,operatorpve_dbno,operatorpve_death,operatorpve_doc_hostagerevive,operatorpve_doc_selfrevive,operatorpve_doc_teammaterevive,operatorpve_echo_enemy_sonicburst_affected,operatorpve_frost_beartrap_kill,operatorpve_fuze_clusterchargekill,operatorpve_glaz_sniperkill,operatorpve_glaz_sniperpenetrationkill,operatorpve_headshot,operatorpve_hibana_detonate_projectile,operatorpve_iq_gadgetspotbyef,operatorpve_jager_gadgetdestroybycatcher,operatorpve_kapkan_boobytrapdeployed,operatorpve_kapkan_boobytrapkill,operatorpve_kdratio,operatorpve_kills,operatorpve_meleekills,operatorpve_montagne_shieldblockdamage,operatorpve_mostused,operatorpve_mute_gadgetjammed,operatorpve_mute_jammerdeployed,operatorpve_pulse_heartbeatassist,operatorpve_pulse_heartbeatspot,operatorpve_rook_armorboxdeployed,operatorpve_rook_armortakenourself,operatorpve_rook_armortakenteammate,operatorpve_roundlost,operatorpve_roundplayed,operatorpve_roundwlratio,operatorpve_roundwon,operatorpve_sledge_hammerhole,operatorpve_sledge_hammerkill,operatorpve_smoke_poisongaskill,operatorpve_tachanka_turretdeployed,operatorpve_tachanka_turretkill,operatorpve_thatcher_gadgetdestroywithemp,operatorpve_thermite_chargedeployed,operatorpve_thermite_chargekill,operatorpve_thermite_reinforcementbreached,operatorpve_timeplayed,operatorpve_totalxp,operatorpve_twitch_gadgetdestroybyshockdrone,operatorpve_twitch_shockdronekill,operatorpve_valkyrie_camdeployed"; - private const string OperatorPvp = "operatorpvp_ace_selmadetonate,operatorpvp_amaru_distancereeled,operatorpvp_ash_bonfirekill,operatorpvp_ash_bonfirewallbreached,operatorpvp_attackerdrone_diminishedrealitymode,operatorpvp_bandit_batterykill,operatorpvp_barrage_killswithturret,operatorpvp_black_mirror_gadget_deployed,operatorpvp_blackbeard_gunshieldblockdamage,operatorpvp_blitz_flashedenemy,operatorpvp_blitz_flashfollowupkills,operatorpvp_blitz_flashshieldassist,operatorpvp_buck_kill,operatorpvp_caltrop_enemy_affected,operatorpvp_capitao_lethaldartkills,operatorpvp_capitao_smokedartslaunched,operatorpvp_castle_kevlarbarricadedeployed,operatorpvp_caveira_interrogations,operatorpvp_cazador_assist_kill,operatorpvp_clash_sloweddown,operatorpvp_concussiongrenade_detonate,operatorpvp_concussionmine_detonate,operatorpvp_dazzler_gadget_detonate,operatorpvp_dbno,operatorpvp_death,operatorpvp_deceiver_revealedattackers,operatorpvp_doc_hostagerevive,operatorpvp_doc_selfrevive,operatorpvp_doc_teammaterevive,operatorpvp_echo_enemy_sonicburst_affected,operatorpvp_frost_dbno,operatorpvp_fuze_clusterchargekill,operatorpvp_glaz_sniperkill,operatorpvp_glaz_sniperpenetrationkill,operatorpvp_goyo_volcandetonate,operatorpvp_gridlock_traxdeployed,operatorpvp_headshot,operatorpvp_hibana_detonate_projectile,operatorpvp_iana_killsafterreplicator,operatorpvp_iq_gadgetspotbyef,operatorpvp_jager_gadgetdestroybycatcher,operatorpvp_kaid_electroclawelectrify,operatorpvp_kali_gadgetdestroywithexplosivelance,operatorpvp_kapkan_boobytrapdeployed,operatorpvp_kapkan_boobytrapkill,operatorpvp_kdratio,operatorpvp_kills,operatorpvp_maverick_wallbreached,operatorpvp_meleekills,operatorpvp_melusi_sloweddown,operatorpvp_montagne_shieldblockdamage,operatorpvp_mostused,operatorpvp_mozzie_droneshacked,operatorpvp_mute_gadgetjammed,operatorpvp_mute_jammerdeployed,operatorpvp_nokk_observationtooldeceived,operatorpvp_nomad_airjabdetonate,operatorpvp_oryx_killsafterdash,operatorpvp_phoneshacked,operatorpvp_pulse_heartbeatassist,operatorpvp_pulse_heartbeatspot,operatorpvp_rook_armorboxdeployed,operatorpvp_rook_armortakenourself,operatorpvp_rook_armortakenteammate,operatorpvp_roundlost,operatorpvp_roundplayed,operatorpvp_roundwlratio,operatorpvp_roundwon,operatorpvp_rush_adrenalinerush,operatorpvp_sledge_hammerhole,operatorpvp_sledge_hammerkill,operatorpvp_smoke_poisongaskill,operatorpvp_tachanka_turretdeployed,operatorpvp_tachanka_turretkill,operatorpvp_tagger_tagdevice_spot,operatorpvp_thatcher_gadgetdestroywithemp,operatorpvp_thermite_chargedeployed,operatorpvp_thermite_chargekill,operatorpvp_thermite_reinforcementbreached,operatorpvp_timeplayed,operatorpvp_totalxp,operatorpvp_twitch_gadgetdestroybyshockdrone,operatorpvp_twitch_shockdronekill,operatorpvp_valkyrie_camdeployed,operatorpvp_wamai_gadgetdestroybymagnet,operatorpvp_warden_killswithglasses,operatorpvp_zero_gadgetsdestroyed"; - - // Equipment specific - private const string GadgetPve = "gadgetpve_chosen,gadgetpve_gadgetdestroy,gadgetpve_kills,gadgetpve_mostused"; - private const string GadgetPvp = "gadgetpvp_chosen,gadgetpvp_gadgetdestroy,gadgetpvp_kills,gadgetpvp_mostused"; - private const string WeaponPve = "weaponpve_mostkills,weaponpve_mostused"; - private const string WeaponPvp = "weaponpvp_mostkills,weaponpvp_mostused"; - private const string WeaponTypePve = "weapontypepve_accuracy,weapontypepve_bulletfired,weapontypepve_bullethit,weapontypepve_chosen,weapontypepve_dbno,weapontypepve_dbnoassists,weapontypepve_death,weapontypepve_deaths,weapontypepve_efficiency,weapontypepve_headshot,weapontypepve_headshotratio,weapontypepve_kdratio,weapontypepve_killassists,weapontypepve_kills,weapontypepve_mostkills,weapontypepve_power"; - private const string WeaponTypePvp = "weapontypepvp_accuracy,weapontypepvp_bulletfired,weapontypepvp_bullethit,weapontypepvp_chosen,weapontypepvp_dbno,weapontypepvp_dbnoassists,weapontypepvp_death,weapontypepvp_deaths,weapontypepvp_efficiency,weapontypepvp_headshot,weapontypepvp_headshotratio,weapontypepvp_kdratio,weapontypepvp_killassists,weapontypepvp_kills,weapontypepvp_mostkills,weapontypepvp_power"; - - internal static readonly Guid Rainbow6S = Guid.Parse("39baebad-39e5-4552-8c25-2c9b919064e2"); - internal static readonly Guid Uplay = Guid.Parse("5172a557-50b5-4665-b7db-e3f2e8c5041d"); - internal static readonly Guid PSN = Guid.Parse("05bfb3f7-6c21-4c42-be1f-97a33fb5cf66"); - internal static readonly Guid XBL = Guid.Parse("98a601e5-ca91-4440-b1c5-753f601a2c90"); - - /// - /// Build a string of player-based variables. - /// - /// - /// Which statistics are to be used to build the variables line. - /// - /// - /// A comma-separated string full of variables interpretted from requested statistics. - /// - internal static string StatisticsBuilder(params StatisticsType[] statistics) - { - // deduplicate input - statistics = statistics.Distinct().ToArray(); - - // keep distinct variables for returning - var uniques = new HashSet(); - foreach (var statistic in statistics) - { - var variables = GetVariables(statistic); - foreach (var variable in variables) - { - uniques.Add(variable); - } - } - - return string.Join(',', uniques); - } - - internal static string[] GetVariables(StatisticsType statisticsType) - { - string line = statisticsType switch - { - StatisticsType.Equipments => EquipmentsStatisticsVariable, - StatisticsType.Gamemodes => GamemodesStatisticsVariables, - StatisticsType.Operators => OperatorsStatisticsVariables, - StatisticsType.Queues => QueuesStatisticsVariables, - StatisticsType.TerroristHuntMissions => TerroristHuntMissionsStatisticsVariables, - _ => string.Empty, - }; - return line.Split(','); - } - - internal static string PlatformToString(Platform Platform) - { - return Platform switch - { - Platform.PSN => "psn", - Platform.Uplay => "uplay", - Platform.XBL => "xbl", - _ => throw new Exception("Platform does not exist.") - }; - } - - internal static string RegionToString(Region Region) - { - return Region switch - { - Region.APAC => "apac", - Region.EMEA => "emea", - Region.NCSA => "ncsa", - _ => throw new Exception("Region does not exist."), - }; - } - - internal static Guid PlatformToGuid(Platform Platform) - { - return Platform switch - { - Platform.PSN => PSN, - Platform.Uplay => Uplay, - Platform.XBL => XBL, - _ => throw new Exception("Platform does not exist."), - }; - } - - internal static string PlatformToSandbox(Platform platform) - { - return platform switch - { - Platform.PSN => "OSBOR_PS4_LNCH_A", - Platform.Uplay => "OSBOR_PC_LNCH_A", - Platform.XBL => "OSBOR_XBOXONE_LNCH_A", - _ => throw new Exception("Platform does not exist."), - }; - } - } -} diff --git a/R6Sharp/Endpoint.cs b/R6Sharp/Endpoint.cs deleted file mode 100644 index c48bcc5..0000000 --- a/R6Sharp/Endpoint.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace R6Sharp -{ - internal static class Endpoints - { - // API access - internal const string Base = "https://game-rainbow6.ubi.com"; - internal const string Sessions = "https://public-ubiservices.ubi.com/v3/profiles/sessions"; - internal const string Search = "https://public-ubiservices.ubi.com/v2/profiles"; - - // These endpoints need to be formatted to correct space uuids (uplay, psn, xbl) - internal const string Progressions = "https://public-ubiservices.ubi.com/v1/spaces/{0}/sandboxes/{1}/r6playerprofile/playerprofile/progressions"; - internal const string Players = "https://public-ubiservices.ubi.com/v1/spaces/{0}/sandboxes/{1}/r6karma/players"; - internal const string Statistics = "https://public-ubiservices.ubi.com/v1/spaces/{0}/sandboxes/{1}/playerstats2/statistics"; - - // These are metadata endpoints, places where static data is stored - internal const string Avatar = "https://ubisoft-avatars.akamaized.net/{0}/default_146_146.png?appId={1}"; - internal const string Seasons = "https://game-rainbow6.ubi.com/assets/data/seasons.152c15ea.json"; - internal const string Locales = "https://game-rainbow6.ubi.com/assets/locales/locale.{0}.{1}.json"; - internal const string Ranks = "https://game-rainbow6.ubi.com/assets/data/ranks.754ab452.json"; - internal const string Operators = "https://game-rainbow6.ubi.com/assets/data/operators.f660ac39.json"; - internal const string Weapons = "https://game-rainbow6.ubi.com/assets/data/weapons.8a9b3d9e.json"; - } -} diff --git a/R6Sharp/Endpoint/PlayerEndpoint.cs b/R6Sharp/Endpoint/PlayerEndpoint.cs deleted file mode 100644 index 3afd65b..0000000 --- a/R6Sharp/Endpoint/PlayerEndpoint.cs +++ /dev/null @@ -1,123 +0,0 @@ -using R6Sharp.Response; -using System; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading.Tasks; -using System.Web; - -namespace R6Sharp.Endpoint -{ - public class PlayerEndpoint - { - private readonly SessionEndpoint _sessionHandler; - - public PlayerEndpoint(SessionEndpoint sessionHandler) - { - _sessionHandler = sessionHandler; - } - - /// - /// Get a list of ranked profiles (like or ). - /// - /// - /// The UUIDs matching the player profiles./> beforehand). - /// - /// - /// The platform belong to. - /// - /// - /// The region belong to. - /// - /// - /// The seasonal stats to search for. - /// - /// - /// A list of players matching the request terms in a dictionary (to be referenced with the player UUID as key). - /// - public async Task> GetRankedAsync(Guid[] uuids, Platform platform, Region region, int season) - { - var queries = new List> - { - new KeyValuePair("profile_ids", string.Join(',', uuids)), - new KeyValuePair("board_id", "pvp_ranked"), - new KeyValuePair("region_id", Constant.RegionToString(region)), - new KeyValuePair("season_id", season.ToString()) - }; - - var ticket = await _sessionHandler.GetTicketAsync().ConfigureAwait(false); - var results = await ApiHelper.GetDataAsync(Endpoints.Players, platform, queries, ticket).ConfigureAwait(false); - var deserialised = JsonSerializer.Deserialize(results); - return deserialised.Players; - } - - /// - /// Get a list of casual profiles (like or ). - /// - /// - /// The UUIDs matching the player profiles./> beforehand). - /// - /// - /// The platform belong to. - /// - /// - /// The region belong to. - /// - /// - /// The seasonal stats to search for. - /// - /// - /// A list of players matching the request terms in a dictionary (to be referenced with the player UUID as key). - /// - public async Task> GetCasualAsync(Guid[] uuids, Platform platform, Region region, int season) - { - var queries = new List> - { - new KeyValuePair("profile_ids", string.Join(',', uuids)), - new KeyValuePair("board_id", "pvp_casual"), - new KeyValuePair("region_id", Constant.RegionToString(region)), - new KeyValuePair("season_id", season.ToString()) - }; - - var ticket = await _sessionHandler.GetTicketAsync().ConfigureAwait(false); - var results = await ApiHelper.GetDataAsync(Endpoints.Players, platform, queries, ticket).ConfigureAwait(false); - var deserialised = JsonSerializer.Deserialize(results); - return deserialised.Players; - } - - /// - public async Task> GetRankedAsync(Guid uuid, Platform platform, Region region) - { - return await GetRankedAsync(uuid, platform, region, -1).ConfigureAwait(false); - } - - /// - public async Task> GetRankedAsync(Guid[] uuids, Platform platform, Region region) - { - return await GetRankedAsync(uuids, platform, region, -1).ConfigureAwait(false); - } - - /// - public async Task> GetRankedAsync(Guid uuid, Platform platform, Region region, int season) - { - return await GetRankedAsync(new[] { uuid }, platform, region, season).ConfigureAwait(false); - } - - /// - public async Task> GetCasualAsync(Guid uuid, Platform platform, Region region) - { - return await GetCasualAsync(uuid, platform, region, -1).ConfigureAwait(false); - } - - /// - public async Task> GetCasualAsync(Guid[] uuids, Platform platform, Region region) - { - return await GetCasualAsync(uuids, platform, region, -1).ConfigureAwait(false); - } - - /// - public async Task> GetCasualAsync(Guid uuid, Platform platform, Region region, int season) - { - return await GetCasualAsync(new[] { uuid }, platform, region, season).ConfigureAwait(false); - } - } -} diff --git a/R6Sharp/Endpoint/PlayerProgressionEndpoint.cs b/R6Sharp/Endpoint/PlayerProgressionEndpoint.cs deleted file mode 100644 index 1761a66..0000000 --- a/R6Sharp/Endpoint/PlayerProgressionEndpoint.cs +++ /dev/null @@ -1,56 +0,0 @@ -using R6Sharp.Response; -using System; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading.Tasks; -using System.Web; - -namespace R6Sharp.Endpoint -{ - public class PlayerProgressionEndpoint - { - private readonly SessionEndpoint _sessionHandler; - - public PlayerProgressionEndpoint(SessionEndpoint sessionHandler) - { - _sessionHandler = sessionHandler; - } - - /// - /// Get a list of basic profiles (like and ). - /// - /// - /// The UUIDs matching the player profiles (should be searched with beforehand). - /// - /// - /// The platform belong to. - /// - /// - /// A list of basic profiles matching the request terms. - /// - public async Task> GetPlayerProgressionAsync(Guid[] uuids, Platform platform) - { - var queries = new List> - { - new KeyValuePair("profile_ids", string.Join(',', uuids)) - }; - - var ticket = await _sessionHandler.GetTicketAsync().ConfigureAwait(false); - var results = await ApiHelper.GetDataAsync(Endpoints.Progressions, platform, queries, ticket).ConfigureAwait(false); - var deserialised = JsonSerializer.Deserialize(results); - foreach (var result in deserialised.PlayerProgressions) - { - // Attach link to player profile icon url - result.ProfileIcon = new Uri(string.Format(Endpoints.Avatar, result.ProfileId, Constant.Rainbow6S)); - } - return deserialised.PlayerProgressions; - } - - /// - public async Task GetPlayerProgressionAsync(Guid uuid, Platform platform) - { - var profiles = await GetPlayerProgressionAsync(new[] { uuid }, platform).ConfigureAwait(false); - return profiles.Count > 0 ? profiles[0] : null; - } - } -} diff --git a/R6Sharp/Endpoint/ProfileEndpoint.cs b/R6Sharp/Endpoint/ProfileEndpoint.cs deleted file mode 100644 index 6af8301..0000000 --- a/R6Sharp/Endpoint/ProfileEndpoint.cs +++ /dev/null @@ -1,75 +0,0 @@ -using R6Sharp.Response; -using System; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading.Tasks; -using System.Web; - -namespace R6Sharp.Endpoint -{ - public class ProfileEndpoint - { - private readonly SessionEndpoint _sessionHandler; - - public ProfileEndpoint(SessionEndpoint sessionHandler) - { - _sessionHandler = sessionHandler; - } - - /// - /// Search for a player on Rainbow 6 Siege. - /// - /// - /// The player names to search for. - /// - /// - /// The platform the player is on.d - /// - /// - /// A list of players that matched the terms. - /// - public async Task> GetProfileAsync(string[] players, Platform platform) - { - var queries = new List> - { - new KeyValuePair("nameOnPlatform", HttpUtility.UrlEncode(string.Join(',', players))), - new KeyValuePair("platformType", Constant.PlatformToString(platform)) - }; - - var ticket = await _sessionHandler.GetTicketAsync().ConfigureAwait(false); - var results = await ApiHelper.GetDataAsync(Endpoints.Search, null, queries, ticket).ConfigureAwait(false); - var deserialised = JsonSerializer.Deserialize(results); - return deserialised.Profiles; - } - - /// - public async Task GetProfileAsync(string player, Platform platform) - { - var profiles = await GetProfileAsync(new string[] { player }, platform).ConfigureAwait(false); - // the search result could contain more than one result, return first anyways - return profiles.Count > 0 ? profiles[0] : null; - } - - public async Task> GetProfileAsync(Guid[] uuids, Platform platform) - { - var queries = new List> - { - new KeyValuePair("idOnPlatform", HttpUtility.UrlEncode(string.Join(',', uuids))), - new KeyValuePair("platformType", Constant.PlatformToString(platform)) - }; - - var ticket = await _sessionHandler.GetTicketAsync().ConfigureAwait(false); - var results = await ApiHelper.GetDataAsync(Endpoints.Search, null, queries, ticket).ConfigureAwait(false); - var deserialised = JsonSerializer.Deserialize(results); - return deserialised.Profiles; - } - - /// - public async Task GetProfileAsync(Guid uuid, Platform platform) - { - var profiles = await GetProfileAsync(new Guid[] { uuid }, platform).ConfigureAwait(false); - // the search result could contain more than one result, return first anyways - return profiles.Count > 0 ? profiles[0] : null; - } - } -} diff --git a/R6Sharp/Endpoint/SessionEndpoint.cs b/R6Sharp/Endpoint/SessionEndpoint.cs deleted file mode 100644 index 40c4faf..0000000 --- a/R6Sharp/Endpoint/SessionEndpoint.cs +++ /dev/null @@ -1,115 +0,0 @@ -using R6Sharp.Response; -using System; -using System.Collections.Generic; -using System.IO; -using System.Net; -using System.Runtime.Serialization; -using System.Text; -using System.Text.Json; -using System.Threading.Tasks; - -namespace R6Sharp.Endpoint -{ - public class SessionEndpoint - { - /// - /// Credential in base64 acquired from constructor. - /// - private readonly string _credentialsb64; - - /// - /// Current session details with Ubisoft. - /// - private Session _currentSession; - - /// - /// Control if Ubisoft's session handler should remember current session. - /// - public bool RememberMe { get; set; } - - public SessionEndpoint(string email, string password, bool rememberMe) - { - RememberMe = rememberMe; - // Generate an auth for acquiring a token - var auth = $"{email}:{password}"; - var bytes = Encoding.UTF8.GetBytes(auth); - _credentialsb64 = Convert.ToBase64String(bytes); - } - - public async Task GetTicketAsync() - { - var sessionFileName = "session.json"; - var requestNewSession = false; - // If Session exists in memory, check if it has expired - if (_currentSession != null) - { - var now = DateTime.UtcNow; - if (now >= _currentSession.Expiration) - { - // Session expired, get new session - requestNewSession = true; - } - } - else - { - // This is the first time starting session, check if session details were saved as JSON - try - { - var json = File.ReadAllText(sessionFileName); - var loadedSession = JsonSerializer.Deserialize(json); - - // If Session was readable and there is time before expiration - if (loadedSession != null && DateTime.UtcNow < loadedSession.Expiration) - { - // Use the loaded session - _currentSession = loadedSession; - } - else - { - // Get new session - requestNewSession = true; - } - } - catch (Exception e) - { - // Session file was not found or it was malformed/invalid - if (e is FileNotFoundException || e is JsonException) - { - requestNewSession = true; - } - else - { - // Error is unknown, rethrow it - throw; - } - } - } - - if (requestNewSession) - { - // Refresh current session details (will get new session if expired or non-existent) - _currentSession = await GetSessionAsync().ConfigureAwait(false); - // Save new session to file - var serialisedSession = JsonSerializer.Serialize(_currentSession); - File.WriteAllText(sessionFileName, serialisedSession); - } - - return _currentSession.Ticket; - } - - private async Task GetSessionAsync() - { - // Build json for remembering (or not) the user/session - byte[] data = Encoding.UTF8.GetBytes($"{{\"rememberMe\": {(RememberMe ? "true" : "false")}}}"); - // Add authorization header - var headervaluepairs = new[] - { - new KeyValuePair(HttpRequestHeader.Authorization, $"Basic {_credentialsb64}") - }; - - // Get result from endpoint - var response = await ApiHelper.BuildRequestAsync(new Uri(Endpoints.Sessions), headervaluepairs, data, false).ConfigureAwait(false); - return JsonSerializer.Deserialize(response); - } - } -} diff --git a/R6Sharp/Endpoint/StaticEndpoint.cs b/R6Sharp/Endpoint/StaticEndpoint.cs deleted file mode 100644 index fb93a8e..0000000 --- a/R6Sharp/Endpoint/StaticEndpoint.cs +++ /dev/null @@ -1,177 +0,0 @@ -using R6Sharp.Response.Static; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading.Tasks; - -namespace R6Sharp.Endpoint -{ - public enum Language - { - AmericanEnglish, - AustralianEnglish, - BrazilianPortuguese, - BritishEnglish, - CanadianFrench, - Czech, - Dutch, - EuropeanFrench, - EuropeanSpanish, - German, - Italian, - Japanese, - Korean, - LatinSpanish, - NordicEnglish, - Polish, - Russian, - SimplifiedChinese, - TraditionalChinese - } - - public class StaticEndpoint - { - /// - /// Get string representation of Ubisoft available locales. - /// - private static string FromLanguage(Language language) - { - return language switch - { - Language.AmericanEnglish => "en-us", - Language.AustralianEnglish => "en-au", - Language.BrazilianPortuguese => "pt-br", - Language.BritishEnglish => "en-gb", - Language.CanadianFrench => "fr-ca", - Language.Czech => "cs-cz", - Language.Dutch => "nl-nl", - Language.EuropeanFrench => "fr-fr", - Language.EuropeanSpanish => "es-es", - Language.German => "de-de", - Language.Italian => "it-it", - Language.Japanese => "ja-jp", - Language.Korean => "ko-kr", - Language.LatinSpanish => "es-mx", - Language.NordicEnglish => "en-nordic", - Language.Polish => "pl-pl", - Language.Russian => "ru-ru", - Language.SimplifiedChinese => "zh-cn", - Language.TraditionalChinese => "zh-tw", - _ => default, - }; - } - - /// - /// Get hash of the locale file that is present on Ubisoft's servers. - /// - private static string GetLocaleHash(Language language) - { - return language switch - { - Language.AmericanEnglish => "6eb4f5cd", - Language.BrazilianPortuguese => "7ad95128", - Language.EuropeanFrench => "4f78c986", - Language.Czech => "dc66e300", - Language.Dutch => "80a0b37a", - Language.EuropeanSpanish => "5e27d9fa", - Language.German => "47a861dd", - Language.Italian => "4ac66a00", - Language.Japanese => "30330c03", - Language.Korean => "31170d10", - Language.LatinSpanish => "979289ed", - Language.Polish => "845c3d39", - Language.Russian => "22e559b7", - Language.SimplifiedChinese => "23f064e8", - Language.TraditionalChinese => "52f0c5ec", - _ => default, - }; - } - - /// - /// Get locale dictionary based on requested language. - /// - /// - /// Dictionary with list of items (oasisId and value) that contains localization items. - /// - public async Task> GetLocaleAsync(Language language) - { - // Transform input language to ones Ubisoft uses for localization - Language lang; - switch (language) - { - case Language.AustralianEnglish: - case Language.BritishEnglish: - case Language.NordicEnglish: - lang = Language.AmericanEnglish; - break; - case Language.CanadianFrench: - lang = Language.EuropeanFrench; - break; - default: - lang = language; - break; - } - - var formatted = string.Format(Endpoints.Locales, FromLanguage(lang), GetLocaleHash(lang)); - var results = await ApiHelper.GetDataAsync(formatted, null, null, null).ConfigureAwait(false); - return JsonSerializer.Deserialize>(results); - } - - /// - /// Get overall seasons data (season 2 and onwards). - /// - /// - /// List of seasons with their respective details like ranks and divisions. - /// - public async Task> GetSeasonDetailsAsync() - { - // Fetch ranked static data - var fetch = await ApiHelper.GetDataAsync(Endpoints.Ranks, null, null, null).ConfigureAwait(false); - var deserialized = JsonSerializer.Deserialize(fetch); - // Prefix R6 base URL to the images URL so it is ready to use as it is - foreach (var season in deserialized.Seasons) - { - foreach (var rank in season.Ranks) - { - rank.Images.Default = string.Join('/', Endpoints.Base, rank.Images.Default); - rank.Images.Hd = string.Join('/', Endpoints.Base, rank.Images.Hd); - } - } - return deserialized.Seasons; - } - - /// - /// Get information based on past and current seasons. - /// - /// - /// Latest season and dictionary of seasons with their respective names and URL to season background. - /// - public async Task GetSeasonsInfoAsync() - { - var results = await ApiHelper.GetDataAsync(Endpoints.Seasons, null, null, null).ConfigureAwait(false); - return JsonSerializer.Deserialize(results); - } - - /// - /// Get information specific to a season. - /// - /// - /// The season number, such as 18 for Steel Wave, or -1 for latest. - /// - /// - /// Season details. - /// - public async Task GetSeasonAsync(int id) - { - var info = await GetSeasonsInfoAsync().ConfigureAwait(false); - var season = info.Seasons[id < 0 ? info.LatestSeason.ToString() : id.ToString()]; - season.Id = id < 0 ? info.LatestSeason : id; - return season; - } - - /// - public async Task GetSeasonAsync() - { - return await GetSeasonAsync(-1).ConfigureAwait(false); - } - } -} diff --git a/R6Sharp/Endpoint/StatisticEndpoint.cs b/R6Sharp/Endpoint/StatisticEndpoint.cs deleted file mode 100644 index 74da575..0000000 --- a/R6Sharp/Endpoint/StatisticEndpoint.cs +++ /dev/null @@ -1,110 +0,0 @@ -using R6Sharp.Response.Statistic; -using System; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading.Tasks; - -namespace R6Sharp.Endpoint -{ - public class StatisticEndpoint - { - private readonly SessionEndpoint _sessionHandler; - - public StatisticEndpoint(SessionEndpoint sessionHandler) - { - _sessionHandler = sessionHandler; - } - - private async Task>> GetStatisticsAsync(Guid[] uuids, Platform platform, StatisticsType type) - { - var variables = Constant.GetVariables(type); - var results = await FetchStatisticsAsync(uuids, platform, variables).ConfigureAwait(false); - var deserialized = JsonSerializer.Deserialize>>>(results); - return deserialized["results"]; - } - - private async Task> GetStatisticsAsync(Guid uuid, Platform platform, StatisticsType type) - { - var result = await GetStatisticsAsync(new[] { uuid }, platform, type).ConfigureAwait(false); - return result[uuid.ToString()]; - } - - public async Task> GetEquipmentStatistics(Guid[] uuids, Platform platform) - { - var result = await FetchStatisticsAsync(uuids, platform, Constant.GetVariables(StatisticsType.Equipments)).ConfigureAwait(false); - var deserialised = JsonSerializer.Deserialize(result); - return deserialised.EquipmentStatistics; - } - - public async Task GetEquipmentStatistics(Guid uuid, Platform platform) - { - var result = await GetEquipmentStatistics(new Guid[] { uuid }, platform).ConfigureAwait(false); - return result[uuid.ToString()]; - } - - public async Task> GetGamemodeStatistics(Guid[] uuids, Platform platform) - { - var result = await FetchStatisticsAsync(uuids, platform, Constant.GetVariables(StatisticsType.Gamemodes)).ConfigureAwait(false); - var deserialised = JsonSerializer.Deserialize(result); - return deserialised.GamemodeStatistics; - } - - public async Task GetGamemodeStatistics(Guid uuid, Platform platform) - { - var result = await GetGamemodeStatistics(new Guid[] { uuid }, platform).ConfigureAwait(false); - return result[uuid.ToString()]; - } - - public async Task> GetOperatorStatistics(Guid[] uuids, Platform platform) - { - var result = await FetchStatisticsAsync(uuids, platform, Constant.GetVariables(StatisticsType.Operators)).ConfigureAwait(false); - var deserialised = JsonSerializer.Deserialize(result); - return deserialised.OperatorStatistics; - } - - public async Task GetOperatorStatistics(Guid uuid, Platform platform) - { - var result = await GetOperatorStatistics(new Guid[] { uuid }, platform).ConfigureAwait(false); - return result[uuid.ToString()]; - } - - public async Task> GetQueueStatistics(Guid[] uuids, Platform platform) - { - var result = await FetchStatisticsAsync(uuids, platform, Constant.GetVariables(StatisticsType.Queues)).ConfigureAwait(false); - var deserialised = JsonSerializer.Deserialize(result); - return deserialised.QueueStatistics; - } - - public async Task GetQueueStatistics(Guid uuid, Platform platform) - { - var result = await GetQueueStatistics(new Guid[] { uuid }, platform).ConfigureAwait(false); - return result[uuid.ToString()]; - } - - public async Task> GetTerroristHuntMissionsStatistics(Guid[] uuids, Platform platform) - { - var result = await FetchStatisticsAsync(uuids, platform, Constant.GetVariables(StatisticsType.Equipments)).ConfigureAwait(false); - var deserialised = JsonSerializer.Deserialize(result); - return deserialised.TerroristHuntMissionStatistics; - } - - public async Task GetTerroristHuntMissionsStatistics(Guid uuid, Platform platform) - { - var result = await GetTerroristHuntMissionsStatistics(new Guid[] { uuid }, platform).ConfigureAwait(false); - return result[uuid.ToString()]; - } - - private async Task FetchStatisticsAsync(Guid[] uuids, Platform platform, params string[] variables) - { - var queries = new List> - { - new KeyValuePair("populations", string.Join(',', uuids)), - new KeyValuePair("statistics", string.Join(',', variables)) - }; - - var ticket = await _sessionHandler.GetTicketAsync().ConfigureAwait(false); - var results = await ApiHelper.GetDataAsync(Endpoints.Statistics, platform, queries, ticket).ConfigureAwait(false); - return results; - } - } -} diff --git a/R6Sharp/R6Api.cs b/R6Sharp/R6Api.cs index d71de52..80faebc 100644 --- a/R6Sharp/R6Api.cs +++ b/R6Sharp/R6Api.cs @@ -1,83 +1,42 @@ -using R6Sharp.Endpoint; -using System; -using System.Threading.Tasks; -using System.Web; +using R6DataAccess.DataFactory; +using R6DataAccess.Endpoint.PlayerEndPoint; +using R6DataAccess.Endpoint.StatisticEndPoint; +using R6DataAccess.Interfaces; +using R6DataAccess.Models; +using R6Sharp.Endpoint; + namespace R6Sharp { - /// - /// Region the player is based in. - /// - public enum Region - { - APAC, // Asia Pacific :( - EMEA, // Europe, Middle East and Africa - NCSA // North, Central and South America - } - - /// - /// Platform the player is based on. - /// - public enum Platform - { - Uplay, // Uplay - PSN, // Playstation Network - XBL // Xbox Live - } + public class R6Api { - public readonly ProfileEndpoint Profile; - public readonly PlayerProgressionEndpoint PlayerProgression; - public readonly PlayerEndpoint Player; - public readonly StatisticEndpoint Statistic; - public readonly StaticEndpoint Static; + public readonly IProfileEndpoint Profile; + private readonly ISessionEndpoint _sessionEndpoint; + public readonly IPlayerProgressionEndpoint PlayerProgression; + public readonly IPlayerEndpoint Player; + public readonly IStaticEndpoint Static; + public readonly IStatisticEndpoint Statistic; - #region Constructors /// - /// Create a R6S API instance with remember me defaulting to true + /// /// - /// - /// Email address of a Ubisoft account. - /// - /// - /// Password of a Ubisoft account. - /// - public R6Api(string email, string password) : this(email, password, true) + /// + public R6Api(IAuth auth) { + + _sessionEndpoint = EndPointFactory.GetSessionEndpoint(auth); - } - - /// - /// Create a R6S API instance with optional remember me option. - /// - /// - /// Email address of a Ubisoft account. - /// - /// - /// Password of a Ubisoft account. - /// - /// - /// Option for Ubisoft to remember this instance's session (can be changed over time by . - /// - public R6Api(string email, string password, bool rememberMe) - { - if (string.IsNullOrWhiteSpace(email)) - { - throw new ArgumentNullException(this.GetType().FullName, "Email address cannot be null or empty."); - } - else if (string.IsNullOrWhiteSpace(password)) - { - throw new ArgumentNullException(this.GetType().FullName, "Password cannot be null or empty."); - } + Profile = EndPointFactory.GetProfileEndpoint(_sessionEndpoint); + PlayerProgression = EndPointFactory.GetPlayerProgressionEndpoint(_sessionEndpoint); + Player = EndPointFactory.GetPlayerEndpoint(_sessionEndpoint); + Static = EndPointFactory.GetStaticEndpoint(_sessionEndpoint); + Statistic = EndPointFactory.GetStatisticEndpoint(_sessionEndpoint); - var _session = new SessionEndpoint(email, password, rememberMe); - Profile = new ProfileEndpoint(_session); - PlayerProgression = new PlayerProgressionEndpoint(_session); - Player = new PlayerEndpoint(_session); - Statistic = new StatisticEndpoint(_session); - Static = new StaticEndpoint(); + + } - #endregion + } } diff --git a/R6Sharp/R6Sharp.csproj b/R6Sharp/R6Sharp.csproj index cebfcd1..8f7f007 100644 --- a/R6Sharp/R6Sharp.csproj +++ b/R6Sharp/R6Sharp.csproj @@ -21,6 +21,10 @@ + + + +