(stash) render other players

This commit is contained in:
Tao Tien 2026-02-24 00:56:34 -08:00
parent 33cb9c7f97
commit cc07cc89c6
10 changed files with 249 additions and 14 deletions

View file

@ -47,9 +47,12 @@ pub fn discard_tile(ctx: &ReducerContext, tile_id: u32) -> Result<(), String> {
hand.pond.push(dealt_tile);
hand.working_tile = None;
hand.turn_state = TurnState::None;
ctx.db.player_hand().id().update(hand);
let mut clock = ctx.db.player_clock().player_id().find(player.id).unwrap();
clock.renew();
ctx.db.player_clock().player_id().update(clock);
let mut lobby = ctx.db.lobby().id().find(player.lobby_id).unwrap();
lobby.next_player();
ctx.db.lobby().id().update(lobby);

View file

@ -3,6 +3,8 @@ use std::time::Duration;
use log::info;
use spacetimedb::{ReducerContext, Table, rand::seq::SliceRandom, reducer};
use jong_types::PlayerOrBot;
use crate::tables::*;
#[reducer]