Merge branch 'develop' of ssh://git.mnml.gg:40022/~/mnml into develop
This commit is contained in:
commit
b57a076ac1
@ -1,69 +0,0 @@
|
|||||||
// eslint-disable-next-line
|
|
||||||
const preact = require('preact');
|
|
||||||
const { Component } = require('preact')
|
|
||||||
const { connect } = require('preact-redux');
|
|
||||||
const linkState = require('linkstate').default;
|
|
||||||
|
|
||||||
const { postData, errorToast, infoToast } = require('../utils');
|
|
||||||
|
|
||||||
const addState = connect(
|
|
||||||
(state) => {
|
|
||||||
const {
|
|
||||||
ws
|
|
||||||
} = state;
|
|
||||||
|
|
||||||
function submitRegister(name, password, code) {
|
|
||||||
postData('/account/register', { name, password, code })
|
|
||||||
.then(res => res.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.error) return errorToast(data.error);
|
|
||||||
infoToast(data.message);
|
|
||||||
ws.connect();
|
|
||||||
})
|
|
||||||
.catch(error => errorToast(error));
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
submitRegister,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
function Register(args) {
|
|
||||||
const {
|
|
||||||
submitRegister,
|
|
||||||
navRegister,
|
|
||||||
} = args;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div class="login">
|
|
||||||
<p>
|
|
||||||
mnml is made deep in the southern hemisphere by ntr & mashy.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
if you like this game please support the development by buying credits or subscribing.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
this site has no trackers or ads.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
you can reach us for feedback and support with the discord and email buttons below.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
the access code grep842 is currently active.
|
|
||||||
</p>
|
|
||||||
<button
|
|
||||||
class="login-btn"
|
|
||||||
onClick={() => document.location.assign('https://discord.gg/YJJgurM')}>
|
|
||||||
Discord
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
class="login-btn"
|
|
||||||
onClick={() => navRegister()}>
|
|
||||||
Register
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = addState(Register);
|
|
||||||
@ -2,6 +2,10 @@ const uuidv4 = require('uuid/v4');
|
|||||||
|
|
||||||
// give everybody the shapes mtx
|
// give everybody the shapes mtx
|
||||||
exports.up = async knex => {
|
exports.up = async knex => {
|
||||||
|
await knex.raw(`
|
||||||
|
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||||
|
`);
|
||||||
|
|
||||||
await knex.raw(`
|
await knex.raw(`
|
||||||
INSERT INTO mtx (id, account, variant)
|
INSERT INTO mtx (id, account, variant)
|
||||||
SELECT uuid_generate_v4() as id, id as account, 'Shapes'
|
SELECT uuid_generate_v4() as id, id as account, 'Shapes'
|
||||||
|
|||||||
@ -348,7 +348,7 @@ pub fn create(name: &String, password: &String, tx: &mut Transaction) -> Result<
|
|||||||
.insert(tx)?;
|
.insert(tx)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
img::shapes_write(img)?;
|
// img::shapes_write(img)?;
|
||||||
|
|
||||||
info!("registration account={:?}", name);
|
info!("registration account={:?}", name);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user