lazy fix for startup crash

This commit is contained in:
Tao Tien 2026-03-02 14:19:00 -08:00
parent 7ffef5522b
commit bf23dbaf80
2 changed files with 7 additions and 0 deletions

View file

@ -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 = {

View file

@ -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 |_| {