reconnect clear prompt

This commit is contained in:
ntr 2018-11-27 17:02:42 +11:00
parent 57780416c8
commit 0bb10a65ed
2 changed files with 4 additions and 18 deletions

View File

@ -90,6 +90,9 @@ function registerEvents(registry, events) {
ws.sendAccountCreate(USERNAME, PASSWORD);
}
const existing = document.querySelector('#login'); // Selector of your toast
if (existing) toast.hide({}, existing, 'reconnect');
toast.question({
id: 'login',
theme: 'dark',

View File

@ -16,23 +16,6 @@ function createSocket(events) {
let gameStateTimeout;
function bootstrap() {
send({ method: 'account_create', params: { name: 'ntr', password: 'grepgrepgrep' } });
send({ method: 'cryp_spawn', params: { name: 'muji' } });
send({ method: 'cryp_spawn', params: { name: 'drake' } });
send({ method: 'cryp_spawn', params: { name: 'xray' } });
}
function bootstrapMashy() {
send({ method: 'account_create', params: { name: 'mashy', password: 'grepgrepgrep' } });
send({ method: 'cryp_spawn', params: { name: 'maury' } });
send({ method: 'cryp_spawn', params: { name: 'midshaker' } });
send({ method: 'cryp_spawn', params: { name: 'artour' } });
}
window.bootstrap = bootstrap;
window.bootstrapMashy = bootstrapMashy;
function connect() {
ws = new WebSocket(SOCKET_URL);
ws.binaryType = 'arraybuffer';
@ -44,7 +27,7 @@ function createSocket(events) {
});
events.loginPrompt();
// send({ method: 'account_login', params: { name: 'ntr', password: 'grepgrepgrep' } });
send({ method: 'account_login', params: { name: 'ntr', password: 'grepgrepgrep' } });
});
// Listen for messages