continuity/Server/PacketHandlers/ChannelSelectionHandler.cs

35 lines
1 KiB
C#
Raw Normal View History

2023-11-06 09:11:36 +00:00
using Wonderking.Packets.Incoming;
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;
public class ChannelSelectionHandler : IPacketHandler<ChannelSelectionPacket>
{
private readonly IConfiguration _configuration;
private readonly ILogger<ChannelSelectionHandler> _logger;
private readonly WonderkingContext _wonderkingContext;
2023-08-14 20:22:43 +00:00
public ChannelSelectionHandler(IConfiguration configuration, ILogger<ChannelSelectionHandler> logger,
WonderkingContext wonderkingContext)
{
this._configuration = configuration;
this._logger = logger;
this._wonderkingContext = wonderkingContext;
2023-08-14 20:22:43 +00:00
}
public ChannelSelectionHandler()
{
}
public Task HandleAsync(ChannelSelectionPacket packet, TcpSession session)
{
var authSession = (AuthSession)session;
var charactersOfAccount = this._wonderkingContext.Accounts.FirstOrDefault(a => a.Id == authSession.AccountId);
2023-08-14 20:22:43 +00:00
return Task.CompletedTask;
}
}