namespace AcDream.Core.Net;
///
/// Diagnostic owner for the ACDREAM_PROBE_NET probe family (#260).
/// Read once at startup, following the PhysicsDiagnostics pattern.
///
///
/// When enabled, three probe line families are emitted:
///
/// - [net-out] — one line per outbound reliable game message at the
/// WorldSession.SendGameMessage chokepoint: opcode, game-action type +
/// sequence (when the body is a 0xF7B1 GameAction), fragment/packet sequence,
/// managed thread id, and session state. An exception escaping the wire write
/// additionally emits [net-out-EX] via an exception filter (log
/// without catching — behavior is unchanged).
/// - [net-tick] — a once-per-second cadence summary from
/// WorldSession.Tick: inbound datagrams/s, remaining queue depth,
/// budget-break count, worst inter-tick gap (= worst frame stall as seen by
/// the net pump), outbound sends/s, and acks/s.
/// - [cmd-gate] — one line per generation-gated runtime command
/// REJECTION in CurrentGameRuntimeCommandAdapter.Validate (status,
/// expected vs view generation, lifecycle, IsInWorld) plus the combat-toggle
/// result. These rejections are otherwise completely silent, which is what
/// let #260's wedge hide.
///
/// Zero steady-state cost when off: every site is behind this single bool.
///
///
public static class NetDiagnostics
{
///
/// ACDREAM_PROBE_NET=1 — #260 outbound/command-gate probe family.
///
public static bool ProbeNet { get; set; } =
Environment.GetEnvironmentVariable("ACDREAM_PROBE_NET") == "1";
///
/// ACDREAM_PROBE_REVEAL=1 — #260 reveal-stall probe: while a
/// reveal destination's composite warmup is incomplete, emit one
/// [composite-warmup] line per second naming the pending queue
/// depth, scan state, upload-budget gate, and the first few unresolved
/// GfxObj ids. The two permanent-stall shapes (a mesh id that never
/// resolves vs. an upload budget that never reopens) are otherwise
/// indistinguishable and invisible.
///
public static bool ProbeReveal { get; set; } =
Environment.GetEnvironmentVariable("ACDREAM_PROBE_REVEAL") == "1";
}