2024-02-11 22:23:13 +00:00
|
|
|
|
using Core.Config;
|
|
|
|
|
using GameServer.Controllers.Factory;
|
2024-02-09 09:44:42 +00:00
|
|
|
|
using GameServer.Network.Kcp;
|
2024-02-07 21:41:39 +00:00
|
|
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
|
|
|
|
|
|
namespace GameServer;
|
|
|
|
|
internal class WWGameServer : IHostedService
|
|
|
|
|
{
|
|
|
|
|
private readonly KcpGateway _gateway;
|
|
|
|
|
|
2024-02-11 22:23:13 +00:00
|
|
|
|
public WWGameServer(KcpGateway gateway, ConfigManager manager, EventHandlerFactory messageHandlerFactory)
|
2024-02-07 21:41:39 +00:00
|
|
|
|
{
|
2024-02-11 22:23:13 +00:00
|
|
|
|
_ = manager;
|
2024-02-07 21:41:39 +00:00
|
|
|
|
_ = messageHandlerFactory;
|
|
|
|
|
_gateway = gateway;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Task StartAsync(CancellationToken cancellationToken)
|
|
|
|
|
{
|
|
|
|
|
_gateway.Start();
|
|
|
|
|
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-09 22:15:05 +00:00
|
|
|
|
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
|
2024-02-07 21:41:39 +00:00
|
|
|
|
}
|