H13: Say which part of the world differs when a soak hash does
When a client's world hash differs from the server's, the soak report now names the part that differs (tide, props, pieces or loot), the client's ClientWorld tick, and each piece whose entry differs on the two sides, so the next transient mismatch can be traced. - NetWorld.world_detail(): part hashes and a piece list. world_hash() is unchanged: the same bytes, hashed in four parts. - The server's world_hash log lines and the soak clients' hash lines carry the detail. A full soak with this (24 clients, 2 matches) compared 3,743 hashes with 0 differing, so the mismatch didn't come back to trace yet. Refs #80 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,8 @@
|
||||
## client whose world has drifted is caught.
|
||||
##
|
||||
## Prints JSON lines:
|
||||
## {"event":"hash", "client", "match", "sim_tick", "hash"}: the client's world hash on
|
||||
## {"event":"hash", "client", "match", "sim_tick", "hash", "detail", "replica_tick"}: the
|
||||
## client's world hash (with NetWorld.world_detail() and its ClientWorld's tick) on
|
||||
## the snapshots where the server logs its own (--world-hash-every on the server, the
|
||||
## same N as --hash-every here), when the client's world has caught up exactly.
|
||||
## {"event":"client_match", "client", "match", ...}: a client's prediction statistics
|
||||
@@ -206,7 +207,7 @@ func _sample(client: Dictionary) -> void:
|
||||
if int(client["number"]) == _tamper and game.playing() and game.world.props.count() > 0:
|
||||
_tamper = -1
|
||||
game.world.props.health[0] -= 1
|
||||
print(JSON.stringify({"event": "hash", "client": client["number"], "match": game.match_index, "sim_tick": tick, "hash": NetWorld.world_hash(game.world)}))
|
||||
print(JSON.stringify({"event": "hash", "client": client["number"], "match": game.match_index, "sim_tick": tick, "hash": NetWorld.world_hash(game.world), "detail": NetWorld.world_detail(game.world), "replica_tick": game.replica.tick}))
|
||||
|
||||
|
||||
func _finish() -> void:
|
||||
|
||||
Reference in New Issue
Block a user