From 58f9321162952e24856726a1d4fa9adc2ae36b9c Mon Sep 17 00:00:00 2001 From: Leo dev Date: Sun, 21 Dec 2025 22:54:12 +0100 Subject: [PATCH] Fixed plugin stop and auth --- src/plugin/mod.rs | 9 +++++---- src/server.rs | 4 +++- src/utils/auth.rs | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/plugin/mod.rs b/src/plugin/mod.rs index 7d5ca0e..07f173d 100644 --- a/src/plugin/mod.rs +++ b/src/plugin/mod.rs @@ -63,9 +63,10 @@ impl Plugin { } } - pub fn stop(&mut self) { - self.send(&LoaderMessage::Shutdown).unwrap(); - self.stream.shutdown(std::net::Shutdown::Both).unwrap(); - self.child.lock().unwrap().kill().unwrap(); + pub fn stop(&mut self) -> crate::Result<()> { + self.send(&LoaderMessage::Shutdown)?; + self.stream.shutdown(std::net::Shutdown::Both)?; + self.child.lock().unwrap().kill()?; + Ok(()) } } diff --git a/src/server.rs b/src/server.rs index ab92f62..49dbcea 100644 --- a/src/server.rs +++ b/src/server.rs @@ -258,7 +258,9 @@ impl Server { // Stop plugins for plugin in self.plugins.lock().unwrap().iter_mut() { - let _ = plugin.stop(); + if let Err(e) = plugin.stop() { + Self::LOGGER.warn(e.context("Couldn't stop plugin")); + } } Self::LOGGER.info("Shutdown complete"); diff --git a/src/utils/auth.rs b/src/utils/auth.rs index 77f89e2..c5894f1 100644 --- a/src/utils/auth.rs +++ b/src/utils/auth.rs @@ -29,7 +29,7 @@ pub fn auth(server: &Arc, client: &mut Client, token: &str) -> crate::Re pub fn test(server: &Arc) -> crate::Result<()> { ureq::get(format!( - "https://vxchat.netlify.app/api/test-auth?key={}&id={}", + "https://vxchat.netlify.app/api/auth-test?key={}&id={}", server.config.server_key, server.config.server_id )) .call()