fix(game-server): survive bad-packet exceptions in tick loop
Build Game Server / build (push) Successful in 17s

Wrap world.Tick in try/catch so an incompatible/misaligned client packet
logs an error and the server keeps running (stable R&D bench).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-14 19:30:12 +02:00
co-authored by Claude Opus 4.8
parent 4d2280f8ab
commit 71aca5e3d0
+10 -1
View File
@@ -64,7 +64,16 @@ internal static class Program
while (await Tick.WaitForNextTickAsync()) while (await Tick.WaitForNextTickAsync())
{ {
world.Tick(TickRate); try
{
world.Tick(TickRate);
}
catch (Exception ex)
{
// A misaligned/incompatible client packet must not kill the whole server
// (R&D: the client's exact net version isn't matched yet). Log and continue.
Logger.Error(ex, "Tick error (bad packet?) — continuing");
}
} }
} }