diff --git a/VERSION b/VERSION index 32bd932f..6f165bc1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.12.0 \ No newline at end of file +1.12.1 \ No newline at end of file diff --git a/WORKLOG.md b/WORKLOG.md index 5f20d1d1..f504676b 100644 --- a/WORKLOG.md +++ b/WORKLOG.md @@ -3,6 +3,7 @@ _ntr_ * can't reset password without knowing password =\ +* hard reload client on version change * audio * animation effects diff --git a/acp/package.json b/acp/package.json index 0e92cddc..c375cc2f 100644 --- a/acp/package.json +++ b/acp/package.json @@ -1,6 +1,6 @@ { "name": "mnml-client", - "version": "1.12.0", + "version": "1.12.1", "description": "", "main": "index.js", "scripts": { diff --git a/client/assets/styles/styles.mobile.less b/client/assets/styles/styles.mobile.less index e713faab..4808b46b 100644 --- a/client/assets/styles/styles.mobile.less +++ b/client/assets/styles/styles.mobile.less @@ -48,6 +48,10 @@ } + .team { + grid-gap: 1em; + } + .team, #targeting, .resolving-skill { width: calc(90% - 3em); } @@ -92,7 +96,7 @@ } .player { - width: calc(90%); + width: calc(90% - 1.5em); .game-construct { grid-template-areas: "left" @@ -110,11 +114,11 @@ } .resolving-skill { - width: calc(90%); + width: calc(90% - 1.5em); } .opponent { - width: calc(90%); + width: calc(90% - 1.5em); .game-construct { grid-template-rows: 2fr min-content; grid-template-rows: 1fr; @@ -160,9 +164,9 @@ } aside { - font-size: 75%; button { margin-bottom: 0.5em; + z-index: 50; } } } diff --git a/client/package.json b/client/package.json index f3b08026..b6ace460 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "mnml-client", - "version": "1.12.0", + "version": "1.12.1", "description": "", "main": "index.js", "scripts": { diff --git a/client/src/actions.jsx b/client/src/actions.jsx index a49d8278..6f106cd9 100644 --- a/client/src/actions.jsx +++ b/client/src/actions.jsx @@ -45,7 +45,6 @@ export const setTeamPage = value => ({ type: 'SET_TEAM_PAGE', value }); export const setTeamSelect = value => ({ type: 'SET_TEAM_SELECT', value: Array.from(value) }); export const setTutorial = value => ({ type: 'SET_TUTORIAL', value }); -export const setTutorialGame = value => ({ type: 'SET_TUTORIAL_GAME', value }); export const setVboxSelected = value => ({ type: 'SET_VBOX_SELECTED', value: value }); export const setVboxCombiner = value => ({ type: 'SET_VBOX_COMBINER', value }); diff --git a/client/src/components/front.page.jsx b/client/src/components/front.page.jsx index defc62e1..44c0d442 100644 --- a/client/src/components/front.page.jsx +++ b/client/src/components/front.page.jsx @@ -50,12 +50,11 @@ function Play(args) { ); const list = () => { - if (promptRegister) { return (

You just won your first round of MNML.

-

Register below to play a real Bo5 against other players, play a practice round, customise your team & more...

+

Register below to play a real Bo5 against other players,
play a practice round against a tougher AI opponent,
customise your team & more...

