style(client): gdformat all 52 GDScript files — zero format warnings
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -86,15 +86,23 @@ func _try_extract_message() -> PackedByteArray:
|
||||
if _pending_length < 0:
|
||||
if _read_buffer.size() < 4:
|
||||
return PackedByteArray()
|
||||
_pending_length = (_read_buffer[0] << 24) | (_read_buffer[1] << 16) | \
|
||||
(_read_buffer[2] << 8) | _read_buffer[3]
|
||||
_pending_length = (
|
||||
(_read_buffer[0] << 24)
|
||||
| (_read_buffer[1] << 16)
|
||||
| (_read_buffer[2] << 8)
|
||||
| _read_buffer[3]
|
||||
)
|
||||
_read_buffer = _read_buffer.slice(4)
|
||||
|
||||
if _pending_length > MAX_MESSAGE_SIZE:
|
||||
# Stream is corrupt — we can't find the next valid frame boundary.
|
||||
# Disconnect rather than silently discarding valid buffered data.
|
||||
push_error(
|
||||
"LocalBridge: incoming message too large: %d bytes (max %d) — disconnecting" % [_pending_length, MAX_MESSAGE_SIZE])
|
||||
(
|
||||
"LocalBridge: incoming message too large: %d bytes (max %d) — disconnecting"
|
||||
% [_pending_length, MAX_MESSAGE_SIZE]
|
||||
)
|
||||
)
|
||||
_corrupt = true
|
||||
_pending_length = -1
|
||||
_read_buffer.clear()
|
||||
@@ -129,6 +137,7 @@ func reset() -> void:
|
||||
# These exist for unit tests that verify framing logic without a live TCP
|
||||
# connection. Not used in production code paths.
|
||||
|
||||
|
||||
## Encode a payload into a framed byte array: [4-byte BE length][payload].
|
||||
static func frame_encode(payload: PackedByteArray) -> PackedByteArray:
|
||||
var len := payload.size()
|
||||
|
||||
Reference in New Issue
Block a user