aboutsummaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-07 17:47:49 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-07 17:47:49 +0200
commit5d3fd99128ea38e0030c4635ed43f52fd8ae621b (patch)
tree2f4e2f3a6e0d2c5f42861cb40866314e4a1d15fb /server/src
parentb177459b5a8dd8136bc39435f7af29d7f700f1db (diff)
downloadhurrycurry-5d3fd99128ea38e0030c4635ed43f52fd8ae621b.tar
hurrycurry-5d3fd99128ea38e0030c4635ed43f52fd8ae621b.tar.bz2
hurrycurry-5d3fd99128ea38e0030c4635ed43f52fd8ae621b.tar.zst
send if map is lobby
Diffstat (limited to 'server/src')
-rw-r--r--server/src/game.rs11
-rw-r--r--server/src/protocol.rs1
2 files changed, 9 insertions, 3 deletions
diff --git a/server/src/game.rs b/server/src/game.rs
index d8184c1e..7609b965 100644
--- a/server/src/game.rs
+++ b/server/src/game.rs
@@ -88,8 +88,10 @@ impl Game {
}
fn unload(&mut self) {
- self.packet_out
- .push_back(PacketC::SetIngame { state: false });
+ self.packet_out.push_back(PacketC::SetIngame {
+ state: false,
+ lobby: false,
+ });
for (id, _) in self.players.drain() {
self.packet_out.push_back(PacketC::RemovePlayer { id })
}
@@ -209,7 +211,10 @@ impl Game {
}
}
out.push(self.score());
- out.push(PacketC::SetIngame { state: true });
+ out.push(PacketC::SetIngame {
+ state: true,
+ lobby: self.demand.is_none(),
+ });
out
}
diff --git a/server/src/protocol.rs b/server/src/protocol.rs
index facfa5ab..49171942 100644
--- a/server/src/protocol.rs
+++ b/server/src/protocol.rs
@@ -139,6 +139,7 @@ pub enum PacketC {
},
SetIngame {
state: bool,
+ lobby: bool,
},
Error {
message: String,