aboutsummaryrefslogtreecommitdiffstats
path: root/mumd/src/main.rs
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-03-30 11:21:38 +0200
committerGustav Sörnäs <gustav@sornas.net>2021-03-30 15:25:56 +0200
commite1907114374c842654f86b234b816f57dbbc79d4 (patch)
tree92595ffb0be7afcd19c7a2150010374f988b711a /mumd/src/main.rs
parent8c3a37b40260711ef13a6130a612537b64b78215 (diff)
downloadmum-e1907114374c842654f86b234b816f57dbbc79d4.tar.gz
add StateError and AudioError
Diffstat (limited to 'mumd/src/main.rs')
-rw-r--r--mumd/src/main.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/mumd/src/main.rs b/mumd/src/main.rs
index 276e2ce..42be3f8 100644
--- a/mumd/src/main.rs
+++ b/mumd/src/main.rs
@@ -1,10 +1,13 @@
mod audio;
mod client;
mod command;
+mod error;
mod network;
mod notify;
mod state;
+use crate::state::State;
+
use futures_util::{SinkExt, StreamExt};
use log::*;
use mumlib::command::{Command, CommandResponse};
@@ -53,8 +56,16 @@ async fn main() {
let (command_sender, command_receiver) = mpsc::unbounded_channel();
+ let state = match State::new() {
+ Ok(s) => s,
+ Err(e) => {
+ error!("Error instantiating mumd: {}", e);
+ return;
+ }
+ };
+
join!(
- client::handle(command_receiver),
+ client::handle(state, command_receiver),
receive_commands(command_sender),
);
}