Pass default username with fallback to "Player" in NameChange script

This commit is contained in:
RattleSN4K3 2025-05-13 00:17:14 +02:00
parent cdcff1b022
commit abd8c4cfd1
5 changed files with 11 additions and 4 deletions

View file

@ -269,7 +269,7 @@ else
foreach (var manifest in manifests)
{
await Client.Scripts.RunNameChangeScriptAsync(Game.InstallDirectory, Game.Id, user.Alias);
await Client.Scripts.RunNameChangeScriptAsync(Game.InstallDirectory, Game.Id, user.GetUserNameSafe ?? Settings.DEFAULT_GAME_USERNAME);
}
}

View file

@ -43,7 +43,7 @@
User User;
Guid AvatarId = Guid.Empty;
string Alias = "Player";
string Alias = Settings.DEFAULT_GAME_USERNAME;
protected override async Task OnInitializedAsync()
{
@ -52,7 +52,7 @@
User = await UserService.GetCurrentUser();
AvatarId = User?.Avatar?.Id ?? Guid.Empty;
Alias = String.IsNullOrWhiteSpace(User?.Alias) ? User?.UserName ?? "Player" : User.Alias;
Alias = String.IsNullOrWhiteSpace(User?.Alias) ? User?.UserName ?? Settings.DEFAULT_GAME_USERNAME : User.Alias;
};
await ProfileService.DownloadProfileInfoAsync();