From 901a444afd05f51e13ab1dd6dcf116c6780f0dc9 Mon Sep 17 00:00:00 2001 From: YangSpring114 Date: Sun, 10 Dec 2023 02:27:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=88=E4=BF=AE=E4=BA=86=E4=B8=80=E4=B8=AAbu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MinecraftLaunch.Test/Program.cs | 10 ---------- .../Authenticator/YggdrasilAuthenticator.cs | 11 ++--------- 2 files changed, 2 insertions(+), 19 deletions(-) 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() {