Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
laolarou726 committed Jan 24, 2025
1 parent b8ab277 commit 1d25b21
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ await profileResRes.Content.ReadFromJsonAsync(MojangErrorResponseModelContext.De
Username = profileRes.Name
};

if (!this.LauncherAccountParser.AddNewAccount(uuid, accountModel, out var id))
if (!this.LauncherAccountParser.AddOrReplaceAccount(uuid, accountModel, out var id))
return new MicrosoftAuthResult
{
AuthStatus = AuthStatus.Failed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public AuthResultBase Auth(bool userField = false)
Username = this.Username
};

if (!this.LauncherAccountParser.AddNewAccount(localUuid, accountModel, out var id))
if (!this.LauncherAccountParser.AddOrReplaceAccount(localUuid, accountModel, out var id))
return new AuthResultBase
{
AuthStatus = AuthStatus.Failed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public async Task<AuthResultBase> AuthTaskAsync(bool userField = false)
}
*/

if (!this.LauncherAccountParser.AddNewAccount(rUuid, profile, out var accountId))
if (!this.LauncherAccountParser.AddOrReplaceAccount(rUuid, profile, out var accountId))
return new YggdrasilAuthResult
{
AuthStatus = AuthStatus.Failed,
Expand Down Expand Up @@ -412,7 +412,7 @@ public async Task<AuthResultBase> AuthRefreshTaskAsync(AuthResponseModel respons
};
}

if (!this.LauncherAccountParser.AddNewAccount(rUuid, profile, out var id))
if (!this.LauncherAccountParser.AddOrReplaceAccount(rUuid, profile, out var id))
return new YggdrasilAuthResult
{
AuthStatus = AuthStatus.Failed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public bool ActivateAccount(string uuid)
return true;
}

public bool AddNewAccount(string uuid, AccountModel account, out Guid? id)
public bool AddOrReplaceAccount(string uuid, AccountModel account, out Guid? id)
{
this.LauncherAccount.Accounts ??= [];

Expand Down
2 changes: 1 addition & 1 deletion ProjBobcat/ProjBobcat/Interface/ILauncherAccountParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace ProjBobcat.Interface;
public interface ILauncherAccountParser
{
LauncherAccountModel LauncherAccount { get; }
bool AddNewAccount(string uuid, AccountModel account, out Guid? id);
bool AddOrReplaceAccount(string uuid, AccountModel account, out Guid? id);
bool RemoveAccount(Guid id);
KeyValuePair<string, AccountModel>? Find(Guid id);
bool ActivateAccount(string uuid);
Expand Down

0 comments on commit 1d25b21

Please sign in to comment.