upgrade spacetimedb to v2.0.1

This commit is contained in:
Tao Tien 2026-02-25 15:22:10 -08:00
parent 5ebf3f6c05
commit baab16144b
38 changed files with 481 additions and 1647 deletions

View file

@ -13,8 +13,8 @@ pub fn join_or_create_lobby(ctx: &ReducerContext, mut lobby_id: u32) -> Result<(
.db
.player()
.identity()
.find(ctx.sender)
.ok_or(format!("cannot find player {}", ctx.sender))?;
.find(ctx.sender())
.ok_or(format!("cannot find player {}", ctx.sender()))?;
if lobby_id == 0 && player.lobby_id == 0 {
// TODO check first if player is already in a lobby
@ -74,7 +74,7 @@ pub fn add_bot(ctx: &ReducerContext, lobby_id: u32) -> Result<(), String> {
#[reducer]
pub fn set_ready(ctx: &ReducerContext, ready: bool) -> Result<(), String> {
let mut player = ctx.db.player().identity().find(ctx.sender).unwrap();
let mut player = ctx.db.player().identity().find(ctx.sender()).unwrap();
player.ready = ready;
player = ctx.db.player().identity().update(player);