separate folders per functionality
This commit is contained in:
parent
7f00160780
commit
0ca6a91a7e
33 changed files with 60 additions and 113 deletions
|
@ -1,5 +1,3 @@
|
|||
using TanksServer.Models;
|
||||
|
||||
namespace TanksServer.ServicePointDisplay;
|
||||
|
||||
internal class DisplayBufferView(byte[] data)
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
using TanksServer.Helpers;
|
||||
using TanksServer.Services;
|
||||
|
||||
namespace TanksServer.ServicePointDisplay;
|
||||
|
||||
internal sealed class PixelDisplayBufferView : DisplayBufferView
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
using System.Diagnostics;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TanksServer.Servers;
|
||||
using TanksServer.Services;
|
||||
using TanksServer.TickSteps;
|
||||
using TanksServer.GameLogic;
|
||||
using TanksServer.Graphics;
|
||||
using TanksServer.Interactivity;
|
||||
|
||||
namespace TanksServer.ServicePointDisplay;
|
||||
|
||||
|
@ -34,16 +33,19 @@ internal sealed class SendToServicePointDisplay : ITickStep, IDisposable
|
|||
? new UdpClient(options.Value.Hostname, options.Value.Port)
|
||||
: null;
|
||||
|
||||
_scoresBuffer = new(new(MapService.TilesPerRow, 0), 12, 20);
|
||||
_scoresBuffer.Rows[0] = "== TANKS! ==";
|
||||
_scoresBuffer.Rows[1] = "-- scores --";
|
||||
|
||||
_scoresBuffer.Rows[17] = "-- join --";
|
||||
|
||||
var localIp = GetLocalIp(options.Value.Hostname, options.Value.Port).Split('.');
|
||||
Debug.Assert(localIp.Length == 4); // were talking legacy ip
|
||||
_scoresBuffer.Rows[18] = string.Join('.', localIp[..2]);
|
||||
_scoresBuffer.Rows[19] = string.Join('.', localIp[2..]);
|
||||
_scoresBuffer = new TextDisplayBuffer(new TilePosition(MapService.TilesPerRow, 0), 12, 20)
|
||||
{
|
||||
Rows =
|
||||
{
|
||||
[0] = "== TANKS! ==",
|
||||
[1] = "-- scores --",
|
||||
[17] = "-- join --",
|
||||
[18] = string.Join('.', localIp[..2]),
|
||||
[19] = string.Join('.', localIp[2..])
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static string GetLocalIp(string host, int port)
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
using TanksServer.Models;
|
||||
|
||||
namespace TanksServer.ServicePointDisplay;
|
||||
|
||||
internal sealed class TextDisplayBuffer : DisplayBufferView
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue