feat: enhance connection handling in sdxr_start with error logging

This commit is contained in:
MayaTheShy
2025-11-08 14:54:47 -05:00
parent 4b6ce06fc5
commit 53e2cc5fbc

View File

@@ -168,7 +168,16 @@ pub extern "C" fn sdxr_start(app_id: *const std::os::raw::c_char) -> i32 {
// Run the client - asteroids will manage the projector and call reify() each frame
// This blocks until the client disconnects or is shut down
ast::client::run::<BridgeState>(&[]).await;
match stardust_xr_fusion::client::Client::connect().await {
Ok(client) => {
println!("[bridge] Connected to Stardust server successfully");
// Now try to run the full asteroids client
ast::client::run::<BridgeState>(&[]).await;
},
Err(e) => {
println!("[bridge] Failed to connect to Stardust server: {:?}", e);
}
}
println!("[bridge] Client disconnected");
let _ = cmd_task;