diff --git a/NebulaAuth.sln b/NebulaAuth.sln index 6a7e1ce..f755fa3 100644 --- a/NebulaAuth.sln +++ b/NebulaAuth.sln @@ -22,6 +22,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "changelog", "changelog", "{ changelog\1.4.8.html = changelog\1.4.8.html changelog\1.4.9.html = changelog\1.4.9.html changelog\1.5.0.html = changelog\1.5.0.html + changelog\1.5.1.html = changelog\1.5.1.html EndProjectSection EndProject Global diff --git a/NebulaAuth/App.xaml.cs b/NebulaAuth/App.xaml.cs index bf9d06f..55f0d69 100644 --- a/NebulaAuth/App.xaml.cs +++ b/NebulaAuth/App.xaml.cs @@ -22,7 +22,7 @@ public partial class App : Application } catch (Exception ex) { - var msg = ex.Message; + var msg = ex.ToString(); if (ex is CantAlignTimeException) { msg = Loc.Tr(LocManager.GetCodeBehind("CantAlignTimeError")); diff --git a/NebulaAuth/Model/ProxyStorage.cs b/NebulaAuth/Model/ProxyStorage.cs index 9b8a796..08329c5 100644 --- a/NebulaAuth/Model/ProxyStorage.cs +++ b/NebulaAuth/Model/ProxyStorage.cs @@ -11,6 +11,7 @@ namespace NebulaAuth.Model; public static class ProxyStorage { + public const string FORMAT = ADDRESS_FORMAT + ":{USER}:{PASS}"; public const string ADDRESS_FORMAT = "{IP}:{PORT}"; @@ -32,7 +33,7 @@ public static class ProxyStorage try { var json = File.ReadAllText("proxies.json"); - var proxies = JsonConvert.DeserializeObject(json) ?? throw new NullReferenceException(); + var proxies = JsonConvert.DeserializeObject(json) ?? throw new NullReferenceException(); Proxies = proxies.ProxiesData; Proxies = new ObservableDictionary( Proxies.OrderBy(p => p.Key) @@ -48,16 +49,13 @@ public static class ProxyStorage SnackbarController.SendSnackbar("Ошибка при загрузке прокси"); SnackbarController.SendSnackbar(ex.Message); } - - - } public static void SetProxy(int? id, ProxyData proxyData) { if (id == null) { - if (Proxies.Any() == false) + if (Proxies.Count == 0) { id = 0; } @@ -94,7 +92,7 @@ public static class ProxyStorage return proxyData.AuthEnabled ? proxyData.ToString(FORMAT) : proxyData.ToString(ADDRESS_FORMAT); } - private static Proxies Create() + private static ProxiesSchema Create() { int? def = null; if (MaClient.DefaultProxy != null) @@ -106,18 +104,16 @@ public static class ProxyStorage } } - return new Proxies + return new ProxiesSchema { ProxiesData = Proxies, DefaultProxy = def }; } - -} - -public class Proxies -{ - public ObservableDictionary ProxiesData { get; set; } - public int? DefaultProxy { get; set; } + private class ProxiesSchema + { + public ObservableDictionary ProxiesData = new(); + public int? DefaultProxy; + } } \ No newline at end of file diff --git a/NebulaAuth/NebulaAuth.csproj b/NebulaAuth/NebulaAuth.csproj index f18c531..ac148e1 100644 --- a/NebulaAuth/NebulaAuth.csproj +++ b/NebulaAuth/NebulaAuth.csproj @@ -10,7 +10,7 @@ en;ru;ua Theme\lock.ico 7.0 - 1.5.0 + 1.5.1 diff --git a/NebulaAuth/ViewModel/Other/ProxyManagerVM.cs b/NebulaAuth/ViewModel/Other/ProxyManagerVM.cs index cd2e5e7..457a9f2 100644 --- a/NebulaAuth/ViewModel/Other/ProxyManagerVM.cs +++ b/NebulaAuth/ViewModel/Other/ProxyManagerVM.cs @@ -1,7 +1,5 @@ using AchiesUtilities.Collections; using AchiesUtilities.Web.Proxy; -using AutoUpdaterDotNET; -using CodingSeb.Localization.WPF; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using NebulaAuth.Core; @@ -42,14 +40,19 @@ public partial class ProxyManagerVM : ObservableObject var idPresent = (bool?)null; var proxies = new List>(); var i = 0; - foreach (var str in split.Where(s => string.IsNullOrWhiteSpace(s) == false)) + foreach (var s in split.Where(s => string.IsNullOrWhiteSpace(s) == false)) { i++; + var str = s; int? id = null; var match = IdRegex.Match(str); - if (match.Success) id = int.Parse(match.Groups[1].Value); - idPresent ??= match.Success; + if (match.Success) + { + id = int.Parse(match.Groups[1].Value); + str = IdRegex.Replace(str, ""); + } + idPresent ??= match.Success; if (idPresent.Value != match.Success) { SnackbarController.SendSnackbar(GetLocalizationOrDefault("WrongFormatSomeIdsMissing")); @@ -132,7 +135,7 @@ public partial class ProxyManagerVM : ObservableObject break; } } - + ProxyStorage.RemoveProxy(s.Key); SelectedProxy = nextNeighbor ?? prevNeighbor; CheckIfDefaultProxyStay(); @@ -167,7 +170,7 @@ public partial class ProxyManagerVM : ObservableObject { Shell.Logger.Error(ex); } - + } [RelayCommand] diff --git a/NebulaAuth/update.xml b/NebulaAuth/update.xml index d4afea0..e77b6e1 100644 --- a/NebulaAuth/update.xml +++ b/NebulaAuth/update.xml @@ -1,7 +1,7 @@  - 1.5.0.0 - https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/releases/download/1.5.0/NebulaAuth.1.5.0.zip - https://achiez.github.io/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/changelog/1.5.0.html + 1.5.1.0 + https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/releases/download/1.5.1/NebulaAuth.1.5.1.zip + https://achiez.github.io/NebulaAuth-Steam-Desktop-Authenticator-by-Achies/changelog/1.5.1.html false \ No newline at end of file diff --git a/changelog/1.5.1.html b/changelog/1.5.1.html new file mode 100644 index 0000000..59e8eef --- /dev/null +++ b/changelog/1.5.1.html @@ -0,0 +1,78 @@ + + + + + + Changelog + + + + +
+ +
+
Version 1.5.1
+
DATE
+
+ - FIX: Fixed proxy problem when {id} was parsed as a part of password when using 'ip:port:username:password{id}' proxy format +
+
+
+ + + \ No newline at end of file