diff --git a/MinecraftLaunch.Test/Program.cs b/MinecraftLaunch.Test/Program.cs index b12b967..ef2d9e2 100644 --- a/MinecraftLaunch.Test/Program.cs +++ b/MinecraftLaunch.Test/Program.cs @@ -5,14 +5,4 @@ string gameFolder = "C:\\Users\\w\\Desktop\\temp\\.minecraft"; -YggdrasilAuthenticator authenticator = new("https://littleskin.cn/api/yggdrasil", "3424968114@qq.com","wxysdsb123"); -var result = (await authenticator.AuthenticateAsync()) - .ToList(); - -var account = result.FirstOrDefault(); -authenticator = new(account); -var result1 = await authenticator.AuthenticateAsync(); -foreach (var item in result1) - Console.WriteLine(item.Name); - Console.ReadKey(); \ No newline at end of file diff --git a/MinecraftLaunch/Components/Authenticator/YggdrasilAuthenticator.cs b/MinecraftLaunch/Components/Authenticator/YggdrasilAuthenticator.cs index abf384e..3323e8f 100644 --- a/MinecraftLaunch/Components/Authenticator/YggdrasilAuthenticator.cs +++ b/MinecraftLaunch/Components/Authenticator/YggdrasilAuthenticator.cs @@ -23,21 +23,14 @@ public class YggdrasilAuthenticator(YggdrasilAccount account) : IAuthenticator Authenticate() { - var task = AuthenticateAsync(); - if (task.IsCompleted) { - return task.GetAwaiter().GetResult(); - } - - return null; + return AuthenticateAsync().GetAwaiter().GetResult(); } public async ValueTask> AuthenticateAsync() {