2023-10-12 07:15:34 +00:00
|
|
|
namespace Server.PacketHandlers;
|
2023-08-14 20:22:43 +00:00
|
|
|
|
|
|
|
using DB;
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using NetCoreServer;
|
|
|
|
using Packets.Incoming;
|
|
|
|
|
|
|
|
public class ChannelSelectionHandler : IPacketHandler<ChannelSelectionPacket>
|
|
|
|
{
|
|
|
|
private readonly IConfiguration configuration;
|
|
|
|
private readonly ILogger<ChannelSelectionHandler> logger;
|
|
|
|
private readonly WonderkingContext wonderkingContext;
|
|
|
|
|
|
|
|
public ChannelSelectionHandler(IConfiguration configuration, ILogger<ChannelSelectionHandler> 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.FirstOrDefault(a => a.Id == authSession.AccountId);
|
|
|
|
return Task.CompletedTask;
|
|
|
|
}
|
|
|
|
}
|