Cap consumed-item reports per player (max 20/min); test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-27 16:31:54 +02:00
co-authored by Claude Opus 5.5
parent eac0ac046b
commit 9444ffa109
2 changed files with 8 additions and 0 deletions
+2
View File
@@ -133,12 +133,14 @@ try
Check(await alice.WaitFor(MsgType.TrafficStates, 800) == null, "Traffic from a player who is not the world authority is ignored");
alice.Send(MsgType.TrafficStates, trafficPayload);
Check(await bob.WaitFor(MsgType.TrafficStates) != null, "Traffic from the world authority is relayed");
for (int i = 0; i < 40; i++) { int id = 1000 + i; bob.Send(MsgType.ObjDestroy, Wire.Build(w => w.Write(id))); }
await Task.Delay(200);
var late = await TestClient.Join("Late", 0, null);
late.Send(MsgType.Ready, Array.Empty<byte>());
var lateSnap = Snapshot.Parse(await late.WaitFor(MsgType.WorldSnapshot));
Check(lateSnap.Ok && lateSnap.Appeared == 1 && lateSnap.Destroyed.Contains(777),
"Players joining later get bought and consumed items: " + lateSnap.Info);
Check(lateSnap.Destroyed.Count <= 21, "Mass 'consumed' reports (e.g. scene unload) are capped: " + lateSnap.Destroyed.Count + " stored");
late.Close();
Console.WriteLine("== Last position (spawn)");