diff options
author | metamuffin <metamuffin@disroot.org> | 2025-09-29 22:52:26 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-09-29 22:53:12 +0200 |
commit | 66d60ed9ab61efc176808b17fc26445dbf5be705 (patch) | |
tree | 7774a7625948659c037514e0848ddd3c292fcc54 /server/src/server.rs | |
parent | c1e826625f3ca3116d482b27e2f0b230cbd55346 (diff) | |
download | hurrycurry-66d60ed9ab61efc176808b17fc26445dbf5be705.tar hurrycurry-66d60ed9ab61efc176808b17fc26445dbf5be705.tar.bz2 hurrycurry-66d60ed9ab61efc176808b17fc26445dbf5be705.tar.zst |
Implement ready packet + Refactor server pausing
Diffstat (limited to 'server/src/server.rs')
-rw-r--r-- | server/src/server.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/server.rs b/server/src/server.rs index a1a849c4..22ad5d23 100644 --- a/server/src/server.rs +++ b/server/src/server.rs @@ -51,7 +51,7 @@ pub struct Server { pub tx: Sender<PacketC>, pub connections: HashMap<ConnectionID, ConnectionData>, pub paused: bool, - pub start_pause_timer: f32, + pub announce_timer: f32, pub game: Game, @@ -326,7 +326,7 @@ impl Server { game: Game::default(), index: DataIndex::load().context("Failed to load data index")?, tx, - start_pause_timer: 0., + announce_timer: 0., packet_out: VecDeque::new(), connections: HashMap::new(), data: Serverdata::default().into(), @@ -385,6 +385,8 @@ impl Server { dt: 0., }); } + self.connections.values_mut().for_each(|c| c.ready = false); + self.update_paused(); } pub fn packet_in( |