diff --git a/src/Steam.Models/DOTA2/MatchPlayerAdditionalUnitModel.cs b/src/Steam.Models/DOTA2/MatchPlayerAdditionalUnitModel.cs new file mode 100644 index 0000000..be1630e --- /dev/null +++ b/src/Steam.Models/DOTA2/MatchPlayerAdditionalUnitModel.cs @@ -0,0 +1,27 @@ +namespace Steam.Models.DOTA2 +{ + public class MatchPlayerAdditionalUnitModel + { + public string Unitname { get; set; } + + public uint Item0 { get; set; } + + public uint Item1 { get; set; } + + public uint Item2 { get; set; } + + public uint Item3 { get; set; } + + public uint Item4 { get; set; } + + public uint Item5 { get; set; } + + public uint Backpack0 { get; set; } + + public uint Backpack1 { get; set; } + + public uint Backpack2 { get; set; } + + public uint ItemNeutral { get; set; } + } +} \ No newline at end of file diff --git a/src/Steam.Models/DOTA2/MatchPlayerModel.cs b/src/Steam.Models/DOTA2/MatchPlayerModel.cs index 6d42e5b..f3e07da 100644 --- a/src/Steam.Models/DOTA2/MatchPlayerModel.cs +++ b/src/Steam.Models/DOTA2/MatchPlayerModel.cs @@ -50,6 +50,14 @@ public class MatchPlayerModel public uint GoldSpent { get; set; } + public uint NetWorth { get; set; } + + public uint AghanimsScepter { get; set; } + + public uint AghanimsShard { get; set; } + + public uint Moonshard { get; set; } + public uint HeroDamage { get; set; } public uint ScaledHeroDamage { get; set; } @@ -65,5 +73,7 @@ public class MatchPlayerModel public uint Level { get; set; } public IReadOnlyCollection AbilityUpgrades { get; set; } + + public IReadOnlyCollection AdditionalUnits { get; set; } } } \ No newline at end of file diff --git a/src/Steam.UnitTests/DOTA2MatchTests.cs b/src/Steam.UnitTests/DOTA2MatchTests.cs index 122a4ed..43c0a99 100644 --- a/src/Steam.UnitTests/DOTA2MatchTests.cs +++ b/src/Steam.UnitTests/DOTA2MatchTests.cs @@ -30,9 +30,14 @@ public async Task GetLiveLeagueGamesAsync_Should_Succeed() [Fact] public async Task GetMatchDetailsAsync_Should_Succeed() { - var response = await steamInterface.GetMatchDetailsAsync(5327512468); - Assert.NotNull(response); - Assert.NotNull(response.Data); + //Old game without some params + var responseOld = await steamInterface.GetMatchDetailsAsync(5327512468); + //game played - 31.10.2021 + var responseNew = await steamInterface.GetMatchDetailsAsync(6249820594); + Assert.NotNull(responseOld); + Assert.NotNull(responseOld.Data); + Assert.NotNull(responseNew); + Assert.NotNull(responseNew.Data); } [Fact] diff --git a/src/Steam.UnitTests/SteamUserTests.cs b/src/Steam.UnitTests/SteamUserTests.cs index 3967112..f0e1c14 100644 --- a/src/Steam.UnitTests/SteamUserTests.cs +++ b/src/Steam.UnitTests/SteamUserTests.cs @@ -3,6 +3,7 @@ using SteamWebAPI2.Utilities; using System; using System.Collections.Generic; +using System.Globalization; using System.Net.Http; using System.Text; using System.Threading.Tasks; @@ -80,7 +81,9 @@ public async Task ResolveVanityUrlAsync_Should_Succeed() [Fact] public async Task GetCommunityProfileAsync_Should_Succeed() { - var response = await steamInterface.GetCommunityProfileAsync(76561198050013009); + //for other cultures (for example ru) automaper will not be able to convert floating point numbers and will throw an error + CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("en"); + var response = await steamInterface.GetCommunityProfileAsync(76561198064401017); Assert.NotNull(response); } } diff --git a/src/SteamWebAPI2/Mappings/DOTA2MatchProfile.cs b/src/SteamWebAPI2/Mappings/DOTA2MatchProfile.cs index 34179cc..7fb55a4 100644 --- a/src/SteamWebAPI2/Mappings/DOTA2MatchProfile.cs +++ b/src/SteamWebAPI2/Mappings/DOTA2MatchProfile.cs @@ -40,6 +40,7 @@ public DOTA2MatchProfile() CreateMap() .ForMember(dest => dest.StartTime, opts => opts.MapFrom(src => src.StartTime.ToDateTime())); CreateMap(); + CreateMap(); CreateMap(); CreateMap(); CreateMap().ConvertUsing((src, dest, context) => diff --git a/src/SteamWebAPI2/Models/DOTA2/MatchDetailResultContainer.cs b/src/SteamWebAPI2/Models/DOTA2/MatchDetailResultContainer.cs index 7a9f23d..e2d0fa9 100644 --- a/src/SteamWebAPI2/Models/DOTA2/MatchDetailResultContainer.cs +++ b/src/SteamWebAPI2/Models/DOTA2/MatchDetailResultContainer.cs @@ -10,6 +10,41 @@ internal class MatchPlayerAbilityUpgrade public uint Level { get; set; } } + internal class MatchPlayerAdditionalUnit + { + public string Unitname { get; set; } + + [JsonProperty(PropertyName = "item_0")] + public uint Item0 { get; set; } + + [JsonProperty(PropertyName = "item_1")] + public uint Item1 { get; set; } + + [JsonProperty(PropertyName = "item_2")] + public uint Item2 { get; set; } + + [JsonProperty(PropertyName = "item_3")] + public uint Item3 { get; set; } + + [JsonProperty(PropertyName = "item_4")] + public uint Item4 { get; set; } + + [JsonProperty(PropertyName = "item_5")] + public uint Item5 { get; set; } + + [JsonProperty(PropertyName = "backpack_0")] + public uint Backpack0 { get; set; } + + [JsonProperty(PropertyName = "backpack_1")] + public uint Backpack1 { get; set; } + + [JsonProperty(PropertyName = "backpack_2")] + public uint Backpack2 { get; set; } + + [JsonProperty(PropertyName = "item_neutral")] + public uint ItemNeutral { get; set; } + } + internal class MatchPlayer { [JsonProperty(PropertyName = "account_id")] @@ -74,6 +109,17 @@ internal class MatchPlayer [JsonProperty(PropertyName = "gold_spent")] public uint GoldSpent { get; set; } + [JsonProperty(PropertyName = "net_worth")] + public uint NetWorth { get; set; } + + [JsonProperty(PropertyName = "aghanims_scepter")] + public uint AghanimsScepter { get; set; } + + [JsonProperty(PropertyName = "aghanims_shard")] + public uint AghanimsShard { get; set; } + + public uint Moonshard { get; set; } + [JsonProperty(PropertyName = "hero_damage")] public uint HeroDamage { get; set; } @@ -96,6 +142,9 @@ internal class MatchPlayer [JsonProperty(PropertyName = "ability_upgrades")] public IList AbilityUpgrades { get; set; } + + [JsonProperty(PropertyName = "additional_units")] + public IList AdditionalUnits { get; set; } } internal class MatchPickBan