diff --git a/devenv.nix b/devenv.nix index 2848ba6..782205c 100644 --- a/devenv.nix +++ b/devenv.nix @@ -45,6 +45,7 @@ ]; env.LD_LIBRARY_PATH = lib.makeLibraryPath packages; env.RUST_LOG = "jong=trace"; + env.RUST_BACKTRACE = "full"; # https://devenv.sh/languages/ languages.rust = { diff --git a/jong/src/riichi.rs b/jong/src/riichi.rs index d7a817e..14a6e0d 100644 --- a/jong/src/riichi.rs +++ b/jong/src/riichi.rs @@ -1,3 +1,5 @@ +use std::time::Duration; + use bevy::prelude::*; use bevy_spacetimedb::{ReadInsertMessage, ReadInsertUpdateMessage, ReadUpdateMessage, StdbPlugin}; @@ -74,6 +76,10 @@ impl Plugin for Riichi { /// spawn all hands and ponds fn subscriptions(stdb: SpacetimeDB, mut commands: Commands) { + while stdb.try_identity().is_none() { + bevy::platform::thread::sleep(Duration::from_secs(1)); + } + let (tx, rx) = std::sync::mpsc::channel(); stdb.subscription_builder() .on_applied(move |_| {