update servicepoint to branch with better codegen

This commit is contained in:
Vinzenz Schroeter 2024-10-19 16:07:41 +02:00
parent 4fad4612b7
commit 416c8f2165
5 changed files with 24 additions and 10 deletions

View file

@ -4,11 +4,10 @@ using System.Net.Sockets;
using ServicePoint;
using TanksServer.GameLogic;
using TanksServer.Graphics;
using CompressionCode = ServicePoint.BindGen.CompressionCode;
namespace TanksServer.Interactivity;
internal sealed class SendToServicePointDisplay : IFrameConsumer
internal sealed class SendToServicePointDisplay : IFrameConsumer, IDisposable
{
private const int ScoresWidth = 12;
private const int ScoresHeight = 20;
@ -43,7 +42,7 @@ internal sealed class SendToServicePointDisplay : IFrameConsumer
var localIp = GetLocalIPv4(displayConfig.Value).Split('.');
Debug.Assert(localIp.Length == 4);
_scoresBuffer = Cp437Grid.New(12, 20);
_scoresBuffer = new Cp437Grid(12, 20);
_scoresBuffer[00] = "== TANKS! ==";
_scoresBuffer[01] = "-- scores --";
@ -113,4 +112,10 @@ internal sealed class SendToServicePointDisplay : IFrameConsumer
var endPoint = socket.LocalEndPoint as IPEndPoint ?? throw new NotSupportedException();
return endPoint.Address.ToString();
}
public void Dispose()
{
_displayConnection.Dispose();
_scoresBuffer.Dispose();
}
}