Release 1.9.6 (#2021)
* Change accès token with query privateAccessToken in the url Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com> * Add play uri param Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com> * PlayUri parameter Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com> * removed unused imports * send group userIds to players * sending info about group lock state. wip * listening to lockGroupMessage on front * cleanup * Updating GroupDescriptors on LockGroupMessage * remove console logs * group circles with color fill * fix GameRoom text * remove obsolete check * cr fixes #1 wip * much cleaner approach to group lock update * fix compilation error * well-known values wip * Removing old unused images Just a bit of cleanup! * update with dan suggest Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com> * Change roomId by playUri Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com> * hide voice indicator for player leaving still existing bubble conversation * Refactor access by token Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com> * Refactor connexion manager Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com> * Adds settings options and localUser functions * PrivacyShutdownStore modifies constraints according to the user's setting * switches dropdown for checkboxes and adjusts wording * Adds the todo about German translation * Adds test map * Makes the default setting: camera off and mic on * Add z-index on embeds screens and action menu * Fixes tileset import * Adds settings options and localUser functions * PrivacyShutdownStore modifies constraints according to the user's setting * switches dropdown for checkboxes and adjusts wording * Adds the todo about German translation * Adds test map * Makes the default setting: camera off and mic on * Fixes tileset import * Applying German translation, thanks to @Lurkars * removed obsolete console.log * fix linter issues * make use of proto well knows types * fixed types for RoomConnection * fix locking bubble when returning from away mode * Fix run pretty Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com> * prevent actions menu from appearing when inserting space key on chat * Bump ansi-regex from 4.1.0 to 4.1.1 in /maps Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/chalk/ansi-regex/releases) - [Commits](https://github.com/chalk/ansi-regex/compare/v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: ansi-regex dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Bump minimist from 1.2.5 to 1.2.6 in /desktop/local-app Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Bump ansi-regex from 4.1.0 to 4.1.1 in /desktop/electron Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/chalk/ansi-regex/releases) - [Commits](https://github.com/chalk/ansi-regex/compare/v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: ansi-regex dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Bump ansi-regex from 4.1.0 to 4.1.1 in /uploader Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/chalk/ansi-regex/releases) - [Commits](https://github.com/chalk/ansi-regex/compare/v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: ansi-regex dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Bump plist from 3.0.4 to 3.0.5 in /desktop/electron Bumps [plist](https://github.com/TooTallNate/node-plist) from 3.0.4 to 3.0.5. - [Release notes](https://github.com/TooTallNate/node-plist/releases) - [Changelog](https://github.com/TooTallNate/plist.js/blob/master/History.md) - [Commits](https://github.com/TooTallNate/node-plist/commits) --- updated-dependencies: - dependency-name: plist dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Hanusiak Piotr <piotr@ltmp.co> Co-authored-by: David Négrier <d.negrier@thecodingmachine.com> Co-authored-by: Piotr 'pwh' Hanusiak <p.hanusiak@workadventu.re> Co-authored-by: Benedicte Quimbert <b.quimbert@workadventu.re> Co-authored-by: Alexis Faizeau <a.faizeau@workadventu.re> Co-authored-by: Bénédicte Q <37311765+HimeShaman@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
@@ -77,6 +77,7 @@
|
||||
height: max-content !important;
|
||||
max-height: 40vh;
|
||||
margin-top: 200px;
|
||||
z-index: 425;
|
||||
|
||||
pointer-events: auto;
|
||||
font-family: "Press Start 2P";
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
import layoutPresentationImg from "./images/layout-presentation.svg";
|
||||
import layoutChatImg from "./images/layout-chat.svg";
|
||||
import followImg from "./images/follow.svg";
|
||||
import lockImg from "./images/lock.svg";
|
||||
import { LayoutMode } from "../WebRtc/LayoutManager";
|
||||
import { peerStore } from "../Stores/PeerStore";
|
||||
import { onDestroy } from "svelte";
|
||||
import { embedScreenLayout } from "../Stores/EmbedScreensStore";
|
||||
import { followRoleStore, followStateStore, followUsersStore } from "../Stores/FollowStore";
|
||||
import { gameManager } from "../Phaser/Game/GameManager";
|
||||
import { currentPlayerGroupLockStateStore } from "../Stores/CurrentPlayerGroupStore";
|
||||
|
||||
const gameScene = gameManager.getCurrentGameScene();
|
||||
|
||||
@@ -70,6 +72,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
function lockClick() {
|
||||
gameScene.connection?.emitLockGroup(!$currentPlayerGroupLockStateStore);
|
||||
}
|
||||
|
||||
let isSilent: boolean;
|
||||
const unsubscribeIsSilent = isSilentStore.subscribe((value) => {
|
||||
isSilent = value;
|
||||
@@ -95,6 +101,15 @@
|
||||
<img class="noselect" src={followImg} alt="" />
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="btn-lock"
|
||||
class:hide={$peerStore.size === 0 || isSilent}
|
||||
class:disabled={$currentPlayerGroupLockStateStore}
|
||||
on:click={lockClick}
|
||||
>
|
||||
<img class="noselect" src={lockImg} alt="" />
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="btn-monitor"
|
||||
on:click={screenSharingClick}
|
||||
@@ -162,7 +177,7 @@
|
||||
transform: translateY(15px);
|
||||
transition-timing-function: ease-in-out;
|
||||
transition: all 0.3s;
|
||||
margin: 0 4%;
|
||||
margin: 0 2%;
|
||||
|
||||
&.hide {
|
||||
transform: translateY(60px);
|
||||
@@ -211,6 +226,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
.btn-lock {
|
||||
pointer-events: auto;
|
||||
|
||||
img {
|
||||
filter: brightness(0) invert(1);
|
||||
}
|
||||
}
|
||||
|
||||
@media (hover: none) {
|
||||
/**
|
||||
* If we cannot hover over elements, let's display camera button in full.
|
||||
|
||||
@@ -18,5 +18,7 @@
|
||||
display: flex;
|
||||
padding-top: 2%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
z-index: 200;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Components ordered by z-index -->
|
||||
<div id="main-layout" bind:this={mainLayout}>
|
||||
<aside id="main-layout-left-aside">
|
||||
{#if $menuIconVisiblilityStore}
|
||||
@@ -104,14 +105,14 @@
|
||||
<ShareLinkMapModal />
|
||||
{/if}
|
||||
|
||||
{#if $followStateStore !== "off" || $peerStore.size > 0}
|
||||
<FollowMenu />
|
||||
{/if}
|
||||
|
||||
{#if $actionsMenuStore}
|
||||
<ActionsMenu />
|
||||
{/if}
|
||||
|
||||
{#if $followStateStore !== "off" || $peerStore.size > 0}
|
||||
<FollowMenu />
|
||||
{/if}
|
||||
|
||||
{#if $requestVisitCardsStore}
|
||||
<VisitCard visitCardUrl={$requestVisitCardsStore} />
|
||||
{/if}
|
||||
|
||||
@@ -17,9 +17,14 @@
|
||||
let valueGame: number = localUserStore.getGameQualityValue();
|
||||
let valueVideo: number = localUserStore.getVideoQualityValue();
|
||||
let valueLocale: string = $locale;
|
||||
let valueCameraPrivacySettings = localUserStore.getCameraPrivacySettings();
|
||||
let valueMicrophonePrivacySettings = localUserStore.getMicrophonePrivacySettings();
|
||||
|
||||
let previewValueGame = valueGame;
|
||||
let previewValueVideo = valueVideo;
|
||||
let previewValueLocale = valueLocale;
|
||||
let previewCameraPrivacySettings = valueCameraPrivacySettings;
|
||||
let previewMicrophonePrivacySettings = valueMicrophonePrivacySettings;
|
||||
|
||||
function saveSetting() {
|
||||
let change = false;
|
||||
@@ -40,6 +45,16 @@
|
||||
change = true;
|
||||
}
|
||||
|
||||
if (valueCameraPrivacySettings !== previewCameraPrivacySettings) {
|
||||
previewCameraPrivacySettings = valueCameraPrivacySettings;
|
||||
localUserStore.setCameraPrivacySettings(valueCameraPrivacySettings);
|
||||
}
|
||||
|
||||
if (valueMicrophonePrivacySettings !== previewMicrophonePrivacySettings) {
|
||||
previewMicrophonePrivacySettings = valueMicrophonePrivacySettings;
|
||||
localUserStore.setMicrophonePrivacySettings(valueMicrophonePrivacySettings);
|
||||
}
|
||||
|
||||
audioManagerVolumeStore.setDecreaseWhileTalking(decreaseAudioPlayerVolumeWhileTalking);
|
||||
|
||||
if (change) {
|
||||
@@ -162,6 +177,19 @@
|
||||
</select>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3>{$LL.menu.settings.privacySettings.title()}</h3>
|
||||
<p>{$LL.menu.settings.privacySettings.explanation()}</p>
|
||||
<label>
|
||||
<input type="checkbox" class="nes-checkbox is-dark" bind:checked={valueCameraPrivacySettings} />
|
||||
<span>{$LL.menu.settings.privacySettings.cameraToggle()}</span>
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" class="nes-checkbox is-dark" bind:checked={valueMicrophonePrivacySettings} />
|
||||
<span>{$LL.menu.settings.privacySettings.microphoneToggle()}</span>
|
||||
</label>
|
||||
</section>
|
||||
<section class="settings-section-save">
|
||||
<p>{$LL.menu.settings.save.warning()}</p>
|
||||
<button type="button" class="nes-btn is-primary" on:click|preventDefault={saveSetting}
|
||||
@@ -204,15 +232,15 @@
|
||||
on:change={changeIgnoreFollowRequests}
|
||||
/>
|
||||
<span>{$LL.menu.settings.ignoreFollowRequest()}</span>
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="nes-checkbox is-dark"
|
||||
bind:checked={decreaseAudioPlayerVolumeWhileTalking}
|
||||
on:change={changeDecreaseAudioPlayerVolumeWhileTalking}
|
||||
/>
|
||||
<span>{$LL.audio.manager.reduce()}</span>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="nes-checkbox is-dark"
|
||||
bind:checked={decreaseAudioPlayerVolumeWhileTalking}
|
||||
on:change={changeDecreaseAudioPlayerVolumeWhileTalking}
|
||||
/>
|
||||
<span>{$LL.audio.manager.reduce()}</span>
|
||||
</label>
|
||||
</label>
|
||||
</section>
|
||||
</div>
|
||||
@@ -234,12 +262,15 @@
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
section.settings-section-save {
|
||||
text-align: center;
|
||||
|
||||
p {
|
||||
margin: 16px 0;
|
||||
}
|
||||
}
|
||||
|
||||
section.settings-section-noSaveOption {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
transform: translate(-50%, 0);
|
||||
margin-top: 200px;
|
||||
max-width: 80vw;
|
||||
z-index: 350;
|
||||
|
||||
iframe {
|
||||
border: 0;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="50px" height="50px"><path d="M 25 3 C 18.363281 3 13 8.363281 13 15 L 13 20 L 9 20 C 7.355469 20 6 21.355469 6 23 L 6 47 C 6 48.644531 7.355469 50 9 50 L 41 50 C 42.644531 50 44 48.644531 44 47 L 44 23 C 44 21.355469 42.644531 20 41 20 L 37 20 L 37 15 C 37 8.363281 31.636719 3 25 3 Z M 25 5 C 30.566406 5 35 9.433594 35 15 L 35 20 L 15 20 L 15 15 C 15 9.433594 19.433594 5 25 5 Z M 9 22 L 41 22 C 41.554688 22 42 22.445313 42 23 L 42 47 C 42 47.554688 41.554688 48 41 48 L 9 48 C 8.445313 48 8 47.554688 8 47 L 8 23 C 8 22.445313 8.445313 22 9 22 Z M 25 30 C 23.300781 30 22 31.300781 22 33 C 22 33.898438 22.398438 34.6875 23 35.1875 L 23 38 C 23 39.101563 23.898438 40 25 40 C 26.101563 40 27 39.101563 27 38 L 27 35.1875 C 27.601563 34.6875 28 33.898438 28 33 C 28 31.300781 26.699219 30 25 30 Z"/></svg>
|
||||
|
After Width: | Height: | Size: 891 B |
@@ -1,5 +1,5 @@
|
||||
import { Subject } from "rxjs";
|
||||
import type { BanUserMessage, SendUserMessage } from "../Messages/ts-proto-generated/messages";
|
||||
import type { BanUserMessage, SendUserMessage } from "../Messages/ts-proto-generated/protos/messages";
|
||||
|
||||
export enum AdminMessageEventTypes {
|
||||
admin = "message",
|
||||
|
||||
@@ -88,8 +88,7 @@ class ConnectionManager {
|
||||
* @return returns a promise to the Room we are going to load OR a pointer to the URL we must redirect to if authentication is needed.
|
||||
*/
|
||||
public async initGameConnexion(): Promise<Room | URL> {
|
||||
const connexionType = urlManager.getGameConnexionType();
|
||||
this.connexionType = connexionType;
|
||||
this.connexionType = urlManager.getGameConnexionType();
|
||||
this._currentRoom = null;
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
@@ -102,14 +101,15 @@ class ConnectionManager {
|
||||
urlParams.delete("token");
|
||||
}
|
||||
|
||||
if (connexionType === GameConnexionTypes.login) {
|
||||
if (this.connexionType === GameConnexionTypes.login) {
|
||||
this._currentRoom = await Room.createRoom(new URL(localUserStore.getLastRoomUrl()));
|
||||
const redirect = this.loadOpenIDScreen();
|
||||
if (redirect !== null) {
|
||||
return redirect;
|
||||
}
|
||||
urlManager.pushRoomIdToUrl(this._currentRoom);
|
||||
} else if (connexionType === GameConnexionTypes.jwt) {
|
||||
} else if (this.connexionType === GameConnexionTypes.jwt) {
|
||||
/** @deprecated */
|
||||
if (!token) {
|
||||
const code = urlParams.get("code");
|
||||
const state = urlParams.get("state");
|
||||
@@ -135,8 +135,9 @@ class ConnectionManager {
|
||||
return redirect;
|
||||
}
|
||||
urlManager.pushRoomIdToUrl(this._currentRoom);
|
||||
} else if (connexionType === GameConnexionTypes.register) {
|
||||
//@deprecated
|
||||
}
|
||||
//@deprecated
|
||||
else if (this.connexionType === GameConnexionTypes.register) {
|
||||
const organizationMemberToken = urlManager.getOrganizationToken();
|
||||
const data = await Axios.post(`${PUSHER_URL}/register`, { organizationMemberToken }).then(
|
||||
(res) => res.data
|
||||
@@ -165,11 +166,11 @@ class ConnectionManager {
|
||||
)
|
||||
);
|
||||
urlManager.pushRoomIdToUrl(this._currentRoom);
|
||||
} else if (connexionType === GameConnexionTypes.room || connexionType === GameConnexionTypes.empty) {
|
||||
} else if (this.connexionType === GameConnexionTypes.room || this.connexionType === GameConnexionTypes.empty) {
|
||||
this.authToken = localUserStore.getAuthToken();
|
||||
|
||||
let roomPath: string;
|
||||
if (connexionType === GameConnexionTypes.empty) {
|
||||
if (this.connexionType === GameConnexionTypes.empty) {
|
||||
roomPath = localUserStore.getLastRoomUrl();
|
||||
//get last room path from cache api
|
||||
try {
|
||||
|
||||
@@ -43,7 +43,13 @@ export interface PositionInterface {
|
||||
export interface GroupCreatedUpdatedMessageInterface {
|
||||
position: PositionInterface;
|
||||
groupId: number;
|
||||
groupSize: number;
|
||||
groupSize?: number;
|
||||
locked?: boolean;
|
||||
}
|
||||
|
||||
export interface GroupUsersUpdateMessageInterface {
|
||||
groupId: number;
|
||||
userIds: number[];
|
||||
}
|
||||
|
||||
export interface WebRtcDisconnectMessageInterface {
|
||||
|
||||
@@ -25,11 +25,14 @@ const code = "code";
|
||||
const cameraSetup = "cameraSetup";
|
||||
const cacheAPIIndex = "workavdenture-cache";
|
||||
const userProperties = "user-properties";
|
||||
const cameraPrivacySettings = "cameraPrivacySettings";
|
||||
const microphonePrivacySettings = "microphonePrivacySettings";
|
||||
|
||||
class LocalUserStore {
|
||||
saveUser(localUser: LocalUser) {
|
||||
localStorage.setItem("localUser", JSON.stringify(localUser));
|
||||
}
|
||||
|
||||
getLocalUser(): LocalUser | null {
|
||||
const data = localStorage.getItem("localUser");
|
||||
return data ? JSON.parse(data) : null;
|
||||
@@ -38,6 +41,7 @@ class LocalUserStore {
|
||||
setName(name: string): void {
|
||||
localStorage.setItem(playerNameKey, name);
|
||||
}
|
||||
|
||||
getName(): string | null {
|
||||
const value = localStorage.getItem(playerNameKey) || "";
|
||||
return isUserNameValid(value) ? value : null;
|
||||
@@ -46,6 +50,7 @@ class LocalUserStore {
|
||||
setPlayerCharacterIndex(playerCharacterIndex: number): void {
|
||||
localStorage.setItem(selectedPlayerKey, "" + playerCharacterIndex);
|
||||
}
|
||||
|
||||
getPlayerCharacterIndex(): number {
|
||||
return parseInt(localStorage.getItem(selectedPlayerKey) || "");
|
||||
}
|
||||
@@ -53,6 +58,7 @@ class LocalUserStore {
|
||||
setCustomCursorPosition(activeRow: number, selectedLayers: number[]): void {
|
||||
localStorage.setItem(customCursorPositionKey, JSON.stringify({ activeRow, selectedLayers }));
|
||||
}
|
||||
|
||||
getCustomCursorPosition(): { activeRow: number; selectedLayers: number[] } | null {
|
||||
return JSON.parse(localStorage.getItem(customCursorPositionKey) || "null");
|
||||
}
|
||||
@@ -60,6 +66,7 @@ class LocalUserStore {
|
||||
setCharacterLayers(layers: string[]): void {
|
||||
localStorage.setItem(characterLayersKey, JSON.stringify(layers));
|
||||
}
|
||||
|
||||
getCharacterLayers(): string[] | null {
|
||||
const value = JSON.parse(localStorage.getItem(characterLayersKey) || "null");
|
||||
return areCharacterLayersValid(value) ? value : null;
|
||||
@@ -68,6 +75,7 @@ class LocalUserStore {
|
||||
setCompanion(companion: string | null): void {
|
||||
return localStorage.setItem(companionKey, JSON.stringify(companion));
|
||||
}
|
||||
|
||||
getCompanion(): string | null {
|
||||
const companion = JSON.parse(localStorage.getItem(companionKey) || "null");
|
||||
|
||||
@@ -77,6 +85,7 @@ class LocalUserStore {
|
||||
|
||||
return companion;
|
||||
}
|
||||
|
||||
wasCompanionSet(): boolean {
|
||||
return localStorage.getItem(companionKey) ? true : false;
|
||||
}
|
||||
@@ -84,6 +93,7 @@ class LocalUserStore {
|
||||
setGameQualityValue(value: number): void {
|
||||
localStorage.setItem(gameQualityKey, "" + value);
|
||||
}
|
||||
|
||||
getGameQualityValue(): number {
|
||||
return parseInt(localStorage.getItem(gameQualityKey) || "60");
|
||||
}
|
||||
@@ -91,6 +101,7 @@ class LocalUserStore {
|
||||
setVideoQualityValue(value: number): void {
|
||||
localStorage.setItem(videoQualityKey, "" + value);
|
||||
}
|
||||
|
||||
getVideoQualityValue(): number {
|
||||
return parseInt(localStorage.getItem(videoQualityKey) || "20");
|
||||
}
|
||||
@@ -98,6 +109,7 @@ class LocalUserStore {
|
||||
setAudioPlayerVolume(value: number): void {
|
||||
localStorage.setItem(audioPlayerVolumeKey, "" + value);
|
||||
}
|
||||
|
||||
getAudioPlayerVolume(): number {
|
||||
return parseFloat(localStorage.getItem(audioPlayerVolumeKey) || "1");
|
||||
}
|
||||
@@ -105,6 +117,7 @@ class LocalUserStore {
|
||||
setAudioPlayerMuted(value: boolean): void {
|
||||
localStorage.setItem(audioPlayerMuteKey, value.toString());
|
||||
}
|
||||
|
||||
getAudioPlayerMuted(): boolean {
|
||||
return localStorage.getItem(audioPlayerMuteKey) === "true";
|
||||
}
|
||||
@@ -112,6 +125,7 @@ class LocalUserStore {
|
||||
setHelpCameraSettingsShown(): void {
|
||||
localStorage.setItem(helpCameraSettingsShown, "1");
|
||||
}
|
||||
|
||||
getHelpCameraSettingsShown(): boolean {
|
||||
return localStorage.getItem(helpCameraSettingsShown) === "1";
|
||||
}
|
||||
@@ -119,6 +133,7 @@ class LocalUserStore {
|
||||
setFullscreen(value: boolean): void {
|
||||
localStorage.setItem(fullscreenKey, value.toString());
|
||||
}
|
||||
|
||||
getFullscreen(): boolean {
|
||||
return localStorage.getItem(fullscreenKey) === "true";
|
||||
}
|
||||
@@ -126,6 +141,7 @@ class LocalUserStore {
|
||||
setForceCowebsiteTrigger(value: boolean): void {
|
||||
localStorage.setItem(forceCowebsiteTriggerKey, value.toString());
|
||||
}
|
||||
|
||||
getForceCowebsiteTrigger(): boolean {
|
||||
return localStorage.getItem(forceCowebsiteTriggerKey) === "true";
|
||||
}
|
||||
@@ -133,6 +149,7 @@ class LocalUserStore {
|
||||
setIgnoreFollowRequests(value: boolean): void {
|
||||
localStorage.setItem(ignoreFollowRequests, value.toString());
|
||||
}
|
||||
|
||||
getIgnoreFollowRequests(): boolean {
|
||||
return localStorage.getItem(ignoreFollowRequests) === "true";
|
||||
}
|
||||
@@ -155,11 +172,13 @@ class LocalUserStore {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getLastRoomUrl(): string {
|
||||
return (
|
||||
localStorage.getItem(lastRoomUrl) ?? window.location.protocol + "//" + window.location.host + START_ROOM_URL
|
||||
);
|
||||
}
|
||||
|
||||
getLastRoomUrlCacheApi(): Promise<string | undefined> {
|
||||
if (!("caches" in window)) {
|
||||
return Promise.resolve(undefined);
|
||||
@@ -176,6 +195,7 @@ class LocalUserStore {
|
||||
setAuthToken(value: string | null) {
|
||||
value ? localStorage.setItem(authToken, value) : localStorage.removeItem(authToken);
|
||||
}
|
||||
|
||||
getAuthToken(): string | null {
|
||||
return localStorage.getItem(authToken);
|
||||
}
|
||||
@@ -202,23 +222,29 @@ class LocalUserStore {
|
||||
}
|
||||
return oldValue === value;
|
||||
}
|
||||
|
||||
setState(value: string) {
|
||||
localStorage.setItem(state, value);
|
||||
}
|
||||
|
||||
getState(): string | null {
|
||||
return localStorage.getItem(state);
|
||||
}
|
||||
|
||||
generateNonce(): string {
|
||||
const newNonce = uuidv4();
|
||||
localStorage.setItem(nonce, newNonce);
|
||||
return newNonce;
|
||||
}
|
||||
|
||||
getNonce(): string | null {
|
||||
return localStorage.getItem(nonce);
|
||||
}
|
||||
|
||||
setCode(value: string): void {
|
||||
localStorage.setItem(code, value);
|
||||
}
|
||||
|
||||
getCode(): string | null {
|
||||
return localStorage.getItem(code);
|
||||
}
|
||||
@@ -226,11 +252,36 @@ class LocalUserStore {
|
||||
setCameraSetup(cameraId: string) {
|
||||
localStorage.setItem(cameraSetup, cameraId);
|
||||
}
|
||||
|
||||
getCameraSetup(): { video: unknown; audio: unknown } | undefined {
|
||||
const cameraSetupValues = localStorage.getItem(cameraSetup);
|
||||
return cameraSetupValues != undefined ? JSON.parse(cameraSetupValues) : undefined;
|
||||
}
|
||||
|
||||
setCameraPrivacySettings(option: boolean) {
|
||||
localStorage.setItem(cameraPrivacySettings, option.toString());
|
||||
}
|
||||
|
||||
getCameraPrivacySettings() {
|
||||
//if this setting doesn't exist in LocalUserStore, we set a default value
|
||||
if (localStorage.getItem(cameraPrivacySettings) == null) {
|
||||
localStorage.setItem(cameraPrivacySettings, "false");
|
||||
}
|
||||
return localStorage.getItem(cameraPrivacySettings) === "true";
|
||||
}
|
||||
|
||||
setMicrophonePrivacySettings(option: boolean) {
|
||||
localStorage.setItem(microphonePrivacySettings, option.toString());
|
||||
}
|
||||
|
||||
getMicrophonePrivacySettings() {
|
||||
//if this setting doesn't exist in LocalUserStore, we set a default value
|
||||
if (localStorage.getItem(microphonePrivacySettings) == null) {
|
||||
localStorage.setItem(microphonePrivacySettings, "true");
|
||||
}
|
||||
return localStorage.getItem(microphonePrivacySettings) === "true";
|
||||
}
|
||||
|
||||
getAllUserProperties(): Map<string, unknown> {
|
||||
const result = new Map<string, string>();
|
||||
for (let i = 0; i < localStorage.length; i++) {
|
||||
|
||||
@@ -5,47 +5,35 @@ import type { UserSimplePeerInterface } from "../WebRtc/SimplePeer";
|
||||
import { ProtobufClientUtils } from "../Network/ProtobufClientUtils";
|
||||
import type {
|
||||
GroupCreatedUpdatedMessageInterface,
|
||||
ItemEventMessageInterface,
|
||||
GroupUsersUpdateMessageInterface,
|
||||
MessageUserJoined,
|
||||
OnConnectInterface,
|
||||
PlayerDetailsUpdatedMessageInterface,
|
||||
PlayGlobalMessageInterface,
|
||||
PositionInterface,
|
||||
RoomJoinedMessageInterface,
|
||||
ViewportInterface,
|
||||
WebRtcDisconnectMessageInterface,
|
||||
WebRtcSignalReceivedMessageInterface,
|
||||
} from "./ConnexionModels";
|
||||
import type { BodyResourceDescriptionInterface } from "../Phaser/Entity/PlayerTextures";
|
||||
import { adminMessagesService } from "./AdminMessagesService";
|
||||
import { connectionManager } from "./ConnectionManager";
|
||||
import { get } from "svelte/store";
|
||||
import { followRoleStore, followUsersStore } from "../Stores/FollowStore";
|
||||
import { menuIconVisiblilityStore, menuVisiblilityStore, warningContainerStore } from "../Stores/MenuStore";
|
||||
import { followStateStore, followRoleStore, followUsersStore } from "../Stores/FollowStore";
|
||||
import { localUserStore } from "./LocalUserStore";
|
||||
import {
|
||||
RefreshRoomMessage,
|
||||
ServerToClientMessage as ServerToClientMessageTsProto,
|
||||
TokenExpiredMessage,
|
||||
WorldConnexionMessage,
|
||||
WorldFullMessage,
|
||||
ErrorMessage as ErrorMessageTsProto,
|
||||
UserMovedMessage as UserMovedMessageTsProto,
|
||||
GroupUpdateMessage as GroupUpdateMessageTsProto,
|
||||
GroupDeleteMessage as GroupDeleteMessageTsProto,
|
||||
UserJoinedMessage as UserJoinedMessageTsProto,
|
||||
UserLeftMessage as UserLeftMessageTsProto,
|
||||
ItemEventMessage as ItemEventMessageTsProto,
|
||||
EmoteEventMessage as EmoteEventMessageTsProto,
|
||||
VariableMessage as VariableMessageTsProto,
|
||||
PlayerDetailsUpdatedMessage as PlayerDetailsUpdatedMessageTsProto,
|
||||
WorldFullWarningMessage,
|
||||
WebRtcDisconnectMessage as WebRtcDisconnectMessageTsProto,
|
||||
PlayGlobalMessage as PlayGlobalMessageTsProto,
|
||||
StopGlobalMessage as StopGlobalMessageTsProto,
|
||||
SendJitsiJwtMessage as SendJitsiJwtMessageTsProto,
|
||||
SendUserMessage as SendUserMessageTsProto,
|
||||
BanUserMessage as BanUserMessageTsProto,
|
||||
ClientToServerMessage as ClientToServerMessageTsProto,
|
||||
PositionMessage as PositionMessageTsProto,
|
||||
ViewportMessage as ViewportMessageTsProto,
|
||||
@@ -53,10 +41,8 @@ import {
|
||||
SetPlayerDetailsMessage as SetPlayerDetailsMessageTsProto,
|
||||
PingMessage as PingMessageTsProto,
|
||||
CharacterLayerMessage,
|
||||
} from "../Messages/ts-proto-generated/messages";
|
||||
} from "../Messages/ts-proto-generated/protos/messages";
|
||||
import { Subject } from "rxjs";
|
||||
import { OpenPopupEvent } from "../Api/Events/OpenPopupEvent";
|
||||
import { match } from "assert";
|
||||
import { selectCharacterSceneVisibleStore } from "../Stores/SelectCharacterStore";
|
||||
import { gameManager } from "../Phaser/Game/GameManager";
|
||||
import { SelectCharacterScene, SelectCharacterSceneName } from "../Phaser/Login/SelectCharacterScene";
|
||||
@@ -116,6 +102,9 @@ export class RoomConnection implements RoomConnection {
|
||||
private readonly _groupUpdateMessageStream = new Subject<GroupCreatedUpdatedMessageInterface>();
|
||||
public readonly groupUpdateMessageStream = this._groupUpdateMessageStream.asObservable();
|
||||
|
||||
private readonly _groupUsersUpdateMessageStream = new Subject<GroupUsersUpdateMessageInterface>();
|
||||
public readonly groupUsersUpdateMessageStream = this._groupUsersUpdateMessageStream.asObservable();
|
||||
|
||||
private readonly _groupDeleteMessageStream = new Subject<GroupDeleteMessageTsProto>();
|
||||
public readonly groupDeleteMessageStream = this._groupDeleteMessageStream.asObservable();
|
||||
|
||||
@@ -443,6 +432,10 @@ export class RoomConnection implements RoomConnection {
|
||||
this._sendJitsiJwtMessageStream.next(message.sendJitsiJwtMessage);
|
||||
break;
|
||||
}
|
||||
case "groupUsersUpdateMessage": {
|
||||
this._groupUsersUpdateMessageStream.next(message.groupUsersUpdateMessage);
|
||||
break;
|
||||
}
|
||||
case "sendUserMessage": {
|
||||
adminMessagesService.onSendusermessage(message.sendUserMessage);
|
||||
break;
|
||||
@@ -675,6 +668,7 @@ export class RoomConnection implements RoomConnection {
|
||||
groupId: message.groupId,
|
||||
position: position,
|
||||
groupSize: message.groupSize,
|
||||
locked: message.locked,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -890,6 +884,19 @@ export class RoomConnection implements RoomConnection {
|
||||
this.socket.send(bytes);
|
||||
}
|
||||
|
||||
public emitLockGroup(lock: boolean = true): void {
|
||||
const bytes = ClientToServerMessageTsProto.encode({
|
||||
message: {
|
||||
$case: "lockGroupPromptMessage",
|
||||
lockGroupPromptMessage: {
|
||||
lock,
|
||||
},
|
||||
},
|
||||
}).finish();
|
||||
|
||||
this.socket.send(bytes);
|
||||
}
|
||||
|
||||
public getAllTags(): string[] {
|
||||
return this.tags;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PositionMessage, PositionMessage_Direction } from "../Messages/ts-proto-generated/messages";
|
||||
import { PositionMessage, PositionMessage_Direction } from "../Messages/ts-proto-generated/protos/messages";
|
||||
|
||||
import type { PointInterface } from "../Connexion/ConnexionModels";
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ import { userIsAdminStore } from "../../Stores/GameStore";
|
||||
import { contactPageStore } from "../../Stores/MenuStore";
|
||||
import type { WasCameraUpdatedEvent } from "../../Api/Events/WasCameraUpdatedEvent";
|
||||
import { audioManagerFileStore } from "../../Stores/AudioManagerStore";
|
||||
import { currentPlayerGroupLockStateStore } from "../../Stores/CurrentPlayerGroupStore";
|
||||
|
||||
import EVENT_TYPE = Phaser.Scenes.Events;
|
||||
import Texture = Phaser.Textures.Texture;
|
||||
@@ -177,6 +178,7 @@ export class GameScene extends DirtyScene {
|
||||
private volumeStoreUnsubscribers: Map<number, Unsubscriber> = new Map<number, Unsubscriber>();
|
||||
private localVolumeStoreUnsubscriber: Unsubscriber | undefined;
|
||||
private followUsersColorStoreUnsubscribe!: Unsubscriber;
|
||||
private currentPlayerGroupIdStoreUnsubscribe!: Unsubscriber;
|
||||
|
||||
private biggestAvailableAreaStoreUnsubscribe!: () => void;
|
||||
MapUrlFile: string;
|
||||
@@ -218,6 +220,7 @@ export class GameScene extends DirtyScene {
|
||||
private loader: Loader;
|
||||
private lastCameraEvent: WasCameraUpdatedEvent | undefined;
|
||||
private firstCameraUpdateSent: boolean = false;
|
||||
private currentPlayerGroupId?: number;
|
||||
public readonly superLoad: SuperLoaderPlugin;
|
||||
|
||||
constructor(private room: Room, MapUrlFile: string, customKey?: string | undefined) {
|
||||
@@ -839,6 +842,10 @@ export class GameScene extends DirtyScene {
|
||||
});
|
||||
});
|
||||
|
||||
this.connection.groupUsersUpdateMessageStream.subscribe((message) => {
|
||||
this.currentPlayerGroupId = message.groupId;
|
||||
});
|
||||
|
||||
/**
|
||||
* Triggered when we receive the JWT token to connect to Jitsi
|
||||
*/
|
||||
@@ -969,7 +976,9 @@ export class GameScene extends DirtyScene {
|
||||
context.arc(48, 48, 48, 0, 2 * Math.PI, false);
|
||||
// context.lineWidth = 5;
|
||||
context.strokeStyle = "#ffffff";
|
||||
context.fillStyle = "#ffffff44";
|
||||
context.stroke();
|
||||
context.fill();
|
||||
this.circleTexture.refresh();
|
||||
|
||||
//create red circle canvas use to create sprite
|
||||
@@ -979,7 +988,9 @@ export class GameScene extends DirtyScene {
|
||||
contextRed.arc(48, 48, 48, 0, 2 * Math.PI, false);
|
||||
//context.lineWidth = 5;
|
||||
contextRed.strokeStyle = "#ff0000";
|
||||
contextRed.fillStyle = "#ff000044";
|
||||
contextRed.stroke();
|
||||
contextRed.fill();
|
||||
this.circleRedTexture.refresh();
|
||||
}
|
||||
|
||||
@@ -1849,12 +1860,14 @@ ${escapedMessage}
|
||||
case "GroupCreatedUpdatedEvent":
|
||||
this.doShareGroupPosition(event.event);
|
||||
break;
|
||||
case "DeleteGroupEvent":
|
||||
this.doDeleteGroup(event.groupId);
|
||||
break;
|
||||
case "PlayerDetailsUpdated":
|
||||
this.doUpdatePlayerDetails(event.details);
|
||||
break;
|
||||
case "DeleteGroupEvent": {
|
||||
this.doDeleteGroup(event.groupId);
|
||||
currentPlayerGroupLockStateStore.set(undefined);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
const tmp: never = event;
|
||||
}
|
||||
@@ -2028,11 +2041,16 @@ ${escapedMessage}
|
||||
this,
|
||||
Math.round(groupPositionMessage.position.x),
|
||||
Math.round(groupPositionMessage.position.y),
|
||||
groupPositionMessage.groupSize === MAX_PER_GROUP ? "circleSprite-red" : "circleSprite-white"
|
||||
groupPositionMessage.groupSize === MAX_PER_GROUP || groupPositionMessage.locked
|
||||
? "circleSprite-red"
|
||||
: "circleSprite-white"
|
||||
);
|
||||
sprite.setDisplayOrigin(48, 48);
|
||||
this.add.existing(sprite);
|
||||
this.groups.set(groupPositionMessage.groupId, sprite);
|
||||
if (this.currentPlayerGroupId === groupPositionMessage.groupId) {
|
||||
currentPlayerGroupLockStateStore.set(groupPositionMessage.locked);
|
||||
}
|
||||
return sprite;
|
||||
}
|
||||
|
||||
|
||||
@@ -280,6 +280,9 @@ export class UserInputManager {
|
||||
);
|
||||
|
||||
this.scene.input.keyboard.on("keyup-SPACE", (event: Event) => {
|
||||
if (this.isInputDisabled) {
|
||||
return;
|
||||
}
|
||||
this.userInputHandler.handleSpaceKeyUpEvent(event);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
import { writable } from "svelte/store";
|
||||
|
||||
export const currentPlayerGroupLockStateStore = writable<boolean | undefined>(undefined);
|
||||
@@ -11,7 +11,7 @@ import { peerStore } from "./PeerStore";
|
||||
import { privacyShutdownStore } from "./PrivacyShutdownStore";
|
||||
import { MediaStreamConstraintsError } from "./Errors/MediaStreamConstraintsError";
|
||||
import { SoundMeter } from "../Phaser/Components/SoundMeter";
|
||||
import { AudioContext } from "standardized-audio-context";
|
||||
import { visibilityStore } from "./VisibilityStore";
|
||||
|
||||
/**
|
||||
* A store that contains the camera state requested by the user (on or off).
|
||||
@@ -242,6 +242,7 @@ export const mediaStreamConstraintsStore = derived(
|
||||
privacyShutdownStore,
|
||||
cameraEnergySavingStore,
|
||||
isSilentStore,
|
||||
visibilityStore,
|
||||
],
|
||||
(
|
||||
[
|
||||
@@ -254,6 +255,7 @@ export const mediaStreamConstraintsStore = derived(
|
||||
$privacyShutdownStore,
|
||||
$cameraEnergySavingStore,
|
||||
$isSilentStore,
|
||||
$visibilityStore,
|
||||
],
|
||||
set
|
||||
) => {
|
||||
@@ -292,7 +294,14 @@ export const mediaStreamConstraintsStore = derived(
|
||||
|
||||
// Disable webcam for privacy reasons (the game is not visible and we were talking to no one)
|
||||
if ($privacyShutdownStore === true) {
|
||||
currentVideoConstraint = false;
|
||||
const userMicrophonePrivacySetting = localUserStore.getMicrophonePrivacySettings();
|
||||
const userCameraPrivacySetting = localUserStore.getCameraPrivacySettings();
|
||||
if (!userMicrophonePrivacySetting) {
|
||||
currentAudioConstraint = false;
|
||||
}
|
||||
if (!userCameraPrivacySetting) {
|
||||
currentVideoConstraint = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Disable webcam for energy reasons (the user is not moving and we are talking to no one)
|
||||
|
||||
@@ -3,10 +3,10 @@ import { localUserStore } from "../Connexion/LocalUserStore";
|
||||
|
||||
export enum GameConnexionTypes {
|
||||
room = 1,
|
||||
register,
|
||||
register /*@deprecated*/,
|
||||
empty,
|
||||
unknown,
|
||||
jwt,
|
||||
jwt /*@deprecated*/,
|
||||
login,
|
||||
}
|
||||
|
||||
@@ -16,11 +16,15 @@ class UrlManager {
|
||||
const url = window.location.pathname.toString();
|
||||
if (url === "/login") {
|
||||
return GameConnexionTypes.login;
|
||||
} else if (url === "/jwt") {
|
||||
}
|
||||
//@deprecated jwt url will be replace by "?token=<private access token>"
|
||||
else if (url === "/jwt") {
|
||||
return GameConnexionTypes.jwt;
|
||||
} else if (url.includes("_/") || url.includes("*/") || url.includes("@/")) {
|
||||
return GameConnexionTypes.room;
|
||||
} else if (url.includes("register/")) {
|
||||
}
|
||||
//@deprecated register url will be replace by "?token=<private access token>"
|
||||
else if (url.includes("register/")) {
|
||||
return GameConnexionTypes.register;
|
||||
} else if (url === "/") {
|
||||
return GameConnexionTypes.empty;
|
||||
@@ -29,6 +33,9 @@ class UrlManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public getOrganizationToken(): string | null {
|
||||
const match = /\/register\/(.+)/.exec(window.location.pathname.toString());
|
||||
return match ? match[1] : null;
|
||||
|
||||
@@ -57,6 +57,13 @@ const menu: NonNullable<Translation["menu"]> = {
|
||||
language: {
|
||||
title: "Sprache",
|
||||
},
|
||||
privacySettings: {
|
||||
title: "Einstellungen Abwesenheitsmodus",
|
||||
explanation:
|
||||
"Falls der WorkAdventure Tab nicht aktiv ist wird in den Abwesenheitsmodus umgeschaltet. Für diesen Modus kann eingestellt werden, ob die Kamera und/oder das Mikrofon deaktiviert sind solange der Tab nicht sichtbar ist.",
|
||||
cameraToggle: "Kamera",
|
||||
microphoneToggle: "Mikrofon",
|
||||
},
|
||||
save: {
|
||||
warning: "(Das Spiel wird nach dem Speichern neugestartet)",
|
||||
button: "Speichern",
|
||||
|
||||
@@ -57,6 +57,13 @@ const menu: BaseTranslation = {
|
||||
language: {
|
||||
title: "Language",
|
||||
},
|
||||
privacySettings: {
|
||||
title: "Away mode settings",
|
||||
explanation:
|
||||
'When the WorkAdventure tab is not visible, it switches to "away mode". In this mode, you can decide to automatically disable your webcam and/or microphone for as long as the tab stays hidden.',
|
||||
cameraToggle: "Camera",
|
||||
microphoneToggle: "Microphone",
|
||||
},
|
||||
save: {
|
||||
warning: "(Saving these settings will restart the game)",
|
||||
button: "Save",
|
||||
|
||||
@@ -57,6 +57,13 @@ const menu: NonNullable<Translation["menu"]> = {
|
||||
language: {
|
||||
title: "Langage",
|
||||
},
|
||||
privacySettings: {
|
||||
title: "Paramètres du mode absent",
|
||||
explanation:
|
||||
"Quand l'onglet WorkAdventure n'est pas visible, vous passez en \"mode absent\". Lorsque ce mode est actif, vous pouvez décider de garder vos webcam et/ou micro désactivés tant que vous ne revenez pas sur l'onglet",
|
||||
cameraToggle: "Camera",
|
||||
microphoneToggle: "Microphone",
|
||||
},
|
||||
save: {
|
||||
warning: "(La sauvegarde de ces paramètres redémarre le jeu)",
|
||||
button: "Sauvegarder",
|
||||
|
||||
Reference in New Issue
Block a user