Merge tag '1.6.5' into develop

1.6.5
This commit is contained in:
ntr 2019-10-26 16:16:02 +11:00
commit a8fb019a4e
26 changed files with 99 additions and 64 deletions

View File

@ -1 +1 @@
1.6.4
1.6.5

View File

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

View File

@ -151,3 +151,21 @@ button {
border-color: @green;
}
}
@keyframes rgb {
0% {
color: @red;
}
25% {
color: @white;
}
50% {
color: @blue;
}
75% {
color: @white;
}
100% {
color: @green;
}
}

View File

@ -85,6 +85,17 @@ aside {
transition-property: color, background;
transition-duration: 0.25s;
transition-timing-function: ease;
&:enabled {
color: forestgreen;
border-color: forestgreen;
&:hover {
background: forestgreen;
color: black;
border-color: forestgreen;
}
}
}
.team-page-ctrl {

View File

@ -437,11 +437,12 @@
#targeting, .resolving-skill {
width: calc(100% - 1em);
}
.player {
width: calc(100% - 1em);
bottom: 3em;
height: calc(50% - 3em);
}
}
.player {
width: calc(100% - 1em);
bottom: 3em;
height: calc(50% - 3em);
}
}

View File

@ -90,6 +90,11 @@
.login {
display: flex;
flex-flow: column;
.terms {
display: inline;
margin: 0 1em;
}
}
}

View File

