diff --git a/sfsmcd/Cargo.toml b/sfsmcd/Cargo.toml index 3cf6c86..4770f0b 100644 --- a/sfsmcd/Cargo.toml +++ b/sfsmcd/Cargo.toml @@ -12,6 +12,5 @@ tokio = { version = "0.2", features = ["full"] } async-minecraft-ping = "0.2" dbus = { version = "0.8", features = ["futures"] } dbus-tokio = "0.5" -dbus-crossroads = "0.2" log = "0.4" env_logger = "0.7" \ No newline at end of file diff --git a/sfsmcd/src/main.rs b/sfsmcd/src/main.rs index 744e1f6..1f73c6c 100644 --- a/sfsmcd/src/main.rs +++ b/sfsmcd/src/main.rs @@ -1,5 +1,4 @@ use log::{ debug, info, warn, error }; -use dbus_crossroads::Crossroads; use dbus::{ message::MatchRule, channel::MatchingReceiver @@ -18,12 +17,6 @@ async fn main() -> Result<(), Box> { debug!("PID: {}, User: {}", std::process::id(), std::env::var("USER").unwrap_or("N/A".into())); - // New Crossroads instance - let mut cr = Crossroads::new(); - - // Insert object paths - cr.insert("/", &[], ()); - // Connect with D-Bus let (resource, c) = dbus_tokio::connection::new_system_sync()?; debug!("D-Bus unique name: {}", c.unique_name()); @@ -34,9 +27,6 @@ async fn main() -> Result<(), Box> { panic!("Lost connection to D-Bus: {}", err); }); - // Allow methods to be async - cr.set_async_support(Some((c.clone(), Box::new(|x| { tokio::spawn(x); })))); - // Aquire name on D-Bus match c.request_name(DBUS_NAME, false, true, false).await { Ok(_) => info!("Listening (D-Bus) on {}", DBUS_NAME), @@ -48,8 +38,6 @@ async fn main() -> Result<(), Box> { // Receive method calls c.start_receive(MatchRule::new_method_call(), Box::new(move |msg, conn| { - cr.handle_message(msg, conn).unwrap_or_else(|_| warn!("Incoming message wasn't a method call")); - // Return bool whether message should be handled only once (false) or another time (true) true }));