live player info in client
This commit is contained in:
parent
fb675e59ff
commit
a50a9770c9
1 changed files with 192 additions and 69 deletions
|
|
@ -7,13 +7,11 @@ internal sealed class ControlsServer(
|
|||
ILoggerFactory loggerFactory
|
||||
) : WebsocketServer<ControlsServerConnection>(logger)
|
||||
{
|
||||
public async Task HandleClientAsync(WebSocket ws, Player player)
|
||||
public Task HandleClientAsync(WebSocket ws, Player player)
|
||||
{
|
||||
logger.LogDebug("control client connected {}", player.Id);
|
||||
var clientLogger = loggerFactory.CreateLogger<ControlsServerConnection>();
|
||||
var sock = new ControlsServerConnection(ws, clientLogger, player);
|
||||
await AddConnection(sock);
|
||||
await sock.ReceiveAsync();
|
||||
await RemoveConnection(sock);
|
||||
return HandleClientAsync(sock);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue