(bug) player now also advances game, but can double discard
This commit is contained in:
parent
e8dd782f59
commit
5ebf3f6c05
4 changed files with 12 additions and 6 deletions
|
|
@ -19,9 +19,9 @@ pub fn advance_game(ctx: &ReducerContext, mut game_timer: GameTimer) -> Result<(
|
|||
// checks every second (or more? when users make moves) on whether to advance the game's various states
|
||||
// TODO this, or allow player/debug to call this?
|
||||
|
||||
if !ctx.sender_auth().is_internal() {
|
||||
return Err("This reducer can only be called by the scheduler".to_string());
|
||||
}
|
||||
// if !ctx.sender_auth().is_internal() {
|
||||
// return Err("This reducer can only be called by the scheduler".to_string());
|
||||
// }
|
||||
|
||||
if let Some(mut lobby) = ctx.db.lobby().id().find(game_timer.lobby_id) {
|
||||
trace!("running schedule for lobby {}", lobby.id);
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ pub struct Bot {
|
|||
pub working_tile: Option<DbTile>,
|
||||
}
|
||||
|
||||
#[table(name = game_timer, scheduled(advance_game))]
|
||||
#[table(name = game_timer, scheduled(advance_game), public)]
|
||||
pub struct GameTimer {
|
||||
#[primary_key]
|
||||
#[auto_inc]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue