Skip to content

Commit

Permalink
又修了一个bug
Browse files Browse the repository at this point in the history
  • Loading branch information
YangSpring114 committed Dec 9, 2023
1 parent 3402d39 commit 901a444
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
10 changes: 0 additions & 10 deletions MinecraftLaunch.Test/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,4 @@

string gameFolder = "C:\\Users\\w\\Desktop\\temp\\.minecraft";

YggdrasilAuthenticator authenticator = new("https://littleskin.cn/api/yggdrasil", "[email protected]","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();
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,14 @@ public class YggdrasilAuthenticator(YggdrasilAccount account) : IAuthenticator<I

private YggdrasilAccount _account = account;

public YggdrasilAuthenticator(string url,
string email,
string password) : this(default) {
public YggdrasilAuthenticator(string url, string email, string password) : this(default) {
_url = url;
_email = email;
_password = password;
}

public IEnumerable<YggdrasilAccount> Authenticate() {
var task = AuthenticateAsync();
if (task.IsCompleted) {
return task.GetAwaiter().GetResult();
}

return null;
return AuthenticateAsync().GetAwaiter().GetResult();
}

public async ValueTask<IEnumerable<YggdrasilAccount>> AuthenticateAsync() {
Expand Down

0 comments on commit 901a444

Please sign in to comment.