Fixed plugin stop and auth

This commit is contained in:
2025-12-21 22:54:12 +01:00
parent 0833537e5e
commit 58f9321162
3 changed files with 9 additions and 6 deletions
+5 -4
View File
@@ -63,9 +63,10 @@ impl Plugin {
} }
} }
pub fn stop(&mut self) { pub fn stop(&mut self) -> crate::Result<()> {
self.send(&LoaderMessage::Shutdown).unwrap(); self.send(&LoaderMessage::Shutdown)?;
self.stream.shutdown(std::net::Shutdown::Both).unwrap(); self.stream.shutdown(std::net::Shutdown::Both)?;
self.child.lock().unwrap().kill().unwrap(); self.child.lock().unwrap().kill()?;
Ok(())
} }
} }
+3 -1
View File
@@ -258,7 +258,9 @@ impl Server {
// Stop plugins // Stop plugins
for plugin in self.plugins.lock().unwrap().iter_mut() { 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"); Self::LOGGER.info("Shutdown complete");
+1 -1
View File
@@ -29,7 +29,7 @@ pub fn auth(server: &Arc<Server>, client: &mut Client, token: &str) -> crate::Re
pub fn test(server: &Arc<Server>) -> crate::Result<()> { pub fn test(server: &Arc<Server>) -> crate::Result<()> {
ureq::get(format!( 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 server.config.server_key, server.config.server_id
)) ))
.call() .call()