diff --git a/client/cryps.css b/client/cryps.css index 8d25d6c1..0fde0862 100644 --- a/client/cryps.css +++ b/client/cryps.css @@ -646,8 +646,12 @@ table td svg { } /* GAME */ -.game-back-btn { - flex: 0 0 20%; +.game-btn { + flex: 0 0 25%; +} + +.game-btn:first-child { + margin-right: 0.5em; } .cryp-skill-btn[disabled] { diff --git a/client/src/components/game.component.jsx b/client/src/components/game.component.jsx index 4e92a2cd..a0dc3d74 100644 --- a/client/src/components/game.component.jsx +++ b/client/src/components/game.component.jsx @@ -34,7 +34,7 @@ function GamePanel(props) {
@@ -57,20 +57,20 @@ function GamePanel(props) { const header = (
+
 
- @@ -169,7 +169,7 @@ function GamePanel(props) { function OpponentTeam(team) { const cryps = team.cryps.map(OpponentCryp); return ( -
+
{cryps}
); @@ -194,9 +194,7 @@ function GamePanel(props) {
{selectedSkills}
-
- {otherTeams.map(OpponentTeam)} -
+ {otherTeams.map(OpponentTeam)}
); } diff --git a/client/src/components/game.container.jsx b/client/src/components/game.container.jsx index 9241ea09..473782f5 100644 --- a/client/src/components/game.container.jsx +++ b/client/src/components/game.container.jsx @@ -62,6 +62,7 @@ const addState = connect( function quit() { dispatch(actions.setGame(null)); + dispatch(actions.setInstance(null)); } function toggleLog(v) { diff --git a/ops/migrations/20181020104420_games.js b/ops/migrations/20181020104420_games.js index ec04e157..b71d6718 100644 --- a/ops/migrations/20181020104420_games.js +++ b/ops/migrations/20181020104420_games.js @@ -22,6 +22,12 @@ exports.up = async knex => { .defaultTo(false) .notNullable() .index(); + + table.boolean('finished') + .defaultTo(false) + .notNullable() + .index(); + }); await knex.schema.createTable('players', table => { diff --git a/server/src/instance.rs b/server/src/instance.rs index 740efb55..febcb520 100644 --- a/server/src/instance.rs +++ b/server/src/instance.rs @@ -295,6 +295,10 @@ impl Instance { self } + fn finished(&self) -> bool { + self.phase == InstancePhase::Finished + } + fn bot_round_actions(&mut self) -> &mut Instance { for bot in self.players.iter_mut().filter(|p| p.bot) { bot.vbox.fill(); @@ -501,13 +505,13 @@ pub fn instance_update(tx: &mut Transaction, instance: Instance) -> Result Result, Erro let query = " SELECT data, id FROM instances - WHERE id != '00000000-0000-0000-0000-000000000000' + WHERE finished = false + AND id != '00000000-0000-0000-0000-000000000000' FOR UPDATE; ";