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:
parent
ad4f8e892e
commit
559e15ebb6
4 changed files with 54 additions and 28 deletions
|
@ -14,11 +14,11 @@ class ConnectionManager {
|
|||
private connexionType?: GameConnexionTypes
|
||||
private reconnectingTimeout: NodeJS.Timeout|null = null;
|
||||
private _unloading:boolean = false;
|
||||
|
||||
|
||||
get unloading () {
|
||||
return this._unloading;
|
||||
}
|
||||
|
||||
|
||||
constructor() {
|
||||
window.addEventListener('beforeunload', () => {
|
||||
this._unloading = true;
|
||||
|
@ -42,7 +42,7 @@ class ConnectionManager {
|
|||
const worldSlug = data.worldSlug;
|
||||
const roomSlug = data.roomSlug;
|
||||
|
||||
const room = new Room('/@/'+organizationSlug+'/'+worldSlug+'/'+roomSlug + window.location.hash);
|
||||
const room = new Room('/@/'+organizationSlug+'/'+worldSlug+'/'+roomSlug + window.location.search + window.location.hash);
|
||||
urlManager.pushRoomIdToUrl(room);
|
||||
return Promise.resolve(room);
|
||||
} else if (connexionType === GameConnexionTypes.organization || connexionType === GameConnexionTypes.anonymous || connexionType === GameConnexionTypes.empty) {
|
||||
|
@ -64,7 +64,7 @@ class ConnectionManager {
|
|||
if (connexionType === GameConnexionTypes.empty) {
|
||||
roomId = START_ROOM_URL;
|
||||
} else {
|
||||
roomId = window.location.pathname + window.location.hash;
|
||||
roomId = window.location.pathname + window.location.search + window.location.hash;
|
||||
}
|
||||
return Promise.resolve(new Room(roomId));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue