33 lines
1 KiB
C#
33 lines
1 KiB
C#
namespace Server.PacketHandlers;
|
|
|
|
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;
|
|
}
|
|
}
|