finish logs
This commit is contained in:
parent
574f260a30
commit
c921e790c9
11
WORKLOG.md
11
WORKLOG.md
@ -33,25 +33,14 @@
|
||||
## NOW
|
||||
|
||||
*CLIENT*
|
||||
* fix mobile menu
|
||||
* make fullscreen
|
||||
* disappear on touch
|
||||
* find cause of lag
|
||||
|
||||
|
||||
*SERVER*
|
||||
* std game mode
|
||||
* time control
|
||||
* animation delay phase end
|
||||
|
||||
* eth adapter
|
||||
* pay for rerolls
|
||||
|
||||
* warden
|
||||
* set upkeep_at timestamp for games and instances
|
||||
|
||||
* log game results for analysis
|
||||
|
||||
## SOON
|
||||
|
||||
* push events
|
||||
|
||||
@ -805,11 +805,10 @@ pub fn game_update(tx: &mut Transaction, game: &Game) -> Result<(), Error> {
|
||||
result.iter().next().ok_or(format_err!("game {:?} could not be written", game))?;
|
||||
|
||||
if game.finished() {
|
||||
info!("game finished state={:?}", game);
|
||||
|
||||
if let Some(i) = game.instance {
|
||||
match i == Uuid::nil() {
|
||||
true => global_game_finished(tx, &game)?,
|
||||
false => instance_game_finished(tx, &game, i)?,
|
||||
}
|
||||
instance_game_finished(tx, &game, i)?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -312,7 +312,8 @@ impl Instance {
|
||||
fn finish_condition(&self) -> bool {
|
||||
match self.format {
|
||||
// bo5 standard
|
||||
Format::Standard => self.players.iter().any(|p| p.score.wins > 2),
|
||||
// OR condition is for forfeitures
|
||||
Format::Standard => self.players.iter().any(|p| p.score.wins > 2) || self.rounds.len() == 5,
|
||||
|
||||
// everybody plays each other once
|
||||
Format::RoundRobin => self.rounds.len() == self.players.len() - 1,
|
||||
@ -546,6 +547,10 @@ pub fn instance_update(tx: &mut Transaction, instance: Instance) -> Result<Insta
|
||||
|
||||
// info!("{:?} wrote instance", instance.id);
|
||||
|
||||
if instance.finished() {
|
||||
info!("instance finished state={:?}", instance);
|
||||
}
|
||||
|
||||
return Ok(instance);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user