remove code, fix animation reset
This commit is contained in:
parent
1f5d57a276
commit
9a70c1f34e
@ -53,13 +53,19 @@ function Welcome() {
|
||||
<section>
|
||||
<div class="news">
|
||||
<h1>mnml.gg</h1>
|
||||
<p>mnml is a turn-based 1v1 strategy game in an abstract setting.</p>
|
||||
<p>outplay your opponents by building your team of 3 constructs from a shifting meta of skills, effects and specialisations.</p>
|
||||
<p>simple rules, complex interactions, simultaneous turns to increase the pace, and a unique speed mechanic;</p>
|
||||
<p>mnml is a tactical game unlike any other.</p>
|
||||
<p>free to play</p>
|
||||
<p>no email required</p>
|
||||
<p>glhf</p>
|
||||
<p>
|
||||
mnml is a turn-based 1v1 strategy game in an abstract setting.<br />
|
||||
outplay your opponents by building your team of 3 constructs from a shifting meta of skills, effects and specialisations.<br />
|
||||
</p>
|
||||
<p>
|
||||
simple rules, complex interactions, simultaneous turns to increase the pace, and a unique speed mechanic;<br />
|
||||
mnml is a tactical game unlike any other.
|
||||
</p>
|
||||
<p>
|
||||
free to play<br />
|
||||
no email required<br />
|
||||
glhf
|
||||
</p>
|
||||
</div>
|
||||
{pageEl()}
|
||||
</section>
|
||||
|
||||
@ -12,8 +12,8 @@ const addState = connect(
|
||||
ws
|
||||
} = state;
|
||||
|
||||
function submitRegister(name, password, code) {
|
||||
postData('/account/register', { name, password, code })
|
||||
function submitRegister(name, password) {
|
||||
postData('/account/register', { name, password })
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
if (data.error) return errorToast(data.error);
|
||||
@ -34,12 +34,11 @@ function Register(args) {
|
||||
submitRegister,
|
||||
} = args;
|
||||
|
||||
const { password, confirm, name, code } = this.state;
|
||||
const { password, confirm, name } = this.state;
|
||||
|
||||
const registerSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
submitRegister(name, password, code);
|
||||
// this.setState({ name: '', password: '', confirm: '', code: ''});
|
||||
submitRegister(name, password);
|
||||
}
|
||||
|
||||
const registerConfirm = () =>
|
||||
@ -75,14 +74,6 @@ function Register(args) {
|
||||
value={this.state.confirm}
|
||||
onInput={linkState(this, 'confirm')}
|
||||
/>
|
||||
<label for="code">Access Code</label>
|
||||
<input
|
||||
class="login-input"
|
||||
type="text"
|
||||
placeholder="code"
|
||||
value={this.state.code}
|
||||
onInput={linkState(this, 'code')}
|
||||
/>
|
||||
<button
|
||||
class="login-btn"
|
||||
disabled={registerDisabled()}
|
||||
|
||||
@ -200,6 +200,7 @@ function registerEvents(store) {
|
||||
const startDemo = () => {
|
||||
console.log(initial);
|
||||
store.dispatch(actions.setDemo(initial));
|
||||
store.dispatch(actions.setAnimTarget(null));
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, initial, { combiner: [0] }))), 2000);
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, initial, { combiner: [0, 1] }))), 4000);
|
||||
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, initial, { combiner: [0, 1, 2] }))), 6000);
|
||||
|
||||
@ -288,15 +288,11 @@ pub fn set_subscribed(tx: &mut Transaction, id: Uuid, subscribed: bool) -> Resul
|
||||
Ok(name)
|
||||
}
|
||||
|
||||
pub fn create(name: &String, password: &String, code: &String, tx: &mut Transaction) -> Result<String, MnmlHttpError> {
|
||||
pub fn create(name: &String, password: &String, tx: &mut Transaction) -> Result<String, MnmlHttpError> {
|
||||
if password.len() < PASSWORD_MIN_LEN {
|
||||
return Err(MnmlHttpError::PasswordUnacceptable);
|
||||
}
|
||||
|
||||
if code.to_lowercase() != "grep842" {
|
||||
return Err(MnmlHttpError::InvalidCode);
|
||||
}
|
||||
|
||||
if name.len() == 0 {
|
||||
return Err(MnmlHttpError::AccountNameNotProvided);
|
||||
}
|
||||
|
||||
@ -52,8 +52,6 @@ pub enum MnmlHttpError {
|
||||
PasswordUnacceptable,
|
||||
#[fail(display="incorrect token. refresh or logout of existing sessions")]
|
||||
TokenDoesNotMatch,
|
||||
#[fail(display="invalid code. https://discord.gg/YJJgurM")]
|
||||
InvalidCode,
|
||||
}
|
||||
|
||||
impl From<bcrypt::BcryptError> for MnmlHttpError {
|
||||
@ -129,7 +127,6 @@ impl From<MnmlHttpError> for IronError {
|
||||
MnmlHttpError::PasswordUnacceptable => (m_err.compat(), status::BadRequest),
|
||||
|
||||
MnmlHttpError::PasswordNotMatch |
|
||||
MnmlHttpError::InvalidCode |
|
||||
MnmlHttpError::TokenDoesNotMatch |
|
||||
MnmlHttpError::Unauthorized => (m_err.compat(), status::Unauthorized),
|
||||
|
||||
@ -211,7 +208,6 @@ fn token_res(token: String) -> Response {
|
||||
struct RegisterBody {
|
||||
name: String,
|
||||
password: String,
|
||||
code: String,
|
||||
}
|
||||
|
||||
fn register(req: &mut Request) -> IronResult<Response> {
|
||||
@ -224,7 +220,7 @@ fn register(req: &mut Request) -> IronResult<Response> {
|
||||
let db = state.pool.get().or(Err(MnmlHttpError::DbError))?;
|
||||
let mut tx = db.transaction().or(Err(MnmlHttpError::DbError))?;
|
||||
|
||||
match account::create(¶ms.name, ¶ms.password, ¶ms.code, &mut tx) {
|
||||
match account::create(¶ms.name, ¶ms.password, &mut tx) {
|
||||
Ok(token) => {
|
||||
tx.commit().or(Err(MnmlHttpError::ServerError))?;
|
||||
Ok(token_res(token))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user