Hotfix: if an error occurs while loading the map (because the map is not accessible from the WorkAdventure servers), the application does not prevent users from connecting.

This commit is contained in:
David Négrier 2021-08-03 10:08:53 +02:00
parent d568fd596b
commit 4293ea320d

View File

@ -473,7 +473,22 @@ export class GameRoom {
const variablesManager = new VariablesManager(this.roomUrl, null); const variablesManager = new VariablesManager(this.roomUrl, null);
return variablesManager.init(); return variablesManager.init();
} else { } else {
throw e; // An error occurred while loading the map
// Right now, let's bypass the error. In the future, we should make sure the user is aware of that
// and that he/she will act on it to fix the problem.
// Note: we run this message inside a setTimeout so that the room listeners can have time to connect.
setTimeout(() => {
for (const roomListener of this.roomListeners) {
emitErrorOnRoomSocket(
roomListener,
"Your map does not seem accessible from the WorkAdventure servers. Is it behind a firewall or a proxy? Your map should be accessible from the WorkAdventure servers. If you use the scripting API in this map, please be aware that server-side checks and variable persistence is disabled."
);
}
}, 1000);
const variablesManager = new VariablesManager(this.roomUrl, null);
return variablesManager.init();
} }
}); });
} }