Merge branch 'release/1.1.0'

This commit is contained in:
ntr 2019-09-03 16:14:50 +10:00
commit c25cdbe9e4
15 changed files with 63 additions and 25 deletions

View File

@ -1 +1 @@
1.0.1
1.1.0

View File

@ -6,12 +6,19 @@
* serde serialize privatise
* DO postgres
* mobile styles
* can't reset password without knowing password =\
* treats
* constructs jiggle when clicked
* background colour changes depending on time of day
* bug fixes
* pvp 1st player ready up doesn't get put in game
* pvp 1st round doesn't resolve until warden timer completes
* bot game grind
* stress test
* change score to enum
* pct based translates for combat animation
@ -19,6 +26,8 @@
* send account_instances on players update
* convert PlusPlus to ++ or rename
* add speed to descriptions
* add components to description e.g. Strike (red circle red circle attack)
* clear skill (if currently targetted)
* increase power to speed up early rounds

View File

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

15
bin/version.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
# bless you chris and andy <3
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
MNML_PATH=$(realpath "$DIR/../")
VERSION=$1
echo "Setting version to $VERSION"
echo $VERSION | tr -d '\n' > VERSION
cd $MNML_PATH/server && sed -i "/^version/c\version = \"$VERSION\"" Cargo.toml
cd $MNML_PATH/ops && npm --allow-same-version --no-git-tag-version version "$VERSION"
cd $MNML_PATH/client && npm --allow-same-version --no-git-tag-version version "$VERSION"
cd $MNML_PATH/acp && npm --allow-same-version --no-git-tag-version version "$VERSION"

View File

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

View File

@ -13,6 +13,11 @@ const registerEvents = require('./events');
const Mnml = require('./components/mnml');
function stripeKey() {
if (window.location.host === 'mnml.gg') return 'pk_live_fQGrL1uWww2ot8W1G7vTySAv004ygmnMXq';
return 'pk_test_Cb49tTqTXpzk7nEmlGzRrNJg00AU0aNZDj';
}
// Redux Store
const store = createStore(
combineReducers(reducers),
@ -30,7 +35,7 @@ document.fonts.load('16pt "Jura"').then(() => {
const App = () => (
<Provider store={store}>
<StripeProvider apiKey="pk_live_fQGrL1uWww2ot8W1G7vTySAv004ygmnMXq">
<StripeProvider apiKey={stripeKey()}>
<Mnml />
</StripeProvider>
</Provider>

View File

@ -1,6 +1,16 @@
const preact = require('preact');
const { injectStripe } = require('react-stripe-elements');
function subPlan() {
if (window.location.host === 'mnml.gg') return 'plan_Fjdtsd4i7aVLe1';
return 'prod_FWSA8RoyMMV3st';
}
function bitsSku() {
if (window.location.host === 'mnml.gg') return 'sku_Fjdu7zOy3sLGc5';
return 'sku_FjuNxONdWewjH2';
}
function BitsBtn(args) {
const {
stripe,
@ -8,18 +18,18 @@ function BitsBtn(args) {
} = args;
function subscribeClick() {
stripe.redirectToCheckout({
items: [{ plan: 'plan_Fjdtsd4i7aVLe1', quantity: 1 }],
successUrl: 'https://mnml.gg',
cancelUrl: 'https://mnml.gg',
items: [{ plan: subPlan(), quantity: 1 }],
successUrl: window.location.origin,
cancelUrl: window.location.origin,
clientReferenceId: account.id,
});
}
function bitsClick() {
stripe.redirectToCheckout({
items: [{ sku: 'sku_Fjdu7zOy3sLGc5', quantity: 1 }],
successUrl: 'https://mnml.gg',
cancelUrl: 'https://mnml.gg',
items: [{ sku: bitsSku(), quantity: 1 }],
successUrl: window.location.origin,
cancelUrl: window.location.origin,
clientReferenceId: account.id,
});
}

View File

@ -1,11 +1,8 @@
const toast = require('izitoast');
const cbor = require('borc');
const socketUrl = () => {
if (process.env.NODE_ENV === 'production') return 'wss://mnml.gg/api/ws';
if (process.env.NODE_ENV === 'staging') return 'wss://sixtysix.pro/api/ws';
return 'ws://localhost/api/ws';
};
const SOCKET_URL =
`${window.location.protocol === 'https:' ? 'wss://' : 'ws://'}${window.location.host}/api/ws`;
function errorToast(err) {
console.error(err);
@ -299,7 +296,7 @@ function createSocket(events) {
ws = null;
}
ws = new WebSocket(socketUrl());
ws = new WebSocket(SOCKET_URL);
ws.binaryType = 'arraybuffer';
// Listen for messages

View File

@ -12,8 +12,9 @@ map $http_upgrade $connection_upgrade {
'' close;
}
# DEV
server {
server_name sixtysix.pro;
location / {
root /var/lib/mnml/public/current;
index index.html;
@ -40,8 +41,8 @@ server {
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/mnml.gg/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/mnml.gg/privkey.pem; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/sixtysix.pro/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/sixtysix.pro/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
}

View File

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

View File

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

View File

@ -185,8 +185,9 @@ pub fn set_password(tx: &mut Transaction, id: Uuid, current: &String, password:
let id: Uuid = row.get(0);
let db_pw: String = row.get(1);
// return bad request to prevent being logged out
if !verify(current, &db_pw)? {
return Err(MnmlHttpError::PasswordNotMatch);
return Err(MnmlHttpError::BadRequest);
}
let rounds = 8;

View File

@ -724,7 +724,7 @@ pub fn instance_ready(tx: &mut Transaction, account: &Account, instance_id: Uuid
Ok(RpcMessage::InstanceState(instance_update(tx, instance)?))
}
pub fn instance_state(tx: &mut Transaction, _account: &Account, instance_id: Uuid) -> Result<RpcMessage, Error> {
pub fn instance_state(tx: &mut Transaction, instance_id: Uuid) -> Result<RpcMessage, Error> {
let instance = instance_get(tx, instance_id)?;
if let Some(game_id) = instance.current_game_id() {

View File

@ -88,7 +88,7 @@ fn handle_notification(n: Notification, pool: &PgPool, events: &Sender<Event>) {
Table::Accounts =>
Some(Event::Push(n.id, RpcMessage::AccountState(account::select(&db, n.id).unwrap()))),
Table::Instances =>
Some(Event::Push(n.id, RpcMessage::InstanceState(instance::instance_get(&mut tx, n.id).unwrap()))),
Some(Event::Push(n.id, instance::instance_state(&mut tx, n.id).unwrap())),
Table::Games =>
Some(Event::Push(n.id, RpcMessage::GameState(game::game_get(&mut tx, n.id).unwrap()))),
_ => {

View File

@ -180,7 +180,7 @@ impl Connection {
RpcRequest::InstanceReady { instance_id } =>
Ok(instance_ready(&mut tx, account, instance_id)?),
RpcRequest::InstanceState { instance_id } =>
Ok(instance_state(&mut tx, account, instance_id)?),
Ok(instance_state(&mut tx, instance_id)?),
RpcRequest::VboxAccept { instance_id, group, index } =>
Ok(RpcMessage::InstanceState(vbox_accept(&mut tx, account, instance_id, group, index)?)),