diff options
-rw-r--r-- | server/protocol/src/lib.rs | 3 | ||||
-rw-r--r-- | server/src/state.rs | 2 | ||||
-rw-r--r-- | test-client/protocol.ts | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/server/protocol/src/lib.rs b/server/protocol/src/lib.rs index 7c815254..4f0d5d67 100644 --- a/server/protocol/src/lib.rs +++ b/server/protocol/src/lib.rs @@ -231,6 +231,9 @@ pub enum PacketC { dir: Vec2, boost: bool, }, + Pause { + state: bool, + }, MoveItem { from: ItemLocation, to: ItemLocation, diff --git a/server/src/state.rs b/server/src/state.rs index 53ca3b42..a509a3bd 100644 --- a/server/src/state.rs +++ b/server/src/state.rs @@ -27,6 +27,8 @@ impl Server { info!("Game paused: {}", should_pause); self.paused = should_pause; for p in self.game.players.keys() { + self.packet_out + .push_back(PacketC::Pause { state: self.paused }); self.packet_out.push_back(PacketC::ServerHint { position: None, message: if self.paused { diff --git a/test-client/protocol.ts b/test-client/protocol.ts index d1cd9c07..6a1d2909 100644 --- a/test-client/protocol.ts +++ b/test-client/protocol.ts @@ -69,6 +69,7 @@ export type PacketC = | { type: "environment", effects: string[] } | { type: "tutorial_ended", item: ItemIndex, player: PlayerID, success: boolean } | { type: "set_ingame", state: boolean, lobby: boolean } // Set to false when entering the game or switching maps + | { type: "pause", state: boolean } // Set game paused so clients dont increment timers export type Menu = { menu: "document", data: DocumentElement } |