diff --git a/src/StatisticsAnalysisTool/App.xaml.cs b/src/StatisticsAnalysisTool/App.xaml.cs index 6ca37de8..649cfd2e 100644 --- a/src/StatisticsAnalysisTool/App.xaml.cs +++ b/src/StatisticsAnalysisTool/App.xaml.cs @@ -42,10 +42,10 @@ protected override async void OnStartup(StartupEventArgs e) TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException; DispatcherUnhandledException += Application_DispatcherUnhandledException; - await AutoUpdateController.AutoUpdateAsync(); - SettingsController.LoadSettings(); + await AutoUpdateController.AutoUpdateAsync(); + Culture.SetCulture(Culture.GetCultureByIetfLanguageTag(SettingsController.CurrentSettings.CurrentCultureIetfLanguageTag)); if (!LocalizationController.Init()) { diff --git a/src/StatisticsAnalysisTool/Common/ApiController.cs b/src/StatisticsAnalysisTool/Common/ApiController.cs index 73700a23..1f681653 100644 --- a/src/StatisticsAnalysisTool/Common/ApiController.cs +++ b/src/StatisticsAnalysisTool/Common/ApiController.cs @@ -57,15 +57,18 @@ public static async Task> GetCityItemPricesFromJsonAsync(st url = qualities.Aggregate(url, (current, quality) => current + $"{quality},"); } - using var clientHandler = new HttpClientHandler(); + using var clientHandler = new HttpClientHandler + { + SslProtocols = System.Security.Authentication.SslProtocols.Tls13 | System.Security.Authentication.SslProtocols.Tls12, + }; clientHandler.ServerCertificateCustomValidationCallback = (_, _, _, _) => true; + using var client = new HttpClient(clientHandler); client.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("gzip")); + client.Timeout = TimeSpan.FromSeconds(30); try { - client.Timeout = TimeSpan.FromSeconds(30); - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; using var response = await client.GetAsync(url); if (response.StatusCode == (HttpStatusCode) 429) { @@ -94,12 +97,9 @@ public static async Task> GetCityItemPricesFromJsonAsync(st public static async Task> GetHistoryItemPricesFromJsonAsync(string uniqueName, IList locations, DateTime? date, int quality, int timeScale = 24) { - var locationsString = ""; - - if (locations?.Count > 0) - { - locationsString = string.Join(",", locations.Select(x => ((int) x).ToString())); - } + var locationsString = locations?.Count > 0 + ? string.Join(",", locations.Select(x => ((int) x).ToString())) + : ""; var qualitiesString = quality.ToString(); @@ -110,15 +110,18 @@ public static async Task> GetHistoryItemPricesFrom url += $"&qualities={qualitiesString}"; url += $"&time-scale={timeScale}"; - using var clientHandler = new HttpClientHandler(); + using var clientHandler = new HttpClientHandler + { + SslProtocols = System.Security.Authentication.SslProtocols.Tls13 | System.Security.Authentication.SslProtocols.Tls12, + }; clientHandler.ServerCertificateCustomValidationCallback = (_, _, _, _) => true; + using var client = new HttpClient(clientHandler); client.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("gzip")); client.Timeout = TimeSpan.FromSeconds(300); try { - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; using var response = await client.GetAsync(url); if (response.StatusCode == (HttpStatusCode) 429) @@ -132,7 +135,7 @@ public static async Task> GetHistoryItemPricesFrom using var memoryStream = new MemoryStream(); await responseStream.CopyToAsync(memoryStream); memoryStream.Position = 0; - + Stream decompressedStream = memoryStream; if (response.Content.Headers.ContentEncoding.Contains("gzip")) { @@ -155,14 +158,19 @@ public static async Task GetGameInfoSearchFromJsonAsync( var gameInfoSearchResponse = new GameInfoSearchResponse(); var url = $"{GetServerBaseUrlByCurrentServer()}/api/gameinfo/search?q={username}"; - using var clientHandler = new HttpClientHandler(); - clientHandler.ServerCertificateCustomValidationCallback = (_, _, _, _) => true; - using var client = new HttpClient(clientHandler); - client.Timeout = TimeSpan.FromSeconds(600); + using var clientHandler = new HttpClientHandler + { + SslProtocols = System.Security.Authentication.SslProtocols.Tls13 | System.Security.Authentication.SslProtocols.Tls12, + ServerCertificateCustomValidationCallback = (_, _, _, _) => true + }; + + using var client = new HttpClient(clientHandler) + { + Timeout = TimeSpan.FromSeconds(120) + }; try { - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; using var response = await client.GetAsync(url); using var content = response.Content; @@ -191,13 +199,19 @@ public static async Task GetGameInfoPlayersFromJsonAsyn var gameInfoPlayerResponse = new GameInfoPlayersResponse(); var url = $"{GetServerBaseUrlByCurrentServer()}/api/gameinfo/players/{userid}"; - using var clientHandler = new HttpClientHandler(); - clientHandler.ServerCertificateCustomValidationCallback = (_, _, _, _) => true; - using var client = new HttpClient(clientHandler); - client.Timeout = TimeSpan.FromSeconds(120); + using var clientHandler = new HttpClientHandler + { + SslProtocols = System.Security.Authentication.SslProtocols.Tls13 | System.Security.Authentication.SslProtocols.Tls12, + ServerCertificateCustomValidationCallback = (_, _, _, _) => true + }; + + using var client = new HttpClient(clientHandler) + { + Timeout = TimeSpan.FromSeconds(120) + }; + try { - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; using var response = await client.GetAsync(url); using var content = response.Content; @@ -229,13 +243,19 @@ public static async Task> GetGameInfoPlayerKills var killsDeathsExtensionString = gameInfoPlayersType == GameInfoPlayersType.Kills ? "kills" : "deaths"; var url = $"{GetServerBaseUrlByCurrentServer()}/api/gameinfo/players/{userid}/{killsDeathsExtensionString}"; - using var clientHandler = new HttpClientHandler(); - clientHandler.ServerCertificateCustomValidationCallback = (_, _, _, _) => true; - using var client = new HttpClient(clientHandler); - client.Timeout = TimeSpan.FromSeconds(600); + using var clientHandler = new HttpClientHandler + { + SslProtocols = System.Security.Authentication.SslProtocols.Tls13 | System.Security.Authentication.SslProtocols.Tls12, + ServerCertificateCustomValidationCallback = (_, _, _, _) => true + }; + + using var client = new HttpClient(clientHandler) + { + Timeout = TimeSpan.FromSeconds(120) + }; + try { - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; using var response = await client.GetAsync(url); using var content = response.Content; @@ -270,13 +290,19 @@ public static async Task> GetGameInfoPlayerTopKi var url = $"{GetServerBaseUrlByCurrentServer()}/api/gameinfo/players/{userid}/topkills?range={unitOfTimeString}&offset=0"; - using var clientHandler = new HttpClientHandler(); - clientHandler.ServerCertificateCustomValidationCallback = (_, _, _, _) => true; - using var client = new HttpClient(clientHandler); - client.Timeout = TimeSpan.FromSeconds(600); + using var clientHandler = new HttpClientHandler + { + SslProtocols = System.Security.Authentication.SslProtocols.Tls13 | System.Security.Authentication.SslProtocols.Tls12, + ServerCertificateCustomValidationCallback = (_, _, _, _) => true + }; + + using var client = new HttpClient(clientHandler) + { + Timeout = TimeSpan.FromSeconds(120) + }; + try { - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; using var response = await client.GetAsync(url); using var content = response.Content; @@ -293,7 +319,6 @@ public static async Task> GetGameInfoPlayerTopKi public static async Task> GetGameInfoPlayerSoloKillsFromJsonAsync(string userid, UnitOfTime unitOfTime) { var values = new List(); - if (string.IsNullOrEmpty(userid)) { return values; @@ -311,65 +336,64 @@ public static async Task> GetGameInfoPlayerSoloK var url = $"{GetServerBaseUrlByCurrentServer()}/api/gameinfo/players/{userid}/solokills?range={unitOfTimeString}&offset=0"; - using var clientHandler = new HttpClientHandler(); - clientHandler.ServerCertificateCustomValidationCallback = (_, _, _, _) => true; - using var client = new HttpClient(clientHandler); - client.Timeout = TimeSpan.FromSeconds(600); + using var clientHandler = new HttpClientHandler + { + SslProtocols = System.Security.Authentication.SslProtocols.Tls13 | System.Security.Authentication.SslProtocols.Tls12, + ServerCertificateCustomValidationCallback = (_, _, _, _) => true + }; + + using var client = new HttpClient(clientHandler) + { + Timeout = TimeSpan.FromSeconds(120) + }; + try { - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; - using var response = await client.GetAsync(url); - using var content = response.Content; + var response = await client.GetAsync(url); + if (!response.IsSuccessStatusCode) + { + Log.Warning("Request failed: {url}, Status: {statusCode}, Reason: {reason}", url, response.StatusCode, response.ReasonPhrase); + return values; + } - return JsonSerializer.Deserialize>(await content.ReadAsStringAsync()) ?? values; + var jsonResponse = await response.Content.ReadAsStringAsync(); + return JsonSerializer.Deserialize>(jsonResponse) ?? values; + } + catch (JsonException e) + { + ConsoleManager.WriteLineForError(MethodBase.GetCurrentMethod()?.DeclaringType, e); + Log.Error(e, "JSON deserialization failed. URL: {url}", url); + } + catch (TaskCanceledException e) + { + ConsoleManager.WriteLineForWarning(MethodBase.GetCurrentMethod()?.DeclaringType, e); + Log.Warning(e, "Request timed out: {url}", url); } catch (Exception e) { ConsoleManager.WriteLineForError(MethodBase.GetCurrentMethod()?.DeclaringType, e); - Log.Error(e, "{message}", MethodBase.GetCurrentMethod()?.DeclaringType); - return values; + Log.Error(e, "Unexpected error: {url}", url); } - } - //public static async Task GetGameInfoGuildsFromJsonAsync(string guildId) - //{ - // var url = $"{GetServerBaseUrlByCurrentServer()}/api/gameinfo/guilds/{guildId}"; - - // using (var client = new HttpClient()) - // { - // client.Timeout = TimeSpan.FromSeconds(30); - // try - // { - // using (var response = await client.GetAsync(url)) - // { - // using (var content = response.Content) - // { - // return JsonConvert.DeserializeObject(await content.ReadAsStringAsync()); - // } - // } - // } - // catch (Exception e) - // { - // ConsoleManager.WriteLineForError(MethodBase.GetCurrentMethod()?.DeclaringType, e); - // Log.Error(e, "{message}", MethodBase.GetCurrentMethod()?.DeclaringType); - // return null; - // } - // } - //} + return values; + } public static async Task> GetGoldPricesFromJsonAsync(int count, int timeout = 300) { var url = Path.Combine(GetAoDataProjectServerBaseUrlByCurrentServer(), "stats/"); url += $"gold?count={count}"; - using var clientHandler = new HttpClientHandler(); + using var clientHandler = new HttpClientHandler + { + SslProtocols = System.Security.Authentication.SslProtocols.Tls13 | System.Security.Authentication.SslProtocols.Tls12, + }; clientHandler.ServerCertificateCustomValidationCallback = (_, _, _, _) => true; + using var client = new HttpClient(clientHandler); client.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("gzip")); client.Timeout = TimeSpan.FromSeconds(timeout); try { - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; using var response = await client.GetAsync(url); response.EnsureSuccessStatusCode(); @@ -397,13 +421,19 @@ public static async Task> GetDonationsFromJsonAsync() var values = new List(); var url = Settings.Default.DonationsUrl; - using var clientHandler = new HttpClientHandler(); - clientHandler.ServerCertificateCustomValidationCallback = (_, _, _, _) => true; - using var client = new HttpClient(clientHandler); - client.Timeout = TimeSpan.FromSeconds(600); + using var clientHandler = new HttpClientHandler + { + SslProtocols = System.Security.Authentication.SslProtocols.Tls13 | System.Security.Authentication.SslProtocols.Tls12, + ServerCertificateCustomValidationCallback = (_, _, _, _) => true + }; + + using var client = new HttpClient(clientHandler) + { + Timeout = TimeSpan.FromSeconds(600) + }; + try { - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; using var response = await client.GetAsync(url); using var content = response.Content; return JsonSerializer.Deserialize>(await content.ReadAsStringAsync()) ?? values; @@ -416,18 +446,6 @@ public static async Task> GetDonationsFromJsonAsync() } } - //private static async Task DecompressedStream(HttpResponseMessage response) - //{ - // await using var responseStream = await response.Content.ReadAsStreamAsync(); - // Stream decompressedStream = responseStream; - // if (response.Content.Headers.ContentEncoding.Contains("gzip")) - // { - // decompressedStream = new GZipStream(responseStream, CompressionMode.Decompress); - // } - - // return decompressedStream; - //} - private static async Task DecompressedStream(HttpResponseMessage response) { var responseStream = await response.Content.ReadAsStreamAsync(); @@ -444,8 +462,6 @@ private static async Task DecompressedStream(HttpResponseMessage respons return memoryStream; } - #region Helper methods - #region Merge history data private static List MergeCityAndPortalCity(List values) @@ -646,6 +662,4 @@ private static string GetServerBaseUrlByCurrentServer() _ => SettingsController.CurrentSettings.AlbionOnlineApiBaseUrlWest }; } - - #endregion } \ No newline at end of file diff --git a/src/StatisticsAnalysisTool/Common/AutoUpdateController.cs b/src/StatisticsAnalysisTool/Common/AutoUpdateController.cs index 76ce1e16..9181ae3d 100644 --- a/src/StatisticsAnalysisTool/Common/AutoUpdateController.cs +++ b/src/StatisticsAnalysisTool/Common/AutoUpdateController.cs @@ -4,6 +4,7 @@ using StatisticsAnalysisTool.Properties; using System; using System.IO; +using System.Net; using System.Net.Http; using System.Reflection; using System.Threading.Tasks; @@ -21,22 +22,34 @@ public static async Task AutoUpdateAsync(bool reportErrors = false) RemoveUpdateFiles(updateDirPath); - if (SettingsController.CurrentSettings.IsSuggestPreReleaseUpdatesActive && await HttpClientUtils.IsUrlAccessible(Settings.Default.AutoUpdatePreReleaseConfigUrl)) - { - currentUpdateUrl = Settings.Default.AutoUpdatePreReleaseConfigUrl; - } - else if (await HttpClientUtils.IsUrlAccessible(Settings.Default.AutoUpdateConfigUrl)) + try { - currentUpdateUrl = Settings.Default.AutoUpdateConfigUrl; - } + var isUrlAccessibleResult = await HttpClientUtils.IsUrlAccessible(Settings.Default.AutoUpdatePreReleaseConfigUrl); - if (string.IsNullOrEmpty(currentUpdateUrl)) - { - return; - } + if (SettingsController.CurrentSettings.IsSuggestPreReleaseUpdatesActive && isUrlAccessibleResult is { IsAccessible: true, IsProxyActive: true }) + { + AutoUpdater.Proxy = new WebProxy(SettingsController.CurrentSettings.ProxyUrlWithPort); + currentUpdateUrl = Settings.Default.AutoUpdatePreReleaseConfigUrl; + } + else if (SettingsController.CurrentSettings.IsSuggestPreReleaseUpdatesActive && isUrlAccessibleResult is { IsAccessible: true, IsProxyActive: false }) + { + currentUpdateUrl = Settings.Default.AutoUpdatePreReleaseConfigUrl; + } + else if (isUrlAccessibleResult is { IsAccessible: true, IsProxyActive: true }) + { + AutoUpdater.Proxy = new WebProxy(SettingsController.CurrentSettings.ProxyUrlWithPort); + currentUpdateUrl = Settings.Default.AutoUpdateConfigUrl; + } + else if (isUrlAccessibleResult is { IsAccessible: true, IsProxyActive: false }) + { + currentUpdateUrl = Settings.Default.AutoUpdateConfigUrl; + } + + if (string.IsNullOrEmpty(currentUpdateUrl)) + { + return; + } - try - { AutoUpdater.Synchronous = true; AutoUpdater.ApplicationExitEvent -= AutoUpdaterApplicationExit; diff --git a/src/StatisticsAnalysisTool/Common/HttpClientUtils.cs b/src/StatisticsAnalysisTool/Common/HttpClientUtils.cs index c81381ee..b45029ae 100644 --- a/src/StatisticsAnalysisTool/Common/HttpClientUtils.cs +++ b/src/StatisticsAnalysisTool/Common/HttpClientUtils.cs @@ -6,6 +6,8 @@ using System.Threading.Tasks; using System.Windows; using Serilog; +using System.Net; +using StatisticsAnalysisTool.Common.UserSettings; namespace StatisticsAnalysisTool.Common; @@ -62,12 +64,51 @@ public static async Task DownloadFileAsync(this HttpClient client, string } } - public static async Task IsUrlAccessible(string url) + public static async Task<(bool IsProxyActive, bool IsAccessible)> IsUrlAccessible(string url) { - using HttpClient client = new HttpClient(); - HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Head, url); + if (!string.IsNullOrEmpty(SettingsController.CurrentSettings.ProxyUrlWithPort)) + { + var proxy = new WebProxy(SettingsController.CurrentSettings.ProxyUrlWithPort) + { + UseDefaultCredentials = true + }; + + // Try with Proxy + using var handlerWithProxy = new HttpClientHandler + { + Proxy = proxy, + UseProxy = true + }; - HttpResponseMessage response = await client.SendAsync(request); - return response.IsSuccessStatusCode; + if (await TryAccessUrl(url, handlerWithProxy)) + { + return (true, true); + } + } + + // Try without Proxy + using var handlerWithoutProxy = new HttpClientHandler + { + UseProxy = false + }; + + var result = await TryAccessUrl(url, handlerWithoutProxy); + return (false, result); + } + + private static async Task TryAccessUrl(string url, HttpClientHandler handler) + { + try + { + using var client = new HttpClient(handler); + var request = new HttpRequestMessage(HttpMethod.Head, url); + var response = await client.SendAsync(request); + return response.IsSuccessStatusCode; + } + catch (Exception e) + { + Log.Error(e, "{message}", MethodBase.GetCurrentMethod()?.DeclaringType); + return false; + } } } \ No newline at end of file diff --git a/src/StatisticsAnalysisTool/Common/UserSettings/SettingsObject.cs b/src/StatisticsAnalysisTool/Common/UserSettings/SettingsObject.cs index 5eba4c5c..da9c7a6e 100644 --- a/src/StatisticsAnalysisTool/Common/UserSettings/SettingsObject.cs +++ b/src/StatisticsAnalysisTool/Common/UserSettings/SettingsObject.cs @@ -101,4 +101,5 @@ public class SettingsObject public bool IsLootedChestsStatsVisible { get; set; } = true; public bool IsReSpecStatsVisible { get; set; } = true; public bool IsRepairCostsStatsVisible { get; set; } = true; + public string ProxyUrlWithPort { get; set; } } \ No newline at end of file diff --git a/src/StatisticsAnalysisTool/Localization/localization.json b/src/StatisticsAnalysisTool/Localization/localization.json index bbda2190..63af4788 100644 --- a/src/StatisticsAnalysisTool/Localization/localization.json +++ b/src/StatisticsAnalysisTool/Localization/localization.json @@ -37534,6 +37534,19 @@ "seg": "T1 - T3" } ] + }, + { + "tuid": "PROXY", + "tuv": [ + { + "lang": "de-DE", + "seg": "Proxy" + }, + { + "lang": "en-US", + "seg": "Proxy" + } + ] } ] } \ No newline at end of file diff --git a/src/StatisticsAnalysisTool/Models/BindingModel/PlayerInformationBindings.cs b/src/StatisticsAnalysisTool/Models/BindingModel/PlayerInformationBindings.cs index d3d5d9f5..7b6df131 100644 --- a/src/StatisticsAnalysisTool/Models/BindingModel/PlayerInformationBindings.cs +++ b/src/StatisticsAnalysisTool/Models/BindingModel/PlayerInformationBindings.cs @@ -2,6 +2,7 @@ using StatisticsAnalysisTool.Models.NetworkModel; using StatisticsAnalysisTool.ViewModels; using System; +using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Threading.Tasks; @@ -17,6 +18,7 @@ public class PlayerInformationBindings : BaseViewModel private Visibility _listBoxUserSearchVisibility = Visibility.Collapsed; private ObservableCollection _listBoxUserSearchItems = new(); private Visibility _loadIconVisibility = Visibility.Collapsed; + private Visibility _loadBarVisibility = Visibility.Collapsed; public PlayerInformationBindings() { @@ -57,10 +59,10 @@ public async Task UpdateUsernameListBoxAsync(string searchText) if (!string.IsNullOrEmpty(searchText)) { var users = await ApiController.GetGameInfoSearchFromJsonAsync(searchText); - - foreach (var user in users.SearchPlayer) + + foreach (var user in users?.SearchPlayer ?? new List()) { - ListBoxUserSearchItems.Add(new PlayerSearchStruct() { Name = user.Name, Value = user }); + ListBoxUserSearchItems.Add(new PlayerSearchStruct { Name = user.Name, Value = user }); } if (ListBoxUserSearchItems.Count > 0) @@ -80,7 +82,10 @@ public async Task UpdateUsernameListBoxAsync(string searchText) public async Task LoadPlayerDataAsync(string playerName) { ListBoxUserSearchVisibility = Visibility.Collapsed; + + LoadBarVisibility = Visibility.Visible; PlayerModeInformation = await GetPlayerInformationAsync(playerName, false); + LoadBarVisibility = Visibility.Collapsed; } public async Task LoadLocalPlayerDataAsync(string playerName) @@ -108,7 +113,7 @@ public Visibility ListBoxUserSearchVisibility OnPropertyChanged(); } } - + public ObservableCollection ListBoxUserSearchItems { get => _listBoxUserSearchItems; @@ -129,6 +134,16 @@ public Visibility LoadIconVisibility } } + public Visibility LoadBarVisibility + { + get => _loadBarVisibility; + set + { + _loadBarVisibility = value; + OnPropertyChanged(); + } + } + public PlayerModeTranslation PlayerModeTranslation { get => _playerModeTranslation; diff --git a/src/StatisticsAnalysisTool/Models/TranslationModel/SettingsWindowTranslation.cs b/src/StatisticsAnalysisTool/Models/TranslationModel/SettingsWindowTranslation.cs index 49948333..55147edd 100644 --- a/src/StatisticsAnalysisTool/Models/TranslationModel/SettingsWindowTranslation.cs +++ b/src/StatisticsAnalysisTool/Models/TranslationModel/SettingsWindowTranslation.cs @@ -62,4 +62,5 @@ public class SettingsWindowTranslation public static string Party => LocalizationController.Translation("PARTY"); public static string DeathAlarmSoundUsed => LocalizationController.Translation("DEATH_ALERT_SOUND_USED"); public static string BackupStorageDirectoryPath => LocalizationController.Translation("BACKUP_STORAGE_DIRECTORY_PATH"); + public static string Proxy => LocalizationController.Translation("PROXY"); } \ No newline at end of file diff --git a/src/StatisticsAnalysisTool/Properties/AssemblyInfo.cs b/src/StatisticsAnalysisTool/Properties/AssemblyInfo.cs index dc33142a..5d8201f8 100644 --- a/src/StatisticsAnalysisTool/Properties/AssemblyInfo.cs +++ b/src/StatisticsAnalysisTool/Properties/AssemblyInfo.cs @@ -53,5 +53,5 @@ // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.0.0.*")] -[assembly: AssemblyFileVersion("8.0.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("8.0.1.*")] +[assembly: AssemblyFileVersion("8.0.1.0")] \ No newline at end of file diff --git a/src/StatisticsAnalysisTool/UserControls/PlayerInformationControl.xaml b/src/StatisticsAnalysisTool/UserControls/PlayerInformationControl.xaml index cd88ec69..ba68ec81 100644 --- a/src/StatisticsAnalysisTool/UserControls/PlayerInformationControl.xaml +++ b/src/StatisticsAnalysisTool/UserControls/PlayerInformationControl.xaml @@ -11,13 +11,16 @@ d:DataContext="{d:DesignInstance Type=viewModels:MainWindowViewModel}"> - + + + + - + diff --git a/src/StatisticsAnalysisTool/UserControls/SettingsControl.xaml b/src/StatisticsAnalysisTool/UserControls/SettingsControl.xaml index 2dbb0689..a262a316 100644 --- a/src/StatisticsAnalysisTool/UserControls/SettingsControl.xaml +++ b/src/StatisticsAnalysisTool/UserControls/SettingsControl.xaml @@ -95,6 +95,10 @@ + + diff --git a/src/StatisticsAnalysisTool/ViewModels/MainWindowViewModel.cs b/src/StatisticsAnalysisTool/ViewModels/MainWindowViewModel.cs index 17af3d4d..26f00567 100644 --- a/src/StatisticsAnalysisTool/ViewModels/MainWindowViewModel.cs +++ b/src/StatisticsAnalysisTool/ViewModels/MainWindowViewModel.cs @@ -58,7 +58,6 @@ public class MainWindowViewModel : BaseViewModel private Dictionary _itemCategories = new(); private ICollectionView _itemsView; private Dictionary _itemTiers = new(); - private Visibility _loadIconVisibility = Visibility.Collapsed; private string _loadTranslation; private int _localImageCounter; private string _numberOfValuesTranslation; @@ -270,8 +269,7 @@ public async Task InitMainWindowDataAsync() InitAlerts(); await EstimatedMarketValueController.SetAllEstimatedMarketValuesToItemsAsync(); LoggingBindings.Init(); - - LoadIconVisibility = Visibility.Hidden; + IsFilterResetEnabled = true; IsItemSearchCheckboxesEnabled = true; IsTxtSearchEnabled = true; @@ -750,17 +748,7 @@ public bool IsShowOnlyFavoritesActive OnPropertyChanged(); } } - - public Visibility LoadIconVisibility - { - get => _loadIconVisibility; - set - { - _loadIconVisibility = value; - OnPropertyChanged(); - } - } - + public ObservableCollection PartyMemberCircles { get => _partyMemberCircles; diff --git a/src/StatisticsAnalysisTool/ViewModels/SettingsWindowViewModel.cs b/src/StatisticsAnalysisTool/ViewModels/SettingsWindowViewModel.cs index f93ffadd..a8f58f1a 100644 --- a/src/StatisticsAnalysisTool/ViewModels/SettingsWindowViewModel.cs +++ b/src/StatisticsAnalysisTool/ViewModels/SettingsWindowViewModel.cs @@ -58,6 +58,7 @@ public class SettingsWindowViewModel : BaseViewModel private string _packetFilter; private Visibility _packetFilterVisibility = Visibility.Collapsed; private string _backupStorageDirectoryPath; + private string _proxyUrlWithPort; public SettingsWindowViewModel() { @@ -76,6 +77,9 @@ private void InitializeSettings() MainTrackingCharacterName = SettingsController.CurrentSettings.MainTrackingCharacterName; + // Proxy url + ProxyUrlWithPort = SettingsController.CurrentSettings.ProxyUrlWithPort; + // Backup interval by days InitDropDownDownByDays(BackupIntervalByDays); BackupIntervalByDaysSelection = BackupIntervalByDays.FirstOrDefault(x => x.Value == SettingsController.CurrentSettings.BackupIntervalByDays); @@ -131,6 +135,7 @@ public void SaveSettings() SettingsController.CurrentSettings.AnotherAppToStartPath = AnotherAppToStartPath; + SettingsController.CurrentSettings.ProxyUrlWithPort = ProxyUrlWithPort; SettingsController.CurrentSettings.MainTrackingCharacterName = MainTrackingCharacterName; SettingsController.CurrentSettings.BackupIntervalByDays = BackupIntervalByDaysSelection.Value; SettingsController.CurrentSettings.MaximumNumberOfBackups = MaximumNumberOfBackupsSelection.Value; @@ -758,6 +763,16 @@ public string MainTrackingCharacterName } } + public string ProxyUrlWithPort + { + get => _proxyUrlWithPort; + set + { + _proxyUrlWithPort = value; + OnPropertyChanged(); + } + } + public FileInformation LanguagesSelection { get => _languagesSelection;