fix(client): address PR #5 review — race condition, buffer corruption, input error
Critical fixes from Hoshe review: 1. Race condition: defer TCP connect to _process() with retry logic (MAX_CONNECT_RETRIES=20, 100ms interval) so server has time to bind. 2. Buffer corruption: disconnect on oversized message instead of clearing valid buffered data (_corrupt flag, fail-safe). 3. Silent input drop: send_input() returns Error so callers can detect encode/validation failures. Warnings addressed: - ServerProcess validates server_path exists before spawning - SIGKILL and health check TODOs documented for future work - Diagonal keybindings documented as intentional deferral - send_message uses single put_data() call (no partial write risk) - Static frame helpers documented as D-030 Layer 2 test-only New tests (36 total, up from 33): - Partial read scenario (chunked TCP delivery) - Multi-message sequential decode (exercises buffer corruption fix) - send_input error return on invalid action Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
extends Node
|
||||
|
||||
# Semantic actions — NO raw key codes cross the bridge
|
||||
# Diagonal directions registered in project.godot with empty event arrays (intentional).
|
||||
# Keybindings deferred until input design is finalized — likely numpad or composite WASD.
|
||||
enum Action {
|
||||
MOVE_NORTH, MOVE_NORTHEAST, MOVE_EAST, MOVE_SOUTHEAST,
|
||||
MOVE_SOUTH, MOVE_SOUTHWEST, MOVE_WEST, MOVE_NORTHWEST,
|
||||
|
||||
Reference in New Issue
Block a user