From 76b8339048da0792b9242b0803f6c93d29a39532 Mon Sep 17 00:00:00 2001 From: Zoey Date: Wed, 24 Apr 2024 23:30:13 -0700 Subject: [PATCH] message the server when the level has saved --- src/server.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/server.rs b/src/server.rs index 70b3193..968941d 100644 --- a/src/server.rs +++ b/src/server.rs @@ -167,6 +167,14 @@ async fn handle_ticks(data: Arc>) { .await .expect("failed to autosave level"); last_auto_save = std::time::Instant::now(); + + let packet = ServerPacket::Message { + player_id: -1, + message: "Server has saved!".to_string(), + }; + for player in &mut data.players { + player.packets_to_send.push(packet.clone()); + } } }