max targets and multiplayer test
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user