From a9fdb58cac466706fec8f322df8914cd979a95d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=B2=D0=B8=D0=B4=20=D0=A7=D0=B5=D1=80=D0=BD?= =?UTF-8?q?=D0=BE=D0=BF=D1=8F=D1=82=D0=BE=D0=B2?= Date: Wed, 10 Apr 2024 01:39:42 +0300 Subject: [PATCH] The most significant changes in the code include the addition of a new HTML file `changelog\1.4.8.html` to the project `NebulaAuth.sln`, which displays the changelog for version 1.4.8 of the software. A new converter `ProxyDataTextConverter` was added to `App.xaml` and a new class `ProxyDataTextConverter` was added in `ProxyTextConverter.cs`. The `ProxyTextConverter` was also modified to include the port number in the return string. Several methods were added and modified in `Storage.cs`, `MainVM_Groups.cs`, `MainVM_Proxy.cs`, and `ProxyManagerVM.cs` to validate if the data can be saved before performing various operations. The `SnackbarController.cs` was modified to increase the minimum snackbar time and adjust the duration calculation. In `MafileSerializer_SessionData.cs`, the check for whether the refresh token is expired or not was moved to a different location within the code. New localization entries were added in `localization.loc.json`. The changes are as follows: 1. Added a new HTML file `changelog\1.4.8.html` to the project `NebulaAuth.sln`. 2. Added a new converter `ProxyDataTextConverter` to `App.xaml`. 3. Imported `AchiesUtilities.Web.Proxy` in `ProxyTextConverter.cs`. 4. Modified the return string in `ProxyTextConverter` to include the port number. 5. Added a new class `ProxyDataTextConverter` in `ProxyTextConverter.cs`. 6. Increased the minimum snackbar time from 1000 to 1200 in `SnackbarController.cs`. 7. Modified the duration calculation in `GetSnackbarTime` method in `SnackbarController.cs`. 8. Added tooltips to ComboBoxes in `MainWindow.xaml`. 9. Added a new method `ValidateCanSave` in `Storage.cs` to validate if the data can be saved. 10. Added a new method `GetProxyString` in `ProxyStorage.cs` to get the proxy string. 11. Modified the `CompareProxy` method in `ProxyStorage.cs` to compare the address and port of the proxy data. 12. Removed a logger info line in `Shell.cs`. 13. Added a new property `DuplicateFound` in `Storage.cs`. 14. Modified the `CreatePathForMafile` method in `Storage.cs` to create a file name based on the account name or steam id. 15. Modified the `AddGroup` method in `MainVM_Groups.cs` to validate if the data can be saved before adding a group. 16. Modified the `AddToGroup` method in `MainVM_Groups.cs` to validate if the data can be saved before adding to a group. 17. Modified the `RemoveGroup` method in `MainVM_Groups.cs` to validate if the data can be saved before removing a group. 18. Modified the `PerformQuery` method in `MainVM_Groups.cs` to set `SelectedMafile` to the first item in `MaFiles`. 19. Modified the `RemoveProxy` method in `MainVM_Proxy.cs` to validate if the data can be saved before removing a proxy. 20. Modified the `SelectedProxyChanged` method in `MainVM_Proxy.cs` to validate if the data can be saved before changing the selected proxy. 21. Added a new method `ValidateCanSaveAndWarn` in `MainVM_Proxy.cs` to validate if the data can be saved and send a snackbar message if it can't. 22. Modified the `TimerCheckSeconds` property in `MainVM_Timer.cs` to send a snackbar message when the timer is changed. 23. Added a new method `RemoveProxy` in `LoginAgainOnImportVM.cs` to remove the selected proxy. 24. Modified the `AddProxy` method in `ProxyManagerVM.cs` to use the `DefaultScheme` to parse the proxy data. 25. Modified the `AddProxy` method in `ProxyManagerVM.cs` to use the `DefaultScheme` to parse the proxy data and get the proxy string. 26. Modified the `CopyProxy` method in `ProxyManagerVM.cs` to get the proxy string. 27. Added new localization entries in `localization.loc.json`. 28. The `update.xml` file was updated to reflect the new version of the software (1.4.8.0) and the corresponding download URL and changelog URL were updated accordingly. 29. In `AdmissionHelper.cs`, a new constant `SESSION_ID_COOKIE_NAME` was added to replace hardcoded "sessionid" strings. The same was done for `LANGUAGE_COOKIE_NAME` replacing "Steam_Language". This change was reflected in multiple methods within the `AdmissionHelper` class. 30. A new method `CloneCookie` was added to `AdmissionHelper.cs` to create a copy of a given cookie. This method was then used to replace repetitive code in the `TransferCommunityCookies` method. 31. In `MafileSerializer_SessionData.cs`, the check for whether the refresh token is expired or not was moved to a different location within the code. This change does not affect the functionality but may improve readability or maintainability of the code. --- NebulaAuth.sln | 1 + NebulaAuth/App.xaml | 1 + NebulaAuth/Converters/ProxyTextConverter.cs | 21 ++++- NebulaAuth/Core/SnackbarController.cs | 15 ++-- NebulaAuth/MainWindow.xaml | 4 +- NebulaAuth/Model/ProxyStorage.cs | 37 +++++--- NebulaAuth/Model/Shell.cs | 1 - NebulaAuth/Model/Storage.cs | 25 ++++-- .../Dialogs/LoginAgainOnImportDialog.xaml | 9 +- NebulaAuth/View/ProxyManagerView.xaml | 13 +-- NebulaAuth/ViewModel/MainVM.cs | 2 +- NebulaAuth/ViewModel/MainVM_Groups.cs | 12 +-- NebulaAuth/ViewModel/MainVM_Proxy.cs | 13 +++ NebulaAuth/ViewModel/MainVM_Timer.cs | 1 + .../ViewModel/Other/LoginAgainOnImportVM.cs | 8 ++ NebulaAuth/ViewModel/Other/ProxyManagerVM.cs | 32 +++---- NebulaAuth/localization.loc.json | 36 +++++++- NebulaAuth/update.xml | 6 +- .../Authentication/AdmissionHelper.cs | 26 +++--- .../MaFiles/MafileSerializer_SessionData.cs | 16 ++-- changelog/1.4.8.html | 84 +++++++++++++++++++ 21 files changed, 280 insertions(+), 83 deletions(-) create mode 100644 changelog/1.4.8.html diff --git a/NebulaAuth.sln b/NebulaAuth.sln index b3092fc..d813747 100644 --- a/NebulaAuth.sln +++ b/NebulaAuth.sln @@ -19,6 +19,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "changelog", "changelog", "{ changelog\1.4.5.html = changelog\1.4.5.html changelog\1.4.6.html = changelog\1.4.6.html changelog\1.4.7.html = changelog\1.4.7.html + changelog\1.4.8.html = changelog\1.4.8.html EndProjectSection EndProject Global diff --git a/NebulaAuth/App.xaml b/NebulaAuth/App.xaml index 8f47884..ba657d7 100644 --- a/NebulaAuth/App.xaml +++ b/NebulaAuth/App.xaml @@ -18,6 +18,7 @@ + diff --git a/NebulaAuth/Converters/ProxyTextConverter.cs b/NebulaAuth/Converters/ProxyTextConverter.cs index 889a351..a3806fb 100644 --- a/NebulaAuth/Converters/ProxyTextConverter.cs +++ b/NebulaAuth/Converters/ProxyTextConverter.cs @@ -1,6 +1,7 @@ using System; using System.Globalization; using System.Windows.Data; +using AchiesUtilities.Web.Proxy; using NebulaAuth.Model.Entities; namespace NebulaAuth.Converters; @@ -14,7 +15,25 @@ public class ProxyTextConverter : IValueConverter return string.Empty; } - return $"{p.Id}: {p.Data.Address}"; + return $"{p.Id}: {p.Data.Address}:{p.Data.Port}"; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } +} + +public class ProxyDataTextConverter : IValueConverter +{ + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is not ProxyData p) + { + return string.Empty; + } + + return $"{p.Address}:{p.Port}"; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/NebulaAuth/Core/SnackbarController.cs b/NebulaAuth/Core/SnackbarController.cs index fc0accb..fb3ac05 100644 --- a/NebulaAuth/Core/SnackbarController.cs +++ b/NebulaAuth/Core/SnackbarController.cs @@ -7,11 +7,8 @@ public class SnackbarController { public static SnackbarMessageQueue MessageQueue { get; } = new() { DiscardDuplicates = true}; - private const int MIN_SNACKBAR_TIME = 1000; - public SnackbarController() - { + private const int MIN_SNACKBAR_TIME = 1200; - } /// /// /// @@ -46,10 +43,12 @@ public class SnackbarController private static TimeSpan GetSnackbarTime(string str) { - if (str.Length <= 100) return TimeSpan.FromMilliseconds(MIN_SNACKBAR_TIME); - - var length = str.Length / 0.07; - return TimeSpan.FromMilliseconds(length); + var duration = str.Length / 0.03; + if (duration < MIN_SNACKBAR_TIME) + { + duration = MIN_SNACKBAR_TIME; + } + return TimeSpan.FromMilliseconds(duration); } diff --git a/NebulaAuth/MainWindow.xaml b/NebulaAuth/MainWindow.xaml index 71982c4..ee42c42 100644 --- a/NebulaAuth/MainWindow.xaml +++ b/NebulaAuth/MainWindow.xaml @@ -68,7 +68,7 @@ - + - + @@ -34,8 +34,8 @@ - - @@ -51,8 +51,9 @@ Margin="15" FontSize="16"> - + + @@ -61,7 +62,7 @@ - + + + + +
+ +
+
Version 1.4.8
+
DATE
+
+ - Fixed crash when attempting to update/save mafile without SessionData on proxy and group change
+ - The account found through the search will be selected automatically
+ - Added proxy support types: without authentication (no user and password), domain proxy (localhost, mydomain.com), with "http://" scheme
+ - Added "Timer changed" snackbar to indicate that preferences was updated
+ - Now the port is visible in the proxy text
+ - Few tooltips added on "Groups" and "Proxy" fields"
+ - Small UI improvements
+
+
+
+ + + \ No newline at end of file