mirror of
https://github.com/thebreaddev/Supercell.GUT.git
synced 2024-11-10 07:44:37 +00:00
29 lines
681 B
C#
29 lines
681 B
C#
|
using Microsoft.Extensions.Hosting;
|
|||
|
using Supercell.GUT.Server.Network;
|
|||
|
using Supercell.GUT.Titan.Debugging;
|
|||
|
|
|||
|
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();
|
|||
|
}
|
|||
|
}
|