diff options
| author | metamuffin <metamuffin@disroot.org> | 2024-06-17 17:39:39 +0200 | 
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2024-06-23 19:20:50 +0200 | 
| commit | 6f0424b9b4cddc0495eb673d314c570e27e61e83 (patch) | |
| tree | 3ca2f5c8f1d16020dfa432d8a93fb1f53be93c4b /server/src/main.rs | |
| parent | 428fa6fb8dac18c541c0c231f1b640ba172e52b9 (diff) | |
| download | hurrycurry-6f0424b9b4cddc0495eb673d314c570e27e61e83.tar hurrycurry-6f0424b9b4cddc0495eb673d314c570e27e61e83.tar.bz2 hurrycurry-6f0424b9b4cddc0495eb673d314c570e27e61e83.tar.zst | |
everything indexed
Diffstat (limited to 'server/src/main.rs')
| -rw-r--r-- | server/src/main.rs | 8 | 
1 files changed, 6 insertions, 2 deletions
| diff --git a/server/src/main.rs b/server/src/main.rs index 7426e27e..441487e8 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -1,7 +1,7 @@  use anyhow::Result;  use futures_util::{SinkExt, StreamExt};  use log::{debug, info, warn}; -use std::{sync::Arc, time::Duration}; +use std::{fs::File, sync::Arc, time::Duration};  use tokio::{      io::{AsyncBufReadExt, AsyncWriteExt, BufReader},      net::TcpListener, @@ -13,6 +13,7 @@ use tokio_tungstenite::tungstenite::Message;  use undercooked::{      game::Game,      protocol::{PacketC, PacketS}, +    recipes::build_gamedata,  };  #[tokio::main] @@ -26,7 +27,10 @@ async fn main() -> Result<()> {      );      info!("listening for websockets on {}", ws_listener.local_addr()?); -    let game = Arc::new(RwLock::new(Game::new())); +    let data = +        build_gamedata(serde_yaml::from_reader(File::open("data/recipes.yaml").unwrap()).unwrap()); + +    let game = Arc::new(RwLock::new(Game::new(data.into())));      let (tx, rx) = broadcast::channel::<PacketC>(1024);      { | 
