This commit is contained in:
Tao Tien 2026-02-22 00:39:51 -08:00
parent d7b4221727
commit 2d3993452b
33 changed files with 920 additions and 143 deletions

View file

@ -15,6 +15,8 @@ pub fn join_or_create_lobby(ctx: &ReducerContext, mut lobby_id: u32) -> Result<(
.ok_or(format!("cannot find player {}", ctx.sender))?;
if lobby_id == 0 {
// TODO check first if player is already in a lobby
let lobby = ctx.db.lobby().insert(Lobby {
id: 0,
players: vec![PlayerOrBot::Player { id: player.id }],