From 54c51b9b109542de8027bcbf50bac1fe54d1615d Mon Sep 17 00:00:00 2001 From: wlad1164 Date: Sat, 12 Nov 2022 01:37:44 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D1=80=D0=B5=D0=B3=D0=B8=D0=BE=D0=BD=20RUBY=20(tanki.s?= =?UTF-8?q?u,=20LESTA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WotAPI/Api/Accounts/Player/Achievements.cs | 2 +- src/WotAPI/Api/Accounts/Player/Info.cs | 2 +- src/WotAPI/Api/Accounts/Player/Vehicles.cs | 2 +- src/WotAPI/Api/Accounts/Players.cs | 2 +- src/WotAPI/Api/Clans/Clan/Glossary.cs | 2 +- src/WotAPI/Api/Clans/Clan/Info.cs | 2 +- src/WotAPI/Api/Clans/Clans.cs | 2 +- src/WotAPI/Api/Clans/Player/History.cs | 2 +- src/WotAPI/Api/Clans/Player/Info.cs | 2 +- src/WotAPI/Api/GlobalMap/Clan/Info.cs | 2 +- src/WotAPI/Api/GlobalMap/Fronts.cs | 2 +- src/WotAPI/Api/GlobalMap/Status.cs | 2 +- src/WotAPI/Api/Strongholds/Clan/Info.cs | 2 +- src/WotAPI/Api/Tankopedia/Achievements.cs | 2 +- src/WotAPI/Api/Tankopedia/Badges.cs | 2 +- src/WotAPI/Api/Tankopedia/Crew/Roles.cs | 2 +- src/WotAPI/Api/Tankopedia/Crew/Skills.cs | 2 +- src/WotAPI/Api/Tankopedia/Equipment.cs | 2 +- src/WotAPI/Api/Tankopedia/Info.cs | 2 +- src/WotAPI/Api/Tankopedia/Maps.cs | 2 +- src/WotAPI/Api/Tankopedia/PersonalMissions.cs | 2 +- src/WotAPI/Api/Tankopedia/PersonalReserves.cs | 2 +- src/WotAPI/Api/Tankopedia/Vehicle/Info.cs | 2 +- src/WotAPI/Api/Tankopedia/Vehicle/Profile.cs | 2 +- src/WotAPI/ResponseClass.cs | 10 +++++++--- src/WotAPI/WotApi.cs | 3 ++- 26 files changed, 33 insertions(+), 28 deletions(-) diff --git a/src/WotAPI/Api/Accounts/Player/Achievements.cs b/src/WotAPI/Api/Accounts/Player/Achievements.cs index 220767f..dac3f60 100644 --- a/src/WotAPI/Api/Accounts/Player/Achievements.cs +++ b/src/WotAPI/Api/Accounts/Player/Achievements.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Accounts.Player; -[Response("https://api.worldoftanks.ru/wot/account/achievements/?account_id={search}", true)] +[Response("https://{region_site}/wot/account/achievements/?account_id={search}", true)] public class Achievements : ResponseClass { public class Data diff --git a/src/WotAPI/Api/Accounts/Player/Info.cs b/src/WotAPI/Api/Accounts/Player/Info.cs index 7acbb8c..5496bfa 100644 --- a/src/WotAPI/Api/Accounts/Player/Info.cs +++ b/src/WotAPI/Api/Accounts/Player/Info.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Accounts.Player; -[Response("https://api.worldoftanks.ru/wot/account/info/?account_id={search}", true)] +[Response("https://{region_site}/wot/account/info/?account_id={search}", true)] public class Info : ResponseClass { public class Data diff --git a/src/WotAPI/Api/Accounts/Player/Vehicles.cs b/src/WotAPI/Api/Accounts/Player/Vehicles.cs index 81284f0..cfa8a50 100644 --- a/src/WotAPI/Api/Accounts/Player/Vehicles.cs +++ b/src/WotAPI/Api/Accounts/Player/Vehicles.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Accounts.Player; -[Response("https://api.worldoftanks.ru/wot/account/tanks/?account_id={search}", true)] +[Response("https://{region_site}/wot/account/tanks/?account_id={search}", true)] public class Vehicles : ResponseClass { public class Data diff --git a/src/WotAPI/Api/Accounts/Players.cs b/src/WotAPI/Api/Accounts/Players.cs index da0a392..e2d3a7d 100644 --- a/src/WotAPI/Api/Accounts/Players.cs +++ b/src/WotAPI/Api/Accounts/Players.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Accounts; -[Response("https://api.worldoftanks.ru/wot/account/list/?search={search}")] +[Response("https://{region_site}/wot/account/list/?search={search}")] public class Players : ResponseClass { public class Player diff --git a/src/WotAPI/Api/Clans/Clan/Glossary.cs b/src/WotAPI/Api/Clans/Clan/Glossary.cs index 8548724..cb65e7c 100644 --- a/src/WotAPI/Api/Clans/Clan/Glossary.cs +++ b/src/WotAPI/Api/Clans/Clan/Glossary.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Clans.Clan; -[Response("https://api.worldoftanks.ru/wot/clans/glossary/")] +[Response("https://{region_site}/wot/clans/glossary/")] public class Glossary : ResponseClass { public class Data diff --git a/src/WotAPI/Api/Clans/Clan/Info.cs b/src/WotAPI/Api/Clans/Clan/Info.cs index 40bbc7d..b7028df 100644 --- a/src/WotAPI/Api/Clans/Clan/Info.cs +++ b/src/WotAPI/Api/Clans/Clan/Info.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Clans.Clan; -[Response("https://api.worldoftanks.ru/wot/clans/info/?clan_id={search}", true)] +[Response("https://{region_site}/wot/clans/info/?clan_id={search}", true)] public class Info : ResponseClass { public class Data diff --git a/src/WotAPI/Api/Clans/Clans.cs b/src/WotAPI/Api/Clans/Clans.cs index 7cd8eca..9c8e176 100644 --- a/src/WotAPI/Api/Clans/Clans.cs +++ b/src/WotAPI/Api/Clans/Clans.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Clans; -[Response("https://api.worldoftanks.ru/wot/clans/list/?search={search}")] +[Response("https://{region_site}/wot/clans/list/?search={search}")] public class Clans : ResponseClass { public class Clan diff --git a/src/WotAPI/Api/Clans/Player/History.cs b/src/WotAPI/Api/Clans/Player/History.cs index ee8d24a..b1053a2 100644 --- a/src/WotAPI/Api/Clans/Player/History.cs +++ b/src/WotAPI/Api/Clans/Player/History.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Clans.Player; -[Response("https://api.worldoftanks.ru/wot/clans/memberhistory/?account_id={search}", true)] +[Response("https://{region_site}/wot/clans/memberhistory/?account_id={search}", true)] public class History : ResponseClass { public class Data diff --git a/src/WotAPI/Api/Clans/Player/Info.cs b/src/WotAPI/Api/Clans/Player/Info.cs index db519cc..2bbcf93 100644 --- a/src/WotAPI/Api/Clans/Player/Info.cs +++ b/src/WotAPI/Api/Clans/Player/Info.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Clans.Player; -[Response("https://api.worldoftanks.ru/wot/clans/accountinfo/?account_id={search}", true)] +[Response("https://{region_site}/wot/clans/accountinfo/?account_id={search}", true)] public class Info : ResponseClass { public class Data diff --git a/src/WotAPI/Api/GlobalMap/Clan/Info.cs b/src/WotAPI/Api/GlobalMap/Clan/Info.cs index 910fbf9..5b8cf53 100644 --- a/src/WotAPI/Api/GlobalMap/Clan/Info.cs +++ b/src/WotAPI/Api/GlobalMap/Clan/Info.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.GlobalMap.Clan; -[Response("https://api.worldoftanks.ru/wot/globalmap/claninfo/?clan_id={search}", true)] +[Response("https://{region_site}/wot/globalmap/claninfo/?clan_id={search}", true)] public class Info : ResponseClass { public class Data diff --git a/src/WotAPI/Api/GlobalMap/Fronts.cs b/src/WotAPI/Api/GlobalMap/Fronts.cs index 72d3086..adf1821 100644 --- a/src/WotAPI/Api/GlobalMap/Fronts.cs +++ b/src/WotAPI/Api/GlobalMap/Fronts.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.GlobalMap; -[Response("https://api.worldoftanks.ru/wot/globalmap/fronts/")] +[Response("https://{region_site}/wot/globalmap/fronts/")] public class Fronts : ResponseClass { public class Front diff --git a/src/WotAPI/Api/GlobalMap/Status.cs b/src/WotAPI/Api/GlobalMap/Status.cs index f8e1fe7..397acf6 100644 --- a/src/WotAPI/Api/GlobalMap/Status.cs +++ b/src/WotAPI/Api/GlobalMap/Status.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.GlobalMap; -[Response("https://api.worldoftanks.ru/wot/globalmap/info/")] +[Response("https://{region_site}/wot/globalmap/info/")] public class Status : ResponseClass { public class Data diff --git a/src/WotAPI/Api/Strongholds/Clan/Info.cs b/src/WotAPI/Api/Strongholds/Clan/Info.cs index 15ec2aa..6bb0de2 100644 --- a/src/WotAPI/Api/Strongholds/Clan/Info.cs +++ b/src/WotAPI/Api/Strongholds/Clan/Info.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Strongholds.Clan; -[Response("https://api.worldoftanks.ru/wot/stronghold/claninfo/?clan_id={search}", true)] +[Response("https://{region_site}/wot/stronghold/claninfo/?clan_id={search}", true)] public class Info : ResponseClass { public class Data diff --git a/src/WotAPI/Api/Tankopedia/Achievements.cs b/src/WotAPI/Api/Tankopedia/Achievements.cs index 1bce31d..23e128b 100644 --- a/src/WotAPI/Api/Tankopedia/Achievements.cs +++ b/src/WotAPI/Api/Tankopedia/Achievements.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Tankopedia; -[Response("https://api.worldoftanks.ru/wot/encyclopedia/achievements/")] +[Response("https://{region_site}/wot/encyclopedia/achievements/")] public class Achievements : ResponseClass> { public class Achievement diff --git a/src/WotAPI/Api/Tankopedia/Badges.cs b/src/WotAPI/Api/Tankopedia/Badges.cs index 8afbac7..a63c2cc 100644 --- a/src/WotAPI/Api/Tankopedia/Badges.cs +++ b/src/WotAPI/Api/Tankopedia/Badges.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Tankopedia; -[Response("https://api.worldoftanks.ru/wot/encyclopedia/badges/")] +[Response("https://{region_site}/wot/encyclopedia/badges/")] public class Badges : ResponseClass> { public class Badge diff --git a/src/WotAPI/Api/Tankopedia/Crew/Roles.cs b/src/WotAPI/Api/Tankopedia/Crew/Roles.cs index b5ff0ec..8f0e7ea 100644 --- a/src/WotAPI/Api/Tankopedia/Crew/Roles.cs +++ b/src/WotAPI/Api/Tankopedia/Crew/Roles.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Tankopedia.Crew; -[Response("https://api.worldoftanks.ru/wot/encyclopedia/crewroles/")] +[Response("https://{region_site}/wot/encyclopedia/crewroles/")] public class Roles : ResponseClass> { public class CrewMember diff --git a/src/WotAPI/Api/Tankopedia/Crew/Skills.cs b/src/WotAPI/Api/Tankopedia/Crew/Skills.cs index f32876c..7d22ece 100644 --- a/src/WotAPI/Api/Tankopedia/Crew/Skills.cs +++ b/src/WotAPI/Api/Tankopedia/Crew/Skills.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Tankopedia.Crew; -[Response("https://api.worldoftanks.ru/wot/encyclopedia/crewskills/")] +[Response("https://{region_site}/wot/encyclopedia/crewskills/")] public class Skills : ResponseClass> { public class CrewSkill diff --git a/src/WotAPI/Api/Tankopedia/Equipment.cs b/src/WotAPI/Api/Tankopedia/Equipment.cs index 3e3c21c..4e6d159 100644 --- a/src/WotAPI/Api/Tankopedia/Equipment.cs +++ b/src/WotAPI/Api/Tankopedia/Equipment.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Tankopedia; -[Response("https://api.worldoftanks.ru/wot/encyclopedia/provisions/")] +[Response("https://{region_site}/wot/encyclopedia/provisions/")] public class Equipment : ResponseClass { public class Data diff --git a/src/WotAPI/Api/Tankopedia/Info.cs b/src/WotAPI/Api/Tankopedia/Info.cs index 184d8f5..469b998 100644 --- a/src/WotAPI/Api/Tankopedia/Info.cs +++ b/src/WotAPI/Api/Tankopedia/Info.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Tankopedia; -[Response("https://api.worldoftanks.ru/wot/encyclopedia/info/")] +[Response("https://{region_site}/wot/encyclopedia/info/")] public class Info : ResponseClass { public class Data diff --git a/src/WotAPI/Api/Tankopedia/Maps.cs b/src/WotAPI/Api/Tankopedia/Maps.cs index f12485e..baa65e6 100644 --- a/src/WotAPI/Api/Tankopedia/Maps.cs +++ b/src/WotAPI/Api/Tankopedia/Maps.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Tankopedia; -[Response("https://api.worldoftanks.ru/wot/encyclopedia/arenas/")] +[Response("https://{region_site}/wot/encyclopedia/arenas/")] public class Maps : ResponseClass { public class Map diff --git a/src/WotAPI/Api/Tankopedia/PersonalMissions.cs b/src/WotAPI/Api/Tankopedia/PersonalMissions.cs index 3907799..815b68e 100644 --- a/src/WotAPI/Api/Tankopedia/PersonalMissions.cs +++ b/src/WotAPI/Api/Tankopedia/PersonalMissions.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Tankopedia; -[Response("https://api.worldoftanks.ru/wot/encyclopedia/personalmissions/")] +[Response("https://{region_site}/wot/encyclopedia/personalmissions/")] public class PersonalMissions : ResponseClass { public class Data diff --git a/src/WotAPI/Api/Tankopedia/PersonalReserves.cs b/src/WotAPI/Api/Tankopedia/PersonalReserves.cs index 45e9cec..d6265ca 100644 --- a/src/WotAPI/Api/Tankopedia/PersonalReserves.cs +++ b/src/WotAPI/Api/Tankopedia/PersonalReserves.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Tankopedia; -[Response("https://api.worldoftanks.ru/wot/encyclopedia/boosters/")] +[Response("https://{region_site}/wot/encyclopedia/boosters/")] public class PersonalReserves : ResponseClass> { public class Reserve diff --git a/src/WotAPI/Api/Tankopedia/Vehicle/Info.cs b/src/WotAPI/Api/Tankopedia/Vehicle/Info.cs index 61e8303..ce4618a 100644 --- a/src/WotAPI/Api/Tankopedia/Vehicle/Info.cs +++ b/src/WotAPI/Api/Tankopedia/Vehicle/Info.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Tankopedia.Vehicle; -[Response("https://api.worldoftanks.ru/wot/encyclopedia/vehicles/?tank_id={search}", true)] +[Response("https://{region_site}/wot/encyclopedia/vehicles/?tank_id={search}", true)] public class Info : ResponseClass { public class Data diff --git a/src/WotAPI/Api/Tankopedia/Vehicle/Profile.cs b/src/WotAPI/Api/Tankopedia/Vehicle/Profile.cs index 915c5e9..33f3a50 100644 --- a/src/WotAPI/Api/Tankopedia/Vehicle/Profile.cs +++ b/src/WotAPI/Api/Tankopedia/Vehicle/Profile.cs @@ -2,7 +2,7 @@ namespace WotAPI.Api.Tankopedia.Vehicle; -[Response("https://api.worldoftanks.ru/wot/encyclopedia/vehicleprofile/?tank_id={search}", true)] +[Response("https://{region_site}/wot/encyclopedia/vehicleprofile/?tank_id={search}", true)] public class Profile : ResponseClass { public class Data diff --git a/src/WotAPI/ResponseClass.cs b/src/WotAPI/ResponseClass.cs index a116bc7..70c3c02 100644 --- a/src/WotAPI/ResponseClass.cs +++ b/src/WotAPI/ResponseClass.cs @@ -48,12 +48,16 @@ public static ResponseClass GetAll(object? search = null, int? pageN ? $"?application_id={api.ApplicationId}&page_no{pageNumber}" : $"&application_id={api.ApplicationId}&page_no={pageNumber}"); - if (parameters != null) + if (parameters != null) url += $"&{string.Join("&", parameters.Select(parameter => $"{parameter.Key}={parameter.Value}"))}"; - url = url.Replace(".ru/", $".{api.Region}/"); + //url = url.Replace(".ru/", $".{api.Region}/"); + if (api.Region == $"{WotApi.WotApiRegion.RuBy}".ToLower()) + url = url.Replace("{region_site}", "api.tanki.su"); + else + url = url.Replace("{region_site}", $"api.worldoftanks.{api.Region}"); - if (search != null) + if (search != null) { url = url.Replace("{search}", search.ToString()); } diff --git a/src/WotAPI/WotApi.cs b/src/WotAPI/WotApi.cs index 878972a..8374600 100644 --- a/src/WotAPI/WotApi.cs +++ b/src/WotAPI/WotApi.cs @@ -7,7 +7,8 @@ public enum WotApiRegion Ru, Eu, Com, - Asia + Asia, + RuBy } public static WotApi? Current;