refactor(battle-node): tighten Phase setter to private; document sid opacity
This commit is contained in:
@@ -33,7 +33,7 @@ public sealed class BattleSession
|
|||||||
|
|
||||||
public string BattleId { get; }
|
public string BattleId { get; }
|
||||||
public long ViewerId { get; }
|
public long ViewerId { get; }
|
||||||
public BattleSessionPhase Phase { get; internal set; } = BattleSessionPhase.AwaitingInitNetwork;
|
public BattleSessionPhase Phase { get; private set; } = BattleSessionPhase.AwaitingInitNetwork;
|
||||||
public InboundTracker Inbound { get; } = new();
|
public InboundTracker Inbound { get; } = new();
|
||||||
public OutboundSequencer Outbound { get; } = new();
|
public OutboundSequencer Outbound { get; } = new();
|
||||||
|
|
||||||
@@ -378,6 +378,10 @@ public sealed class BattleSession
|
|||||||
|
|
||||||
private async Task SendEioOpenAsync(CancellationToken ct)
|
private async Task SendEioOpenAsync(CancellationToken ct)
|
||||||
{
|
{
|
||||||
|
// SID format is server-internal; the EIO3 spec suggests a 20-char base64-url id,
|
||||||
|
// but BestHTTP's SocketIO client treats it as an opaque string and never validates
|
||||||
|
// shape. Hex-truncated Guid is fine in practice; revisit if we ever care about
|
||||||
|
// matching prod telemetry.
|
||||||
var sid = Guid.NewGuid().ToString("N").Substring(0, 16);
|
var sid = Guid.NewGuid().ToString("N").Substring(0, 16);
|
||||||
var handshake = new EngineIoHandshake(sid, Array.Empty<string>(), 25000, 60000).ToJson();
|
var handshake = new EngineIoHandshake(sid, Array.Empty<string>(), 25000, 60000).ToJson();
|
||||||
await SendTextAsync($"0{handshake}", ct);
|
await SendTextAsync($"0{handshake}", ct);
|
||||||
|
|||||||
Reference in New Issue
Block a user