[mirotlaksfu] #107 - try to reconnect the client if server away

هذا الالتزام موجود في:
Miroslav Pejic
2023-05-26 18:47:44 +02:00
الأصل f9fa45070c
التزام aac5762b31

عرض الملف

@@ -658,14 +658,49 @@ class RoomClient {
}.bind(this),
);
this.socket.on(
'connect',
function () {
console.log('Connected to signaling server!');
this._isConnected = true;
location.reload();
}.bind(this),
);
this.socket.on(
'disconnect',
function () {
this.exit(true);
this.ServerAway();
}.bind(this),
);
}
// ####################################################
// SERVER AWAY/MAINTENANCE
// ####################################################
ServerAway() {
this.sound('alert');
Swal.fire({
allowOutsideClick: false,
allowEscapeKey: false,
showDenyButton: true,
showConfirmButton: false,
background: swalBackground,
imageUrl: image.poster,
title: 'Server away',
text: 'The server seems away or in maintenance, please wait until it come back up.',
denyButtonText: `Leave room`,
showClass: { popup: 'animate__animated animate__fadeInDown' },
hideClass: { popup: 'animate__animated animate__fadeOutUp' },
}).then((result) => {
if (!result.isConfirmed) {
this.exit();
}
});
}
// ####################################################
// CHECK USER
// ####################################################
@@ -1985,10 +2020,10 @@ class RoomClient {
clean();
}.bind(this),
);
this.event(_EVENTS.exitRoom);
} else {
clean();
}
this.event(_EVENTS.exitRoom);
}
exitRoom() {