aboutsummaryrefslogtreecommitdiff
path: root/server/src/main.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-06-18 09:57:39 +0200
committermetamuffin <metamuffin@disroot.org>2024-06-23 19:20:50 +0200
commit9bdb81bb34bd6a7e33c47d6fcb3dced1c5bda991 (patch)
treef99e521bf3b199162ed3e4e45536e944fe634489 /server/src/main.rs
parenta99aa006599827ea999a5684e40635175c8d790a (diff)
downloadhurrycurry-9bdb81bb34bd6a7e33c47d6fcb3dced1c5bda991.tar
hurrycurry-9bdb81bb34bd6a7e33c47d6fcb3dced1c5bda991.tar.bz2
hurrycurry-9bdb81bb34bd6a7e33c47d6fcb3dced1c5bda991.tar.zst
can start passive recipes
Diffstat (limited to 'server/src/main.rs')
-rw-r--r--server/src/main.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/src/main.rs b/server/src/main.rs
index 441487e8..d747e737 100644
--- a/server/src/main.rs
+++ b/server/src/main.rs
@@ -36,15 +36,17 @@ async fn main() -> Result<()> {
{
let game = game.clone();
spawn(async move {
+ let dt = 1. / 25.;
loop {
{
let mut g = game.write().await;
+ g.tick(dt);
while let Some(p) = g.packet_out() {
debug!("-> {p:?}");
let _ = tx.send(p);
}
}
- sleep(Duration::from_millis(20)).await;
+ sleep(Duration::from_secs_f32(dt)).await;
}
});
}