Skip to content

Commit

Permalink
Fix fetching OnlineMode user data on login (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
Naamloos authored Nov 15, 2023
1 parent 63c15a8 commit b97915f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Obsidian/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ private async Task HandleLoginStartAsync(byte[] data)

if (config.OnlineMode)
{
cachedUser = await UserCache.GetUserFromUuidAsync(loginStart.PlayerUuid ?? throw new NullReferenceException(nameof(loginStart.PlayerUuid)));
cachedUser = await UserCache.GetUserFromNameAsync(loginStart.Username ?? throw new NullReferenceException(nameof(loginStart.PlayerUuid)));

if (cachedUser is null)
{
Expand All @@ -436,7 +436,7 @@ private async Task HandleLoginStartAsync(byte[] data)
return;
}

Player = new Player(loginStart.PlayerUuid ?? this.cachedUser.Id, loginStart.Username, this, world);
Player = new Player(this.cachedUser.Id, loginStart.Username, this, world);
packetCryptography.GenerateKeyPair();

var (publicKey, randomToken) = packetCryptography.GeneratePublicKeyAndToken();
Expand Down
2 changes: 1 addition & 1 deletion Obsidian/Utilities/Mojang/MojangUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public sealed class MojangUser

public bool? Demo { get; init; }

public required List<SkinProperty> Properties { get; init; }
public List<SkinProperty>? Properties { get; init; }
}

public sealed class CachedUser
Expand Down

0 comments on commit b97915f

Please sign in to comment.