Skip to content

Commit

Permalink
chore: Serialize tree as pretty json
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxCWhitehead committed Nov 7, 2024
1 parent b864466 commit 8ab4485
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ fxhash = "0.2"
hashbrown = "0.14"
maybe-owned = "0.3"
parking_lot = "0.12"
serde_json = "1"
smallvec = "1.11"
ustr = "0.10"
iroh-net = "0.27"
Expand Down
2 changes: 1 addition & 1 deletion framework_crates/bones_asset/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ paste = "1.0"
path-absolutize = { version = "3.1", features = ["use_unix_paths_on_wasm"] }
semver = { version = "1.0", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_json = { workspace = true }
serde_yaml = "0.9"
sha2 = "0.10"
tracing = "0.1"
Expand Down
3 changes: 2 additions & 1 deletion framework_crates/bones_framework/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ scripting = ["dep:bones_scripting"]
net-debug = ["ui"]

## Enables advanced desync debugging, generates hash tree of world for frames
desync-debug = []
desync-debug = ["dep:serde_json"]

#! ### Audio formats
#! These features enable different audio formats
Expand Down Expand Up @@ -161,6 +161,7 @@ iroh-quinn = { version = "0.11" }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
turborand = { version = "0.10.0", features = ["atomic"] }
iroh-net = { workspace = true, features = ["discovery-local-network"] }
serde_json = { workspace = true, optional = true }

directories = "5.0"

Expand Down
2 changes: 1 addition & 1 deletion framework_crates/bones_framework/src/networking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ where
if let Some(desync_hash_tree) =
desync_debug_history.get_frame_data(frame as u32)
{
let string = serde_yaml::to_string(desync_hash_tree)
let string = serde_json::to_string_pretty(desync_hash_tree)
.expect("Failed to serialize desync hash tree");
error!("Desync hash tree: frame: {frame}\n{}", string);
}
Expand Down

0 comments on commit 8ab4485

Please sign in to comment.