glhf

) diff --git a/client/src/components/game.construct.skill.btn.jsx b/client/src/components/game.construct.skill.btn.jsx index db0ac3ed..cedf7c33 100644 --- a/client/src/components/game.construct.skill.btn.jsx +++ b/client/src/components/game.construct.skill.btn.jsx @@ -64,12 +64,9 @@ function Skill(props) { ); } - // const skillChosen = game.stack.some(stack => stack.source_construct_id === construct.id); - const targeting = game.stack.some(stack => stack.source_construct_id === construct.id && stack.skill === s.skill); + // const skillChosen = game.stack.some(stack => stack.source === construct.id); + const targeting = game.stack.some(stack => stack.source === construct.id && stack.skill === s.skill); - // if (skillChosen && !targeting) { - // return false; - // } const cdText = construct.skills[i].cd > 0 ? `${s.cd}T` : ''; diff --git a/client/src/components/targeting.arrows.jsx b/client/src/components/targeting.arrows.jsx index 384dd1d6..2d570121 100644 --- a/client/src/components/targeting.arrows.jsx +++ b/client/src/components/targeting.arrows.jsx @@ -9,8 +9,8 @@ const shapes = require('./shapes'); const { effectInfo } = require('../utils'); const addState = connect( - ({ game, account, animating, itemInfo, gameEffectInfo, tutorialGame }) => - ({ game, account, animating, itemInfo, gameEffectInfo, tutorialGame }) + ({ game, account, animating, itemInfo, gameEffectInfo, authenticated }) => + ({ game, account, animating, itemInfo, gameEffectInfo, authenticated }) ); class TargetSvg extends Component { @@ -32,7 +32,6 @@ class TargetSvg extends Component { if (newProps.account !== this.props.account) return true; if (newProps.animating !== this.props.animating) return true; if (newProps.gameEffectInfo !== this.props.gameEffectInfo) return true; - if (newProps.tutorialGame !== this.props.tutorialGame) return true; if (newState.width !== this.state.width) return true; if (newState.height !== this.state.height) return true; return false; @@ -45,7 +44,7 @@ class TargetSvg extends Component { animating, game, gameEffectInfo, - tutorialGame, + authenticated, } = props; const { width, height } = state; @@ -53,10 +52,10 @@ class TargetSvg extends Component { if (game.phase === 'Finished') return false; // Clear everything if its over (in case of abandon) // First time joining game phase - if (tutorialGame) { + if (!authenticated && game.stack.length === 0) { return (
-

Select your skills, click on targets and then hit READY.

+

