LANTERN P1: dev injector — socket-fire injection (enables the L3 netcode validation)

DebugInputInjectionSystem (#if UNITY_EDITOR) gains FireSocket(i, frames) + per-socket hold
frames + the OnUpdate socket-event sets, mirroring the legacy Fire injection. Drives the real
gather->command->prediction->AbilityFireSystem path per socket for headless validation.

Used to validate group-A live (instant-play ServerWorld+ClientWorld): socket 0&1 = a projectile
Spark, injected same-frame -> maxSrvProj=2, maxCliProj=2 (server==client parity),
distinctSpawnIds=2 with distinctSocketBits=2 (the SpawnId desync fix confirmed LIVE), both
per-socket cooldowns advanced. Netcode half of the group-A gate: PASS.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-14 11:29:08 -07:00
parent 5761836bbb
commit 58c2eaca58
@@ -53,6 +53,12 @@ namespace ProjectM.Client
/// override). The ability cooldown still gates how many shots actually result.</summary>
public static void Fire(int frames = 10) { Active = true; FireFrames = math.max(FireFrames, frames); }
/// <summary>Per-socket fire holds (LANTERN 4-socket kit). Each held frame raises that socket's fire event.</summary>
public static readonly int[] SocketFrames = new int[SocketId.Count];
/// <summary>Hold socket <paramref name="i"/>'s fire for the next <paramref name="frames"/> frames (also enables override).</summary>
public static void FireSocket(int i, int frames = 10) { Active = true; if ((uint)i < (uint)SocketId.Count) SocketFrames[i] = math.max(SocketFrames[i], frames); }
/// <summary>Convenience: hold a planar move heading (also enables override).</summary>
public static void SetMove(float x, float z) { Active = true; Move = new float2(x, z); }
@@ -60,7 +66,7 @@ namespace ProjectM.Client
public static void SetAim(float x, float z) { Active = true; Aim = new float2(x, z); }
/// <summary>Convenience: stop overriding and clear all injected input.</summary>
public static void Stop() { Active = false; Move = default; Aim = default; FireFrames = 0; }
public static void Stop() { Active = false; Move = default; Aim = default; FireFrames = 0; for (int i = 0; i < SocketId.Count; i++) SocketFrames[i] = 0; }
protected override void OnCreate()
{
@@ -74,6 +80,11 @@ namespace ProjectM.Client
bool fire = FireFrames > 0;
if (FireFrames > 0) FireFrames--;
// LANTERN 4-socket kit: per-socket fire holds, decremented once per frame.
bool s0 = SocketFrames[0] > 0; if (SocketFrames[0] > 0) SocketFrames[0]--;
bool s1 = SocketFrames[1] > 0; if (SocketFrames[1] > 0) SocketFrames[1]--;
bool s2 = SocketFrames[2] > 0; if (SocketFrames[2] > 0) SocketFrames[2]--;
bool s3 = SocketFrames[3] > 0; if (SocketFrames[3] > 0) SocketFrames[3]--;
float2 move = Move;
float2 aim = Aim;
@@ -88,6 +99,10 @@ namespace ProjectM.Client
input.ValueRW.Scheme = Scheme;
if (fire)
input.ValueRW.Fire.Set();
if (s0) input.ValueRW.Socket0.Set();
if (s1) input.ValueRW.Socket1.Set();
if (s2) input.ValueRW.Socket2.Set();
if (s3) input.ValueRW.Socket3.Set();
}
}
}