load maps from png files

This commit is contained in:
Vinzenz Schroeter 2024-04-14 21:10:21 +02:00
parent 51334af8c3
commit 6bed7d918f
13 changed files with 86 additions and 61 deletions

View file

@ -56,7 +56,6 @@ internal sealed class ClientScreenServer(
private readonly ILogger<ClientScreenServerConnection> _logger;
private readonly ClientScreenServer _server;
private readonly SemaphoreSlim _wantedFrames = new(1);
private PixelGrid? _lastSentPixels;
public ClientScreenServerConnection(WebSocket webSocket,
ILogger<ClientScreenServerConnection> logger,
@ -78,9 +77,6 @@ internal sealed class ClientScreenServer(
public async Task SendAsync(PixelGrid pixels)
{
if (_lastSentPixels == pixels)
return;
if (!await _wantedFrames.WaitAsync(TimeSpan.Zero))
{
_logger.LogTrace("client does not want a frame yet");
@ -91,7 +87,6 @@ internal sealed class ClientScreenServer(
try
{
await _channel.SendAsync(pixels.Data);
_lastSentPixels = pixels;
}
catch (WebSocketException ex)
{