using Microsoft.EntityFrameworkCore; using Wonderking.Packets.Incoming; namespace Server.PacketHandlers; using DB; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using NetCoreServer; public class ChannelSelectionHandler : IPacketHandler { private readonly IConfiguration _configuration; private readonly ILogger _logger; private readonly WonderkingContext _wonderkingContext; public ChannelSelectionHandler(IConfiguration configuration, ILogger logger, WonderkingContext wonderkingContext) { this._configuration = configuration; this._logger = logger; this._wonderkingContext = wonderkingContext; } public ChannelSelectionHandler() { } public Task HandleAsync(ChannelSelectionPacket packet, TcpSession session) { var authSession = (AuthSession)session; var charactersOfAccount = this._wonderkingContext.Accounts.Include(account => account.Characters) .FirstOrDefault(a => a.Id == authSession.AccountId) ?.Characters; return Task.CompletedTask; } }