max targets and multiplayer test

This commit is contained in:
ntr
2018-12-03 23:48:24 +11:00
parent b38be6d7bb
commit 63ec7a27ad
4 changed files with 302 additions and 231 deletions
+8 -2
View File
@@ -147,6 +147,7 @@ function createSocket(events) {
// this object wraps the reply types to a function
const handlers = {
cryp_spawn: crypSpawn,
cryp_learn: () => true,
game_pve: gamePve,
game_state: gameState,
game_joinable_list: gameJoinableList,
@@ -183,10 +184,12 @@ function createSocket(events) {
position: 'topRight',
});
events.loginPrompt();
if (!account) events.loginPrompt();
if (process.env.NODE_ENV !== 'production') {
send({ method: 'account_login', params: { name: 'ntr', password: 'grepgrepgrep' } });
}
return true;
});
// Listen for messages
@@ -200,7 +203,10 @@ function createSocket(events) {
ws.addEventListener('close', (event) => {
console.error('WebSocket closed', event);
// account = null;
toast.warn({
message: 'disconnected',
position: 'topRight',
});
return setTimeout(connect, 5000);
});