fix(game-server): don't crash on malformed bunch channel index
Build Game Server / build (push) Successful in 16s
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:
@@ -666,7 +666,10 @@ public abstract class UNetConnection : UPlayer
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user