From 06e7b727ee49f9b2db66d28896c412f336a2e897 Mon Sep 17 00:00:00 2001 From: VirxEC Date: Wed, 14 Jun 2023 11:33:46 -0400 Subject: [PATCH] Don't fail upon not being able to launch RLViser --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/socket.rs | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3f02a8..66e587c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -175,7 +175,7 @@ dependencies = [ [[package]] name = "rlviser-py" -version = "0.2.1" +version = "0.2.2" dependencies = [ "glam", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index 68f2eb4..9365d0a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rlviser-py" -version = "0.2.1" +version = "0.2.2" edition = "2021" description = "Python implementation that manages a UDP connection to RLViser" license = "MIT" diff --git a/src/socket.rs b/src/socket.rs index f3f9892..9331c31 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -19,12 +19,14 @@ static SOCKET: RwLock> = RwLock::new(Lazy::new(|| pub fn init() -> io::Result<(UdpSocket, SocketAddr)> { // launch RLViser - Command::new(RLVISER_PATH).spawn()?; + if let Err(e) = Command::new(RLVISER_PATH).spawn() { + println!("Failed to launch RLViser ({RLVISER_PATH}): {e}"); + } // Connect to RLViser let socket = UdpSocket::bind("0.0.0.0:34254")?; - println!("Waiting for RLViser to connect..."); + println!("Waiting for connection to socket..."); let mut buf = [0; 1]; let (_, src) = socket.recv_from(&mut buf)?;