fix(client): address PR #7 review — ephemeral port, input drop docs
Hoshe #1: E2E test now uses random ephemeral port (49152-65535) with port rotation on bind failure, avoiding conflicts in parallel CI. Hoshe #2: Documented intentional input drop on encode failure in SimBridge — re-queuing would retry bad data and server tick has already advanced. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -130,7 +130,10 @@ func _process(delta: float) -> void:
|
||||
while msg.size() > 0:
|
||||
receive_bytes(msg)
|
||||
msg = _bridge.poll_message()
|
||||
# Send: batch-encode and flush outbound buffer as one frame (Vec<PlayerInput>)
|
||||
# Send: batch-encode and flush outbound buffer as one frame (Vec<PlayerInput>).
|
||||
# Inputs are drained before encoding. On encode failure the inputs are
|
||||
# intentionally dropped — re-queuing would retry the same bad data and
|
||||
# the server tick has already advanced, making stale inputs invalid.
|
||||
var outbound := drain_outbound()
|
||||
if outbound.size() > 0:
|
||||
var encoded := Protocol.encode_player_inputs(outbound)
|
||||
@@ -139,7 +142,7 @@ func _process(delta: float) -> void:
|
||||
if err != OK:
|
||||
push_error("SimBridge: failed to send message: %s" % error_string(err))
|
||||
else:
|
||||
push_error("SimBridge: failed to batch-encode %d inputs" % outbound.size())
|
||||
push_error("SimBridge: failed to batch-encode %d inputs (dropped)" % outbound.size())
|
||||
StreamPeerTCP.STATUS_CONNECTING:
|
||||
pass # Should not happen in CONNECTED state
|
||||
StreamPeerTCP.STATUS_ERROR:
|
||||
|
||||
Reference in New Issue
Block a user