fix(game-server): don't crash on malformed bunch channel index
Build Game Server / build (push) Successful in 16s

Log + drop the packet (with net version) instead of throwing, so a
bit-alignment/version mismatch with the client doesn't kill the server.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-14 19:26:53 +02:00
co-authored by Claude Opus 4.8
parent 1caa46f846
commit 4d2280f8ab
+4 -1
View File
@@ -666,7 +666,10 @@ public abstract class UNetConnection : UPlayer
if (bunch.ChIndex >= MaxChannelSize) if (bunch.ChIndex >= MaxChannelSize)
{ {
throw new Exception("Bunch channel index exceeds channel limit"); // Don't crash the whole server on a malformed/misaligned bunch (e.g. a
// version/bit-alignment mismatch with the client). Log and drop the packet.
Logger.Error("[HS-SEQ] Bunch channel index {Idx} exceeds limit {Max} (netVer={Ver}) — dropping packet", bunch.ChIndex, MaxChannelSize, (int)bunch.EngineNetVer());
return;
} }
} }