Select a skill from each construct, click a target for that skill and then click READY.

); } diff --git a/client/src/components/welcome.login.jsx b/client/src/components/welcome.login.jsx index aa65f20d..ee5ecc64 100644 --- a/client/src/components/welcome.login.jsx +++ b/client/src/components/welcome.login.jsx @@ -51,10 +51,11 @@ function Login(args) { @@ -63,6 +64,7 @@ function Login(args) { type="password" placeholder="password" tabIndex={2} + autocomplete="current-password" value={password} onInput={linkState(this, 'password')} /> diff --git a/client/src/events.jsx b/client/src/events.jsx index a0e6a307..48028205 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -30,10 +30,6 @@ function registerEvents(store) { } - function clearTutorialGame() { - store.dispatch(actions.setTutorialGame(null)); - } - function setPing(ping) { store.dispatch(actions.setPing(ping)); } @@ -231,7 +227,6 @@ function registerEvents(store) { clearInstance, clearMtxActive, clearTutorial, - clearTutorialGame, setAccount, setAuthenticated, setAccountInstances, diff --git a/client/src/reducers.jsx b/client/src/reducers.jsx index c30dec0a..6330f0eb 100644 --- a/client/src/reducers.jsx +++ b/client/src/reducers.jsx @@ -54,7 +54,6 @@ module.exports = { teamSelect: createReducer([null, null, null], 'SET_TEAM_SELECT'), tutorial: createReducer(1, 'SET_TUTORIAL'), - tutorialGame: createReducer(1, 'SET_TUTORIAL_GAME'), vboxSelected: createReducer({ storeSelect: [], stashSelect: [] }, 'SET_VBOX_SELECTED'), vboxCombiner: createReducer(null, 'SET_VBOX_COMBINER'), diff --git a/client/src/socket.jsx b/client/src/socket.jsx index a7e2916c..f72541b2 100644 --- a/client/src/socket.jsx +++ b/client/src/socket.jsx @@ -12,7 +12,7 @@ function errorToast(err) { return toast.error({ title: 'BEEP BOOP', message: err, - position: 'topRight', + position: 'bottomLeft', }); } @@ -129,7 +129,6 @@ function createSocket(events) { { game_id: gameId, construct_id: constructId, target_construct_id: targetConstructId, skill }, ]); events.setActiveSkill(null); - events.clearTutorialGame(); } function sendGameSkillClear(gameId) { @@ -342,7 +341,7 @@ function createSocket(events) { function onOpen() { toast.info({ message: 'connected', - position: 'topRight', + position: 'bottomLeft', }); sendPing(); @@ -361,7 +360,7 @@ function createSocket(events) { console.error('WebSocket closed', event); toast.warning({ message: 'disconnected', - position: 'topRight', + position: 'bottomLeft', }); return setTimeout(connect, 5000); } diff --git a/client/src/utils.jsx b/client/src/utils.jsx index b2c715fb..0ca4d727 100644 --- a/client/src/utils.jsx +++ b/client/src/utils.jsx @@ -208,7 +208,7 @@ function postData(url = '/', data = {}) { function errorToast(message) { toast.error({ - position: 'topRight', + position: 'bottomLeft', drag: false, close: false, message, @@ -217,7 +217,7 @@ function errorToast(message) { function infoToast(message) { toast.info({ - position: 'topRight', + position: 'bottomLeft', drag: false, close: false, message, diff --git a/core/Cargo.toml b/core/Cargo.toml index 4edb5c25..febac315 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mnml_core" -version = "1.12.0" +version = "1.12.1" authors = ["ntr ", "mashy "] [dependencies] diff --git a/ops/package.json b/ops/package.json index 3b993c63..01e81dc9 100644 --- a/ops/package.json +++ b/ops/package.json @@ -1,6 +1,6 @@ { "name": "mnml-ops", - "version": "1.12.0", + "version": "1.12.1", "description": "", "main": "index.js", "scripts": { diff --git a/server/Cargo.toml b/server/Cargo.toml index 9f7e199a..a89622ea 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mnml" -version = "1.12.0" +version = "1.12.1" authors = ["ntr "] [dependencies] diff --git a/server/src/rpc.rs b/server/src/rpc.rs index 9ffe3bdc..2eca2452 100644 --- a/server/src/rpc.rs +++ b/server/src/rpc.rs @@ -141,24 +141,6 @@ struct Connection { events: CbSender, } -impl Connection { - // this is where last minute processing happens - // use it to modify outgoing messages, update subs, serialize in some way... - fn send(&self, msg: RpcMessage) -> Result<(), Error> { - let msg = match msg { - RpcMessage::InstanceState(v) => RpcMessage::InstanceState(v.redact(self.id)), - RpcMessage::AccountInstances(v) => - RpcMessage::AccountInstances(v.into_iter().map(|i| i.redact(self.id)).collect()), - RpcMessage::GameState(v) => RpcMessage::GameState(v.redact(self.id)), - _ => msg, - }; - - self.ws.send(msg).unwrap(); - - Ok(()) - } -} - // we unwrap everything in here cause really // we don't care if this panics // it's run in a thread so it's supposed to bail @@ -178,7 +160,7 @@ impl Handler for Connection { }, Err(e) => { warn!("{:?}", e); - self.send(RpcMessage::Error(e.to_string())).unwrap(); + self.ws.send(RpcMessage::Error(e.to_string())).unwrap(); }, }; }, diff --git a/server/src/user_anonymous.rs b/server/src/user_anonymous.rs index 213d22a5..be39a052 100644 --- a/server/src/user_anonymous.rs +++ b/server/src/user_anonymous.rs @@ -50,6 +50,16 @@ impl User for Anonymous { _ => (), }; + // last minute redactions and processing + // this happens after the state setting as we need to keep + // all the skills to prevent forfeiting + let msg = match msg { + RpcMessage::InstanceState(v) => RpcMessage::InstanceState(v.redact(self.id)), + RpcMessage::GameState(v) => RpcMessage::GameState(v.redact(self.id)), + _ => msg, + }; + + self.ws.send(msg)?; Ok(()) diff --git a/server/src/user_authenticated.rs b/server/src/user_authenticated.rs index 23d0c69d..ce7581a6 100644 --- a/server/src/user_authenticated.rs +++ b/server/src/user_authenticated.rs @@ -79,6 +79,15 @@ impl User for Authenticated { _ => (), }; + // last minute processing + let msg = match msg { + RpcMessage::InstanceState(v) => RpcMessage::InstanceState(v.redact(self.id)), + RpcMessage::AccountInstances(v) => + RpcMessage::AccountInstances(v.into_iter().map(|i| i.redact(self.id)).collect()), + RpcMessage::GameState(v) => RpcMessage::GameState(v.redact(self.id)), + _ => msg, + }; + self.ws.send(msg)?; Ok(()) diff --git a/studios/package.json b/studios/package.json index 4d90c4c3..08c5353e 100644 --- a/studios/package.json +++ b/studios/package.json @@ -1,6 +1,6 @@ { "name": "mnml-studios", - "version": "1.12.0", + "version": "1.12.1", "description": "", "main": "index.js", "scripts": {