whitespace removal

This commit is contained in:
ppc
2024-11-18 22:00:53 +00:00
parent 67f90397b0
commit 703067e6d6
3 changed files with 10 additions and 9 deletions
+4 -3
View File
@@ -1,6 +1,7 @@
using System;
using System.Globalization;
using System.Linq;
using System.Threading;
namespace AMNet.Server;
@@ -9,9 +10,9 @@ namespace AMNet.Server;
/// </summary>
internal class CardPresenter
{
private readonly object _cardLock = new();
private readonly Lock _cardLock = new();
private StoredCard _currentCard;
public record StoredCard(byte[] Value, string OriginalValue, long ExpiresAt)
{
public bool Expired => Environment.TickCount64 >= ExpiresAt;
@@ -65,7 +66,7 @@ internal class CardPresenter
return null;
}
}
var card = new StoredCard(bytes, matrixCode, Environment.TickCount64 + validFor);
lock (_cardLock)
+4 -4
View File
@@ -14,17 +14,17 @@ internal static class Config
{
GameId = ReadKey(IOSection, "gameId", 4);
ServerName = ReadKey(IOSection, "serverName", 26, Environment.MachineName);
EnableAimeTxt = PInvoke.GetPrivateProfileInt(IOSection, "enableKeyboardMode", 1, ConfigFileName) > 0;
AimeTxtPath = ReadKey("aime", "aimePath", PInvoke.MAX_PATH, @"DEVICE\aime.txt");
}
public static string GameId { get; }
public static string ServerName { get; }
public static bool EnableAimeTxt { get; }
public static string AimeTxtPath { get; }
internal static unsafe string ReadKey(string section, string key, uint maxLength, string @default = null)
{
// +1 for null terminator
+2 -2
View File
@@ -63,7 +63,7 @@ internal static partial class WebServer
builder.Services.AddSingleton<CardPresenter>();
var app = builder.Build();
app.UseCors();
app.MapGet("/amnet/info", ServerInfo);
@@ -83,7 +83,7 @@ internal static partial class WebServer
Config.ServerName,
Environment.TickCount64 - startedAt,
lastPollAt < 0 ? null : Environment.TickCount64 - lastPollAt);
return Results.Ok(state);
}