clean up code

This commit is contained in:
Mikhail
2024-07-05 14:08:05 -04:00
parent 5036097c9d
commit d08c293cd4
31 changed files with 105 additions and 337 deletions

View File

@@ -38,9 +38,6 @@ namespace nksrv.LobbyServer
}
public static async Task DispatchSingle(IHttpContext ctx)
{
//var x = new RedirectionHandler();
//await x.HandleAsync(ctx);
//return;
LobbyMsgHandler? handler = null;
foreach (var item in Handlers)
{
@@ -53,11 +50,9 @@ namespace nksrv.LobbyServer
if (handler == null)
{
ctx.Response.StatusCode = 404;
//Logger.Error("HTTPS: No handler for /v1/" + ctx.RequestedPath);
}
else
{
// todo move everClass1.csything to its own handler
handler.Reset();
await handler.HandleAsync(ctx);
return;
@@ -75,7 +70,6 @@ namespace nksrv.LobbyServer
var info = new GameClientInfo() { ClientPublicKey = publicKey.ToArray() };
var box = SodiumKeyExchange.CalculateServerSharedSecret(JsonDb.ServerPublicKey, JsonDb.ServerPrivateKey, publicKey.ToArray());
info.Keys = box;
@@ -157,19 +151,18 @@ namespace nksrv.LobbyServer
/// <summary>
/// Client public key generated by game client
/// </summary>
public byte[] ClientPublicKey;
public byte[] ClientPublicKey = [];
/// <summary>
/// Authentication token
/// </summary>
public string ClientAuthToken;
public string ClientAuthToken = "";
/// <summary>
/// Rx/Tx key pair
/// </summary>
public SodiumKeyExchangeSharedSecretBox Keys;
public SodiumKeyExchangeSharedSecretBox Keys = new();
/// <summary>
/// User ID of the user
/// </summary>
public ulong UserId;
}
}