refactor(battle-node): WireConstants for SIO event names + crypto RNG battle id

This commit is contained in:
gamer147
2026-06-01 11:53:01 -04:00
parent 133346e3e8
commit ef3d7bb82b
4 changed files with 45 additions and 12 deletions

View File

@@ -0,0 +1,27 @@
namespace SVSim.BattleNode.Protocol;
/// <summary>
/// String constants that show up on the wire as opaque tags. Lifting them out of
/// inline string literals gives each one a single source of truth and a name that
/// reads at the use site.
/// </summary>
internal static class WireConstants
{
/// <summary>SIO event name for ordered server-pushed frames (the lifecycle channel).</summary>
public const string SynchronizeEvent = "synchronize";
/// <summary>SIO event name for client-emitted msg frames + their ack-responses.</summary>
public const string MsgEvent = "msg";
/// <summary>SIO event name for Gungnir keepalive frames (both directions).</summary>
public const string AliveEvent = "alive";
/// <summary>
/// Placeholder UUID we stamp on every server-originated envelope. Prod servers stamp a
/// real per-request UUID; the client doesn't validate it.
/// </summary>
public const string ServerUuid = "node-stub";
/// <summary>Gungnir scs/ocs value the v1 server reports unconditionally.</summary>
public const string OnlineStatus = "ONLINE";
}