upgrade spacetimedb to v2.0.1
This commit is contained in:
parent
5ebf3f6c05
commit
baab16144b
38 changed files with 481 additions and 1647 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue