KafkaSR/RPG.Services.Gateserver/RPGGateserver.cs

26 lines
689 B
C#
Raw Normal View History

2024-01-29 23:49:21 +00:00
using RPG.Services.Core;
using RPG.Services.Gateserver.Network.Tcp;
namespace RPG.Services.Gateserver;
internal class RPGGateserver : RPGServiceBase
{
private readonly TcpGateway _gateway;
public RPGGateserver(ServiceManager serviceManager, TcpGateway tcpGateway) : base(serviceManager)
{
_gateway = tcpGateway;
}
public override async Task StartAsync(CancellationToken cancellationToken)
{
await base.StartAsync(cancellationToken);
_gateway.Start();
}
public override async Task StopAsync(CancellationToken cancellationToken)
{
await base.StopAsync(cancellationToken);
await _gateway.StopAsync();
}
}