chore: fetch all required information for characters
Some checks failed
Build, Package and Push Images / preprocess (push) Successful in 2s
Build, Package and Push Images / build (push) Failing after 13s
Build, Package and Push Images / sonarqube (push) Has been skipped
Build, Package and Push Images / sbom-scan (push) Has been skipped
Build, Package and Push Images / container-build (push) Has been skipped
Build, Package and Push Images / container-sbom-scan (push) Has been skipped

This commit is contained in:
Timothy Schenk 2023-11-06 10:50:02 +01:00
parent 087bb41246
commit 208ce9b0c3

View file

@ -1,3 +1,4 @@
using Microsoft.EntityFrameworkCore;
using Wonderking.Packets.Incoming;
namespace Server.PacketHandlers;
@ -28,7 +29,9 @@ public class ChannelSelectionHandler : IPacketHandler<ChannelSelectionPacket>
public Task HandleAsync(ChannelSelectionPacket packet, TcpSession session)
{
var authSession = (AuthSession)session;
var charactersOfAccount = this._wonderkingContext.Accounts.FirstOrDefault(a => a.Id == authSession.AccountId);
var charactersOfAccount = this._wonderkingContext.Accounts.Include(account => account.Characters)
.FirstOrDefault(a => a.Id == authSession.AccountId)
?.Characters;
return Task.CompletedTask;
}
}