@ -51,6 +51,11 @@
color: @yellow;
font-weight: bold;
}
.name.subscriber {
// animation: rgb 4s cubic-bezier(0.5, 0, 0.5, 1) 0s infinite alternate;
// font-weight: bold;
}
}
.chat {

View File

@ -143,7 +143,7 @@ button, input {
a {
color: whitesmoke;
text-decoration: none;
// text-decoration: none;
&:hover {
color: whitesmoke;

View File

@ -9,7 +9,7 @@
<meta name="application-name" content="mnml">
<meta name="description" content="mnml pvp tbs">
<meta name="author" content="ntr@smokestack.io">
<title>mnml - abstract strategy</title>
<title>MNML - abstract strategy</title>
<link rel="manifest" href="manifest.webmanifest">
<link rel="stylesheet" href="./node_modules/izitoast/dist/css/iziToast.min.css"></script>
<link href="https://fonts.googleapis.com/css?family=Jura" rel="stylesheet">
@ -19,7 +19,7 @@
</head>
<body>
<noscript>
<p>js is required to run mnml.</p>
<p>js is required to run MNML.</p>
<p>this site has no ads. free to play forever.</p>
</noscript>
</body>

View File

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

View File

@ -15,10 +15,6 @@ const registerEvents = require('./events');
const Mnml = require('./components/mnml');
if (process.env.NODE_ENV !== 'development') {
LogRocket.init('yh0dy3/mnml');
}
function stripeKey() {
if (window.location.host === 'mnml.gg') return 'pk_live_fQGrL1uWww2ot8W1G7vTySAv004ygmnMXq';
return 'pk_test_Cb49tTqTXpzk7nEmlGzRrNJg00AU0aNZDj';
@ -40,9 +36,12 @@ events.setWs(ws);
const App = () => (
<Provider store={store}>
<StripeProvider apiKey={stripeKey()}>
<Mnml />
</StripeProvider>
{window.Stripe
? <StripeProvider apiKey={stripeKey()}>
<Mnml />
</StripeProvider>
: <Mnml />
}
</Provider>
);

View File

@ -101,11 +101,13 @@ function AccountBox(args) {
// );
// }
const nameClass = `name ${account.subscribed ? 'subscriber' : ''}`;
return (
<div class='player-box bottom'>
<div class="msg">&nbsp;</div>
<StateAccountAvatar />
<div class="name">{account.name}</div>
<div class={nameClass}>{account.name}</div>
<div class="score">&nbsp;</div>
</div>
);

View File

@ -3,8 +3,6 @@ const { connect } = require('preact-redux');
const { errorToast, infoToast } = require('../utils');
const AccountBox = require('./account.box');
const addState = connect(
function receiveState(state) {
const {

View File

@ -120,7 +120,7 @@ function Play(args) {
type="submit">
Copy &#x1F517;
</button>
<figcaption>Invite Generated</figcaption>
<figcaption>Click to Copy</figcaption>
</figure>
);
};
@ -203,6 +203,7 @@ function Play(args) {
<div>
Join our Discord server to find opponents and talk to the devs. <br />
Message <b>@ntr</b> or <b>@mashy</b> for some credits to get started.<br />
<a href='https://www.youtube.com/watch?v=VtZLlkpJuS8'>Tutorial Playthrough on YouTube</a>
</div>
<br />
<div>

View File

@ -70,22 +70,26 @@ function Scoreboard(args) {
const winner = player.score === 'Win';
if (!isPlayer) {
const nameClass = `name ${player.img ? 'subscriber' : ''}`;
return (
<div class={`player-box top ${winner ? 'winner' : player.ready ? 'ready' : ''}`}>
<div></div>
<div class="score">{scoreText()}</div>
<div class="name">{player.name}</div>
<div class={nameClass}>{player.name}</div>
<Img img={player.img} id={player.id} />
<div class="msg">{chat || '\u00A0'}</div>
</div>
);
}
const boxClass = `player-box bottom ${winner ? 'winner': player.ready ? 'ready' : ''}`;
const nameClass = `name ${player.img ? 'subscriber' : ''}`;
return (
<div class={`player-box bottom ${winner ? 'winner': player.ready ? 'ready' : ''}`}>
<div class={boxClass}>
<div class="msg">{chat || '\u00A0'}</div>
<div class="score">{scoreText()}</div>
<div class="name">{player.name}</div>
<div class={nameClass}>{player.name}</div>
<Img img={player.img} id={player.id} />
</div>
);

View File

@ -48,9 +48,12 @@ function Shop(args) {
</div>
<div>
<h1 class="credits">¤ {account.balance}</h1>
<Elements>
<StripeBtns account={account} />
</Elements>
{window.Stripe
? <Elements>
<StripeBtns account={account} />
</Elements>
: <div>Please unblock Stripe to use the store</div>
}
</div>
</section>
);

View File

@ -8,7 +8,7 @@ const Help = require('./welcome.help');
const Demo = require('./demo');
function Welcome() {
const page = this.state.page || 'login';
const page = this.state.page || 'register';
const navRegister = () => this.setState({ page: 'register' });
const pageEl = () => {
@ -53,7 +53,7 @@ function Welcome() {
<p>
Welcome to mnml.
</p>
<p> Turn-based 1v1 strategy game in an abstract setting. </p>
<p> MNML is a turn-based 1v1 strategy game in an abstract setting. </p>
<p>
Build a unique team of 3 constructs from a range of skills and specialisations.<br />
Outplay your opponent in multiple rounds by adapting to an always shifting meta. <br />
@ -62,6 +62,7 @@ function Welcome() {
<p>
Free to play, no pay to win. Register to start playing.<br />
</p>
<a href='https://www.youtube.com/watch?v=VtZLlkpJuS8'>Tutorial Playthrough on YouTube</a>
</div>
{pageEl()}
</section>

View File

@ -58,7 +58,7 @@ function Register(args) {
value={this.state.name}
onInput={linkState(this, 'name')}
/>
<label for="password">Password - min 12 chars</label>
<label for="password">Password - min 4 chars</label>
<input
class="login-input"
type="password"
@ -79,9 +79,11 @@ function Register(args) {
<div>
<input
type="checkbox"
name="terms"
id="register-terms"
onInput={linkState(this, 'terms')
}/>
&nbsp; Confirm agreement to terms of service &nbsp;
<label class="terms" for="register-terms">Confirm agreement to terms of service.</label>
<button onClick={() => window.open('/tos.html')}>VIEW</button>
</div>
<button

View File

@ -127,6 +127,7 @@ function registerEvents(store) {
function setAccount(account) {
if (account) {
LogRocket.init('yh0dy3/mnml');
LogRocket.identify(account.id, account);
}

View File

@ -1,6 +1,8 @@
const toast = require('izitoast');
const cbor = require('borc');
const throttle = require('lodash/throttle');
const SOCKET_URL =
`${window.location.protocol === 'https:' ? 'wss://' : 'ws://'}${window.location.host}/api/ws`;
@ -363,7 +365,8 @@ function createSocket(events) {
sendGameTarget,
sendInstanceAbandon,
sendInstanceReady,
// some weird shit happening in face off
sendInstanceReady: throttle(sendInstanceReady, 500),
sendInstancePractice,
sendInstanceQueue,
sendInstanceState,

View File

@ -63,24 +63,6 @@ server {
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
server_name minimalstudios.com.au;
location / {
root /var/lib/mnml/public/press/;
index index.html;
try_files $uri $uri/ index.html;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/minimalstudios.com.au/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/minimalstudios.com.au/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
# http -> https
server {
server_name mnml.gg;
@ -91,8 +73,3 @@ server {
server_name minimal.gg;
return 301 https://mnml.gg$request_uri;
}
server {
server_name minimalstudios.com.au;
return 301 https://minimalstudios.com.au$request_uri;
}

View File

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

View File

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

View File

@ -20,7 +20,7 @@ use img;
use failure::Error;
use failure::{err_msg, format_err};
static PASSWORD_MIN_LEN: usize = 11;
static PASSWORD_MIN_LEN: usize = 3;
#[derive(Debug,Clone,Serialize,Deserialize)]
pub struct Account {
@ -189,7 +189,7 @@ pub fn new_img(tx: &mut Transaction, id: Uuid) -> Result<Account, Error> {
}
pub fn set_password(tx: &mut Transaction, id: Uuid, current: &String, password: &String) -> Result<String, MnmlHttpError> {
if password.len() < PASSWORD_MIN_LEN {
if password.len() < PASSWORD_MIN_LEN || password.len() > 100 {
return Err(MnmlHttpError::PasswordUnacceptable);
}
@ -318,7 +318,7 @@ pub fn set_subscribed(tx: &mut Transaction, id: Uuid, subscribed: bool) -> Resul
}
pub fn create(name: &String, password: &String, tx: &mut Transaction) -> Result<String, MnmlHttpError> {
if password.len() < PASSWORD_MIN_LEN {
if password.len() < PASSWORD_MIN_LEN || password.len() > 100 {
return Err(MnmlHttpError::PasswordUnacceptable);
}
@ -328,7 +328,7 @@ pub fn create(name: &String, password: &String, tx: &mut Transaction) -> Result<
let id = Uuid::new_v4();
let img = Uuid::new_v4();
let rounds = 8;
let rounds = 12;
let password = hash(&password, rounds)?;
let mut rng = thread_rng();

View File

@ -450,6 +450,7 @@ pub fn start(pool: PgPool, events_tx: CbSender<Event>, stripe: StripeClient) {
}
// we done
Err(_e) => {
// info!("{:?}", e);
break;
},
};

View File

@ -1264,6 +1264,9 @@ impl Skill {
Skill::Invert|
Skill::InvertPlus |
Skill::InvertPlusPlus |
Skill::Intercept|
Skill::InterceptPlus |
Skill::InterceptPlusPlus |
Skill::Counter|
Skill::CounterPlus |
Skill::CounterPlusPlus |