feat(client): enforce PROTOCOL_VERSION check in snapshot decode

Client now rejects snapshots where version != PROTOCOL_VERSION (4).
Returns null with error log on mismatch. Test snapshot updated to
use Protocol.PROTOCOL_VERSION and v4 game_time format (tick_rate
replaces paused field).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-12 23:32:49 +01:00
co-authored by Claude Opus 4.6
parent 18d8253bfe
commit c05ff7b063
2 changed files with 13 additions and 4 deletions
+2 -2
View File
@@ -296,12 +296,12 @@ func _test_snapshot() -> Dictionary:
return {
"tick": _test_tick,
"version": 2,
"version": Protocol.PROTOCOL_VERSION,
"game_time": {
"day": 0,
"time_of_day": _test_tick * 10,
"day_phase": "Morning",
"paused": false,
"tick_rate": "Full",
},
"player_facing": _test_facing,
"entities": entities,