From 817389a360184c578cdfeec5127f77202753104c Mon Sep 17 00:00:00 2001 From: Giribaldi_TTV Date: Fri, 7 Aug 2026 09:26:42 -0700 Subject: [PATCH 1/3] feat(tracker): retire io runtime support --- .../Blazor/Pages/Settings/Settings.razor | 17 +++++++++++++--- TarkovMonitor/TarkovTracker.cs | 20 +++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/TarkovMonitor/Blazor/Pages/Settings/Settings.razor b/TarkovMonitor/Blazor/Pages/Settings/Settings.razor index 48fd1f8..f7923dd 100644 --- a/TarkovMonitor/Blazor/Pages/Settings/Settings.razor +++ b/TarkovMonitor/Blazor/Pages/Settings/Settings.razor @@ -119,17 +119,23 @@ @LocalizationService.GetString("TarkovTracker") - @LocalizationService.GetString("GetAToken") - @LocalizationService.GetString("TestToken") + @LocalizationService.GetString("GetAToken") + @LocalizationService.GetString("TestToken") @LocalizationService.GetString("CurrentProfile"): @TarkovDev.GetPlayerName(GameWatcher.CurrentProfile) (@GameWatcher.CurrentProfile.Type) - + @foreach (var pair in TarkovTracker.Domains) { @pair.Value } + @if (IsRetiredTrackerService) + { + + Support for TarkovTracker.io has been retired. Switch to TarkovTracker.org for continued support. + + } @@ -560,6 +566,11 @@ } } + private bool IsRetiredTrackerService => string.Equals( + TarkovTrackerDomain, + "tarkovtracker.io", + StringComparison.OrdinalIgnoreCase); + void TokenShowClick() { if (tokenShow) diff --git a/TarkovMonitor/TarkovTracker.cs b/TarkovMonitor/TarkovTracker.cs index 823bf58..fa164ce 100644 --- a/TarkovMonitor/TarkovTracker.cs +++ b/TarkovMonitor/TarkovTracker.cs @@ -34,6 +34,10 @@ internal interface ITarkovTrackerAPI public static ProgressResponse Progress { get; private set; } = new(); public static bool ValidToken { get; private set; } = false; + public static bool IsLegacyService => string.Equals( + Properties.Settings.Default.tarkovTrackerDomain, + "tarkovtracker.io", + StringComparison.OrdinalIgnoreCase); private static Dictionary tokens = new(); private static string currentProfile = ""; public static string CurrentProfileId { get { return currentProfile; } } @@ -80,6 +84,10 @@ public static void SetToken(string profileId, string token) { throw new Exception("No PVP or PVE profile initialized, please launch Escape from Tarkov first"); } + if (IsLegacyService && !string.IsNullOrWhiteSpace(token)) + { + return; + } tokens[profileId] = token; Properties.Settings.Default.tarkovTrackerTokens = JsonSerializer.Serialize(tokens); Properties.Settings.Default.Save(); @@ -91,6 +99,13 @@ public static async Task SetProfile(string profileId) throw new Exception("Can't set PVP or PVE profile, please launch Escape from Tarkov and then restart this application"); } + if (IsLegacyService) + { + ValidToken = false; + Progress = new(); + return Progress; + } + if (currentProfile == profileId) { return Progress; @@ -301,6 +316,11 @@ public static async Task GetProgress() public static async Task TestToken(string apiToken) { + if (IsLegacyService) + { + throw new InvalidOperationException( + "Support for TarkovTracker.io has been retired. Switch to TarkovTracker.org."); + } try { var response = await api.TestToken(apiToken); From f94918f4009b3634f4cd33a84bc8b8b16b0b5e71 Mon Sep 17 00:00:00 2001 From: Giribaldi_TTV Date: Fri, 7 Aug 2026 11:01:02 -0700 Subject: [PATCH 2/3] fix(tracker): isolate retired io state from org --- TarkovMonitor/TarkovTracker.cs | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/TarkovMonitor/TarkovTracker.cs b/TarkovMonitor/TarkovTracker.cs index fa164ce..71f6486 100644 --- a/TarkovMonitor/TarkovTracker.cs +++ b/TarkovMonitor/TarkovTracker.cs @@ -69,6 +69,13 @@ public static ITarkovTrackerAPI InitAPI() return api; } + public static void ResetActiveState() + { + currentProfile = ""; + ValidToken = false; + Progress = new(); + } + public static string GetToken(string profileId) { if (!tokens.ContainsKey(profileId)) @@ -80,13 +87,13 @@ public static string GetToken(string profileId) public static void SetToken(string profileId, string token) { - if (profileId == "") + if (IsLegacyService) { - throw new Exception("No PVP or PVE profile initialized, please launch Escape from Tarkov first"); + return; } - if (IsLegacyService && !string.IsNullOrWhiteSpace(token)) + if (profileId == "") { - return; + throw new Exception("No PVP or PVE profile initialized, please launch Escape from Tarkov first"); } tokens[profileId] = token; Properties.Settings.Default.tarkovTrackerTokens = JsonSerializer.Serialize(tokens); @@ -95,16 +102,14 @@ public static void SetToken(string profileId, string token) public static async Task SetProfile(string profileId) { - if (profileId == "") { - throw new Exception("Can't set PVP or PVE profile, please launch Escape from Tarkov and then restart this application"); - } - if (IsLegacyService) { - ValidToken = false; - Progress = new(); + ResetActiveState(); return Progress; } + if (profileId == "") { + throw new Exception("Can't set PVP or PVE profile, please launch Escape from Tarkov and then restart this application"); + } if (currentProfile == profileId) { @@ -160,7 +165,7 @@ private static void SyncStoredStatus(string questId, TaskStatus status) public static async Task SetTaskStatus(string questId, TaskStatus status) { - if (!ValidToken) + if (IsLegacyService || !ValidToken) { throw new Exception("Invalid token"); } @@ -246,7 +251,7 @@ public static async Task SetTaskStarted(string questId) public static async Task SetTaskStatuses(Dictionary statuses) { - if (!ValidToken) + if (IsLegacyService || !ValidToken) { throw new Exception("Invalid token"); } @@ -286,6 +291,11 @@ public static async Task SetTaskStatuses(Dictionary public static async Task GetProgress() { + if (IsLegacyService) + { + ResetActiveState(); + return Progress; + } if (!ValidToken) { throw new Exception("Invalid token"); From b2dc26627b9df20db20ef3911eddc0de2e99e101 Mon Sep 17 00:00:00 2001 From: Giribaldi_TTV Date: Fri, 7 Aug 2026 11:01:08 -0700 Subject: [PATCH 3/3] fix(settings): keep retired tracker UI consistent --- .../Blazor/Pages/Settings/Settings.razor | 48 +++++++++++++++---- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/TarkovMonitor/Blazor/Pages/Settings/Settings.razor b/TarkovMonitor/Blazor/Pages/Settings/Settings.razor index f7923dd..b5b4ee1 100644 --- a/TarkovMonitor/Blazor/Pages/Settings/Settings.razor +++ b/TarkovMonitor/Blazor/Pages/Settings/Settings.razor @@ -119,11 +119,6 @@ @LocalizationService.GetString("TarkovTracker") - @LocalizationService.GetString("GetAToken") - @LocalizationService.GetString("TestToken") - @LocalizationService.GetString("CurrentProfile"): - @TarkovDev.GetPlayerName(GameWatcher.CurrentProfile) (@GameWatcher.CurrentProfile.Type) - @foreach (var pair in TarkovTracker.Domains) { @@ -136,6 +131,14 @@ Support for TarkovTracker.io has been retired. Switch to TarkovTracker.org for continued support. } + @if (!IsRetiredTrackerService) + { + @LocalizationService.GetString("GetAToken") + @LocalizationService.GetString("TestToken") + @LocalizationService.GetString("CurrentProfile"): + @TarkovDev.GetPlayerName(GameWatcher.CurrentProfile) (@GameWatcher.CurrentProfile.Type) + + } @@ -492,7 +495,7 @@ { get { - return TarkovTracker.GetToken(GameWatcher.CurrentProfile.Id).Length != 22; + return TarkovTracker.IsLegacyService || TarkovTracker.GetToken(GameWatcher.CurrentProfile.Id).Length != 22; } set { @@ -540,11 +543,14 @@ { get { - return TarkovTracker.GetToken(GameWatcher.CurrentProfile.Id); + return TarkovTracker.IsLegacyService ? "" : TarkovTracker.GetToken(GameWatcher.CurrentProfile.Id); } set { - TarkovTracker.SetToken(GameWatcher.CurrentProfile.Id, value); + if (!TarkovTracker.IsLegacyService) + { + TarkovTracker.SetToken(GameWatcher.CurrentProfile.Id, value); + } } } public string TarkovTrackerDomain @@ -560,9 +566,30 @@ return; } Properties.Settings.Default.tarkovTrackerDomain = value; - TarkovTrackerToken = ""; + TarkovTracker.ResetActiveState(); TarkovTracker.InitAPI(); Properties.Settings.Default.Save(); + if (!TarkovTracker.IsLegacyService) + { + _ = RevalidateTrackerProfile(); + } + } + } + + private async Task RevalidateTrackerProfile() + { + if (string.IsNullOrWhiteSpace(GameWatcher.CurrentProfile.Id)) + { + return; + } + + try + { + await TarkovTracker.SetProfile(GameWatcher.CurrentProfile.Id); + } + catch (Exception ex) + { + messageLog.AddMessage(ex.Message, "exception"); } } @@ -571,6 +598,9 @@ "tarkovtracker.io", StringComparison.OrdinalIgnoreCase); + private string CurrentProfileUrl => + $"https://tarkov.dev/players/{GameWatcher.CurrentProfile.Type.ToString().ToLower()}/{GameWatcher.CurrentProfile.AccountId}"; + void TokenShowClick() { if (tokenShow)