Supercell.GUT/Supercell.GUT.Server/GUTServer.cs
BreadDEV 8c6a533918 [v0.0.2] you can enter menu now. but still early state
todo: improve code and finish base structures
2024-03-05 17:37:18 +07:00

28 lines
683 B
C#

using Microsoft.Extensions.Hosting;
using Supercell.GUT.Server.Network;
using Supercell.GUT.Titan.Logic.Debug;
namespace Supercell.GUT.Server;
internal class GUTServer : IHostedService
{
private readonly IServerGateway _gateway;
public GUTServer(IServerGateway serverGateway, IDebuggerListener debuggerListener)
{
_gateway = serverGateway;
Debugger.SetListener(debuggerListener);
}
public Task StartAsync(CancellationToken cancellationToken)
{
_gateway.Start();
return Task.CompletedTask;
}
public async Task StopAsync(CancellationToken cancellationToken)
{
await _gateway.ShutdownAsync();
}
}