diff --git a/client/src/components/login.component.jsx b/client/src/components/login.component.jsx old mode 100644 new mode 100755 index 85733c04..2bfd1788 --- a/client/src/components/login.component.jsx +++ b/client/src/components/login.component.jsx @@ -1,7 +1,7 @@ // eslint-disable-next-line const preact = require('preact'); -function renderLogin({ account, submitLogin }) { +function renderLogin({ account, submitLogin, submitRegister}) { if (account) return
{JSON.stringify(account)}
; const details = { @@ -42,12 +42,24 @@ function renderLogin({ account, submitLogin }) {

+ +

diff --git a/client/src/components/login.container.jsx b/client/src/components/login.container.jsx old mode 100644 new mode 100755 index d934a447..a4b1bf77 --- a/client/src/components/login.container.jsx +++ b/client/src/components/login.container.jsx @@ -8,8 +8,10 @@ const addState = connect( function submitLogin(name, password) { return ws.sendAccountLogin(name, password); } - - return { account: state.account, submitLogin }; + function submitRegister(name, password) { + return ws.sendAccountRegister(name, password); + } + return { account: state.account, submitLogin, submitRegister }; } ); diff --git a/client/src/socket.jsx b/client/src/socket.jsx old mode 100644 new mode 100755 index 287fc61a..4d89b0b1 --- a/client/src/socket.jsx +++ b/client/src/socket.jsx @@ -24,7 +24,7 @@ function createSocket(store) { // Connection opened ws.addEventListener('open', function wsOpen(event) { - send({ method: 'account_login', params: { name: 'ntr', password: 'grepgrepgrep' } }); + //send({ method: 'account_login', params: { name: 'ntr', password: 'grepgrepgrep' } }); }); // Listen for messages @@ -101,6 +101,10 @@ function createSocket(store) { send({ method: 'account_login', params: { name, password } }); } + function sendAccountRegister(name, password) { + send({ method: 'account_create', params: { name, password } }); + } + function sendCrypSpawn(name) { send({ method: 'cryp_spawn', params: { name } }); } @@ -148,6 +152,7 @@ function createSocket(store) { return { sendAccountLogin, + sendAccountRegister, sendCombatPve, sendCrypSpawn, sendItemUse,