Merge branch 'release/1.14.1'

This commit is contained in:
ntr 2020-02-10 13:19:51 +10:00
commit edccfbc42b
11 changed files with 25 additions and 15 deletions

View File

@ -1 +1 @@
1.14.0 1.14.1

View File

@ -1,6 +1,6 @@
{ {
"name": "mnml-client", "name": "mnml-client",
"version": "1.14.0", "version": "1.14.1",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -27,7 +27,7 @@ aside {
flex-flow: column;; flex-flow: column;;
} }
grid-template-rows: min-content 3fr 3fr 1fr; grid-template-rows: min-content 1fr 1fr min-content;
grid-gap: 0.5em 0; grid-gap: 0.5em 0;
} }
@ -132,7 +132,7 @@ aside {
.ready { .ready {
flex: 1; flex: 1;
font-size: 200%; font-size: 2.5em;
} }
.quit { .quit {

View File

@ -1,6 +1,6 @@
{ {
"name": "mnml-client", "name": "mnml-client",
"version": "1.14.0", "version": "1.14.1",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -166,9 +166,12 @@ function registerEvents(store) {
function setInvite(code) { function setInvite(code) {
if (!code) return store.dispatch(actions.setInvite(null)); if (!code) return store.dispatch(actions.setInvite(null));
const link = `${document.location.origin}#join=${code}`; const link = `${document.location.origin}#join=${code}`;
navigator.clipboard.writeText(link).then(() => {
notify('Invite link copied to clipboard.'); if (navigator.clipboard) {
}, () => {}); navigator.clipboard.writeText(link).then(() => {
notify('Invite link copied to clipboard.');
}, () => {});
}
return store.dispatch(actions.setInvite(code)); return store.dispatch(actions.setInvite(code));
} }

View File

@ -1,6 +1,6 @@
[package] [package]
name = "mnml_core" name = "mnml_core"
version = "1.14.0" version = "1.14.1"
authors = ["ntr <ntr@smokestack.io>", "mashy <mashy@mnml.gg>"] authors = ["ntr <ntr@smokestack.io>", "mashy <mashy@mnml.gg>"]
[dependencies] [dependencies]

View File

@ -804,7 +804,7 @@ impl Game {
} }
} }
fn finish(mut self) -> Game { pub fn finish(mut self) -> Game {
self.phase = Phase::Finished; self.phase = Phase::Finished;
// self.log.push(format!("Game finished.")); // self.log.push(format!("Game finished."));
@ -835,7 +835,7 @@ impl Game {
return self; return self;
} }
info!("upkeep game: {:} vs {:}", self.players[0].name, self.players[1].name); info!("upkeep {:?} {:} vs {:}", self.id, self.players[0].name, self.players[1].name);
for player in self.players.iter_mut() { for player in self.players.iter_mut() {
if !player.ready { if !player.ready {
@ -2348,7 +2348,7 @@ mod tests {
game.new_resolve(Cast::new(target, player_id, target, Skill::Absorb)); game.new_resolve(Cast::new(target, player_id, target, Skill::Absorb));
assert!(game.construct_by_id(target).unwrap().affected(Effect::Absorb)); assert!(game.construct_by_id(target).unwrap().affected(Effect::Absorb));
game.new_resolve(Cast::new(source, target_player_id, target, Skill::Silence)); game.new_resolve(Cast::new(source, target_player_id, target, Skill::Silence));
assert!(game.construct_by_id(target).unwrap().affected(Effect::Silence)); assert!(game.construct_by_id(target).unwrap().affected(Effect::Silence));
assert!(game.construct_by_id(target).unwrap().affected(Effect::Absorption)); assert!(game.construct_by_id(target).unwrap().affected(Effect::Absorption));

View File

@ -1,6 +1,6 @@
{ {
"name": "mnml-ops", "name": "mnml-ops",
"version": "1.14.0", "version": "1.14.1",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -1,6 +1,6 @@
[package] [package]
name = "mnml" name = "mnml"
version = "1.14.0" version = "1.14.1"
authors = ["ntr <ntr@smokestack.io>"] authors = ["ntr <ntr@smokestack.io>"]
[dependencies] [dependencies]

View File

@ -13,6 +13,7 @@ use pg::{
PgPool, PgPool,
games_need_upkeep, games_need_upkeep,
game_get,
game_update, game_update,
game_write, game_write,
game_delete, game_delete,
@ -157,6 +158,12 @@ fn fetch_instances(mut tx: Transaction) -> Result<Transaction, Error> {
} }
for mut instance in instances_idle(&mut tx)? { for mut instance in instances_idle(&mut tx)? {
if let Some(game_id) = instance.current_game_id() {
let mut game = game_get(&mut tx, game_id)?;
game = game.finish();
game_update(&mut tx, &game)?;
}
instance.finish(); instance.finish();
instance_update(&mut tx, instance)?; instance_update(&mut tx, instance)?;
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "mnml-studios", "name": "mnml-studios",
"version": "1.14.0", "version": "1.14.1",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {