diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-18 15:42:11 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-18 15:42:11 +0200 |
commit | 5f883c80e7fc63c97910d003c44aea814ab8a5d6 (patch) | |
tree | b73a8c8f78db103671128e686136f08aa276923a /server/src/state.rs | |
parent | efc29c03f7be043ae8d037a93efce8cfa7c384cc (diff) | |
download | hurrycurry-5f883c80e7fc63c97910d003c44aea814ab8a5d6.tar hurrycurry-5f883c80e7fc63c97910d003c44aea814ab8a5d6.tar.bz2 hurrycurry-5f883c80e7fc63c97910d003c44aea814ab8a5d6.tar.zst |
reimplement customers as entity
Diffstat (limited to 'server/src/state.rs')
-rw-r--r-- | server/src/state.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/server/src/state.rs b/server/src/state.rs index 347e2a92..e637b323 100644 --- a/server/src/state.rs +++ b/server/src/state.rs @@ -118,6 +118,15 @@ impl State { _ => (), } self.game.packet_in(player, packet)?; + if self.game.players.is_empty() && !self.game.lobby { + self.tx + .send(PacketC::ServerMessage { + text: "Game was aborted automatically due to a lack of players".to_string(), + }) + .ok(); + self.game + .load(self.index.generate("lobby-none".to_string()).await?, None); + } Ok(vec![]) } |