add registry code
This commit is contained in:
parent
440376e5c3
commit
1faf75bb40
@ -114,11 +114,15 @@ nav button[disabled], nav button[disabled]:hover {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav button:hover, nav button:focus {
|
nav button:hover {
|
||||||
color: whitesmoke;
|
color: #888;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nav button:focus, nav button:active {
|
||||||
|
color: whitesmoke;
|
||||||
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
padding-top: 1em;
|
padding-top: 1em;
|
||||||
grid-area: main;
|
grid-area: main;
|
||||||
@ -154,7 +158,12 @@ button, input {
|
|||||||
transition-timing-function: ease;
|
transition-timing-function: ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
button:hover, button:focus {
|
button:hover {
|
||||||
|
color: whitesmoke;
|
||||||
|
border-color: #888;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:focus {
|
||||||
/*colour necesary to bash skellington*/
|
/*colour necesary to bash skellington*/
|
||||||
color: whitesmoke;
|
color: whitesmoke;
|
||||||
border-color: whitesmoke;
|
border-color: whitesmoke;
|
||||||
|
|||||||
@ -58,7 +58,7 @@ class InstanceCreateForm extends Component {
|
|||||||
<form>
|
<form>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>New Instance</legend>
|
<legend>New Instance</legend>
|
||||||
<label>instance name</label>
|
<label>Instance Name</label>
|
||||||
<input
|
<input
|
||||||
class="login-input"
|
class="login-input"
|
||||||
type="text"
|
type="text"
|
||||||
@ -67,7 +67,7 @@ class InstanceCreateForm extends Component {
|
|||||||
placeholder="game name"
|
placeholder="game name"
|
||||||
onInput={this.nameInput}
|
onInput={this.nameInput}
|
||||||
/>
|
/>
|
||||||
<label htmlFor="pveSelect">Practice Mode - vs CPU, no time control</label>
|
<label htmlFor="pveSelect">Practice Mode - vs CPU, no Time Control</label>
|
||||||
<input id="pveSelect"
|
<input id="pveSelect"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
|
|||||||
@ -9,9 +9,8 @@ const addState = connect(
|
|||||||
function submitLogin(name, password) {
|
function submitLogin(name, password) {
|
||||||
return ws.sendAccountLogin(name, password);
|
return ws.sendAccountLogin(name, password);
|
||||||
}
|
}
|
||||||
function submitRegister(name, password) {
|
function submitRegister(name, password, code) {
|
||||||
console.log(name, password);
|
return ws.sendAccountCreate(name, password, code);
|
||||||
return ws.sendAccountCreate(name, password);
|
|
||||||
}
|
}
|
||||||
return { account, submitLogin, submitRegister };
|
return { account, submitLogin, submitRegister };
|
||||||
},
|
},
|
||||||
@ -21,10 +20,11 @@ class Login extends Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.state = { name: '', password: '' };
|
this.state = { name: '', password: '', code: ''};
|
||||||
|
|
||||||
this.nameInput = this.nameInput.bind(this);
|
this.nameInput = this.nameInput.bind(this);
|
||||||
this.passwordInput = this.passwordInput.bind(this);
|
this.passwordInput = this.passwordInput.bind(this);
|
||||||
|
this.codeInput = this.codeInput.bind(this);
|
||||||
this.loginSubmit = this.loginSubmit.bind(this);
|
this.loginSubmit = this.loginSubmit.bind(this);
|
||||||
this.registerSubmit = this.registerSubmit.bind(this);
|
this.registerSubmit = this.registerSubmit.bind(this);
|
||||||
}
|
}
|
||||||
@ -37,6 +37,10 @@ class Login extends Component {
|
|||||||
this.setState({ password: event.target.value });
|
this.setState({ password: event.target.value });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
codeInput(event) {
|
||||||
|
this.setState({ code: event.target.value });
|
||||||
|
}
|
||||||
|
|
||||||
loginSubmit(event) {
|
loginSubmit(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
console.log(this.state);
|
console.log(this.state);
|
||||||
@ -46,9 +50,9 @@ class Login extends Component {
|
|||||||
|
|
||||||
registerSubmit(event) {
|
registerSubmit(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.props.submitRegister(this.state.name, this.state.password);
|
this.props.submitRegister(this.state.name, this.state.password, this.state.code);
|
||||||
console.log(this.state);
|
console.log(this.state);
|
||||||
this.setState({ name: '', password: '' });
|
this.setState({ name: '', password: '', code: ''});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -70,6 +74,13 @@ class Login extends Component {
|
|||||||
value={this.state.password}
|
value={this.state.password}
|
||||||
onInput={this.passwordInput}
|
onInput={this.passwordInput}
|
||||||
/>
|
/>
|
||||||
|
<input
|
||||||
|
class="login-input"
|
||||||
|
type="text"
|
||||||
|
placeholder="code"
|
||||||
|
value={this.state.code}
|
||||||
|
onInput={this.codeInput}
|
||||||
|
/>
|
||||||
<button
|
<button
|
||||||
class="login-btn"
|
class="login-btn"
|
||||||
onClick={this.loginSubmit}>
|
onClick={this.loginSubmit}>
|
||||||
|
|||||||
@ -146,7 +146,7 @@ function Nav(args) {
|
|||||||
<h1 class="header-title">mnml.gg</h1>
|
<h1 class="header-title">mnml.gg</h1>
|
||||||
{accountStatus}
|
{accountStatus}
|
||||||
<button onClick={() => navTo('team')}>Select Team</button>
|
<button onClick={() => navTo('team')}>Select Team</button>
|
||||||
<button disabled={canJoin} onClick={() => navTo('list')}>Join</button>
|
<button disabled={canJoin} onClick={() => navTo('list')}>Play</button>
|
||||||
<hr />
|
<hr />
|
||||||
{joined}
|
{joined}
|
||||||
{haxSection}
|
{haxSection}
|
||||||
|
|||||||
@ -43,8 +43,8 @@ function createSocket(events) {
|
|||||||
send({ method: 'account_login', params: { name, password } });
|
send({ method: 'account_login', params: { name, password } });
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendAccountCreate(name, password) {
|
function sendAccountCreate(name, password, code) {
|
||||||
send({ method: 'account_create', params: { name, password } });
|
send({ method: 'account_create', params: { name, password, code } });
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendAccountConstructs() {
|
function sendAccountConstructs() {
|
||||||
|
|||||||
@ -65,7 +65,7 @@ pub fn account_create(params: AccountCreateParams, tx: &mut Transaction) -> Resu
|
|||||||
return Err(err_msg("password must be at least 12 characters"));
|
return Err(err_msg("password must be at least 12 characters"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if params.password != "grepgrepgrep" {
|
if params.code.to_lowercase() != "grep842" {
|
||||||
return Err(err_msg("https://discord.gg/YJJgurM"));
|
return Err(err_msg("https://discord.gg/YJJgurM"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -472,6 +472,7 @@ struct AccountCreateMsg {
|
|||||||
pub struct AccountCreateParams {
|
pub struct AccountCreateParams {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub password: String,
|
pub password: String,
|
||||||
|
pub code: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug,Clone,Serialize,Deserialize)]
|
#[derive(Debug,Clone,Serialize,Deserialize)]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user