message the server when the level has saved

This commit is contained in:
Zoey 2024-04-24 23:30:13 -07:00
parent c3313626be
commit 76b8339048
No known key found for this signature in database
GPG key ID: 8611B896D1AAFAF2

View file

@ -167,6 +167,14 @@ async fn handle_ticks(data: Arc<RwLock<ServerData>>) {
.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());
}
}
}