Adding an "alone" mode

In "alone" mode (or single-player mode), WorkAdventure does not connect to the server at all.
In order to enter the "alone" mode, you need to add "?alone=true" to the URL.

"alone" mode can be useful for tutorials (First Time User Experience) where you want to explain how WorkAdventure works without being disturbed by other users.
This commit is contained in:
David Négrier 2021-03-30 16:08:49 +02:00
parent ad4f8e892e
commit 559e15ebb6
4 changed files with 54 additions and 28 deletions

View file

@ -35,7 +35,8 @@ class UrlManager {
public pushRoomIdToUrl(room:Room): void {
if (window.location.pathname === room.id) return;
const hash = window.location.hash;
history.pushState({}, 'WorkAdventure', room.id+hash);
const search = room.search.toString();
history.pushState({}, 'WorkAdventure', room.id+(search?'?'+search:'')+hash);
}
public getStartLayerNameFromUrl(): string|null {