mirror of
https://github.com/thebreaddev/Supercell.GUT.git
synced 2024-11-10 07:44:37 +00:00
8c6a533918
todo: improve code and finish base structures
28 lines
683 B
C#
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();
|
|
}
|
|
}
|