From 31a0d08c7681f67c48b46733ced48d2ba071ae9a Mon Sep 17 00:00:00 2001 From: TabascoEye Date: Sat, 30 Jan 2021 02:13:03 +0100 Subject: [PATCH 01/16] disable automatic gain control on microphone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AGC really makes the soundqulity way worse than it could be. Especially since it is so noticeable when entering a Jitsi where AGC is disabled (and suddenly some people sound much better). In the long run, this should probably be configurable. On the other hand the setting changes the audio _going out_ from a user, so it might be hard for him to judge which settings are a good or a bad idea… --- front/src/WebRtc/MediaManager.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/front/src/WebRtc/MediaManager.ts b/front/src/WebRtc/MediaManager.ts index 1a84d4a9..10a505cd 100644 --- a/front/src/WebRtc/MediaManager.ts +++ b/front/src/WebRtc/MediaManager.ts @@ -18,6 +18,12 @@ let videoConstraint: boolean|MediaTrackConstraints = { resizeMode: 'crop-and-scale', aspectRatio: 1.777777778 }; +let audioConstraint: boolean|MediaTrackConstraints = { + //TODO: make these values configurable in the game settings menu and store them in localstorage + autoGainControl: false, + echoCancellation: true, + noiseSuppression: false +}; export type UpdatedLocalStreamCallback = (media: MediaStream|null) => void; export type StartScreenSharingCallback = (media: MediaStream) => void; @@ -40,7 +46,7 @@ export class MediaManager { webrtcInAudio: HTMLAudioElement; private webrtcOutAudio: HTMLAudioElement; constraintsMedia : MediaStreamConstraints = { - audio: true, + audio: audioConstraint, video: videoConstraint }; updatedLocalStreamCallBacks : Set = new Set(); From 58b7d85bf3037f1b8de2b88e578da6dc37cfd3dc Mon Sep 17 00:00:00 2001 From: TabascoEye Date: Sat, 30 Jan 2021 02:24:36 +0100 Subject: [PATCH 02/16] bugfix and linting * use 'const' on constraints which never change * also re-enable constraints ater mic was re-enabled (after mute/unmute) --- front/src/WebRtc/MediaManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/src/WebRtc/MediaManager.ts b/front/src/WebRtc/MediaManager.ts index 10a505cd..57879ca6 100644 --- a/front/src/WebRtc/MediaManager.ts +++ b/front/src/WebRtc/MediaManager.ts @@ -18,7 +18,7 @@ let videoConstraint: boolean|MediaTrackConstraints = { resizeMode: 'crop-and-scale', aspectRatio: 1.777777778 }; -let audioConstraint: boolean|MediaTrackConstraints = { +const audioConstraint: boolean|MediaTrackConstraints = { //TODO: make these values configurable in the game settings menu and store them in localstorage autoGainControl: false, echoCancellation: true, @@ -243,7 +243,7 @@ export class MediaManager { } public enableMicrophone() { - this.constraintsMedia.audio = true; + this.constraintsMedia.audio = audioConstraint; this.getCamera().then((stream) => { //TODO show error message tooltip upper of camera button From 4fc9a12b950b3be3d09aae980cb1faec09a08134 Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Mon, 12 Apr 2021 18:17:04 +0200 Subject: [PATCH 03/16] HotFix style WorkAdventure --- front/dist/resources/html/gameMenuIcon.html | 2 +- front/dist/resources/style/style.css | 39 +++++++++++---------- front/src/Phaser/Menu/MenuScene.ts | 6 +++- front/src/Phaser/Menu/ReportMenu.ts | 2 +- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/front/dist/resources/html/gameMenuIcon.html b/front/dist/resources/html/gameMenuIcon.html index 0df8ff80..946cb60a 100644 --- a/front/dist/resources/html/gameMenuIcon.html +++ b/front/dist/resources/html/gameMenuIcon.html @@ -8,7 +8,7 @@ } #menuIcon button img{ width: 14px; - padding-top: 3px; + padding-top: 0; cursor: url('/resources/logos/cursor_pointer.png'), pointer; } #menuIcon section { diff --git a/front/dist/resources/style/style.css b/front/dist/resources/style/style.css index ba5b6c07..010da692 100644 --- a/front/dist/resources/style/style.css +++ b/front/dist/resources/style/style.css @@ -44,13 +44,13 @@ body .message-info.warning{ .video-container i{ position: absolute; width: 100px; - height: 65px; + height: 100px; left: calc(50% - 50px); top: calc(50% - 50px); background-color: black; border-radius: 50%; text-align: center; - padding-top: 35px; + padding-top: 32px; font-size: 28px; color: white; } @@ -58,8 +58,8 @@ body .message-info.warning{ .video-container img{ position: absolute; display: none; - width: 25px; - height: 25px; + width: 40px; + height: 40px; left: 5px; bottom: 5px; padding: 10px; @@ -108,10 +108,12 @@ body .message-info.warning{ margin: 0; padding: 0; cursor: url('/resources/logos/cursor_pointer.png'), pointer; + width: 25px; + height: 25px; } .video-container button.report span{ position: absolute; - bottom: 8px; + bottom: 6px; left: 36px; color: white; font-size: 16px; @@ -211,8 +213,8 @@ video#myCamVideo{ .connecting-spinner { /*display: inline-block;*/ position: absolute; - left: calc(50% - 68px); - top: calc(50% - 68px); + left: calc(50% - 62px); + top: calc(50% - 62px); width: 130px; @@ -850,10 +852,10 @@ div.modal-report-user{ .modal-report-user img{ position: absolute; - height: 50px; - width: 50px; + height: 24px; + width: 24px; z-index: 999; - left: calc(50% - 25px); + left: calc(50% - 12px); top: 10px; } @@ -1017,7 +1019,7 @@ div.modal-report-user{ background-color: #2d2d2dba; right: 34px; margin: 0px; - padding: 6px 0px; + padding: 2px 0px; border-radius: 15px; border: none; color: white; @@ -1073,18 +1075,18 @@ div.modal-report-user{ .discussion .send-message{ position: absolute; bottom: 45px; - width: 220px; + width: 200px; height: 26px; margin-bottom: 10px; } .discussion .send-message input{ position: absolute; - width: calc(100% - 10px); - height: 20px; + width: calc(100% - 20px); + height: 30px; background-color: #171717; color: white; - border-radius: 15px; + border-radius: 10px; border: none; padding: 6px; } @@ -1117,10 +1119,11 @@ div.action p.action-body{ padding: 10px; background-color: #2d2d2dba; color: #fff; - font-size: 12px; + font-size: 14px; + font-weight: 500; text-align: center; - max-width: 150px; - margin-left: calc(50% - 75px); + max-width: 250px; + margin-left: calc(50% - 125px); border-radius: 15px; } .popUpElement{ diff --git a/front/src/Phaser/Menu/MenuScene.ts b/front/src/Phaser/Menu/MenuScene.ts index 58e7f0a6..8899c62f 100644 --- a/front/src/Phaser/Menu/MenuScene.ts +++ b/front/src/Phaser/Menu/MenuScene.ts @@ -104,7 +104,11 @@ export class MenuScene extends Phaser.Scene { } public revealMenuIcon(): void { - (this.menuButton.getChildByID('menuIcon') as HTMLElement).hidden = false + try { + (this.menuButton.getChildByID('menuIcon') as HTMLElement).hidden = false; + } catch (err) { + console.error(err); + } } openSideMenu() { diff --git a/front/src/Phaser/Menu/ReportMenu.ts b/front/src/Phaser/Menu/ReportMenu.ts index d7d0658b..c5d59f38 100644 --- a/front/src/Phaser/Menu/ReportMenu.ts +++ b/front/src/Phaser/Menu/ReportMenu.ts @@ -72,8 +72,8 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement { } public close(): void { + gameManager.getCurrentGameScene(this.scene).userInputManager.restoreControls(); this.opened = false; - gameManager.getCurrentGameScene(this.scene).userInputManager.initKeyBoardEvent(); const mainEl = this.getChildByID('gameReport') as HTMLElement; this.scene.tweens.add({ targets: this, From 6a08ca656f84d042b118e275593329f71554af0c Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Mon, 12 Apr 2021 18:26:36 +0200 Subject: [PATCH 04/16] Add TODO --- front/src/Phaser/Menu/MenuScene.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/front/src/Phaser/Menu/MenuScene.ts b/front/src/Phaser/Menu/MenuScene.ts index 8899c62f..6d09f247 100644 --- a/front/src/Phaser/Menu/MenuScene.ts +++ b/front/src/Phaser/Menu/MenuScene.ts @@ -104,6 +104,7 @@ export class MenuScene extends Phaser.Scene { } public revealMenuIcon(): void { + //TODO fix me: add try catch because at the same time, 'this.menuButton' variable doesn't exist and there is error on 'getChildByID' function try { (this.menuButton.getChildByID('menuIcon') as HTMLElement).hidden = false; } catch (err) { From 1693819b6acfd4d4becaca1904585f3c58713ac1 Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Mon, 12 Apr 2021 20:23:00 +0200 Subject: [PATCH 05/16] HotFix Share Form height --- front/dist/resources/html/gameShare.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/dist/resources/html/gameShare.html b/front/dist/resources/html/gameShare.html index 85f63b80..60c2ee0f 100644 --- a/front/dist/resources/html/gameShare.html +++ b/front/dist/resources/html/gameShare.html @@ -5,7 +5,7 @@ border-radius: 6px; margin: 20px auto 0; width: 298px; - height: 150px; + height: 160px; } #gameShare h1 { background-image: linear-gradient(top, #f1f3f3, #d4dae0); From 270cdb5c8209e786f293caa23b754a9eba37757f Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Mon, 12 Apr 2021 20:44:29 +0200 Subject: [PATCH 06/16] Button "CREATE MAP" must redirect user on production server --- front/src/Phaser/Menu/MenuScene.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/front/src/Phaser/Menu/MenuScene.ts b/front/src/Phaser/Menu/MenuScene.ts index 6d09f247..9093c618 100644 --- a/front/src/Phaser/Menu/MenuScene.ts +++ b/front/src/Phaser/Menu/MenuScene.ts @@ -319,7 +319,9 @@ export class MenuScene extends Phaser.Scene { } private gotToCreateMapPage() { - const sparkHost = 'https://'+window.location.host.replace('play.', '')+'/choose-map.html'; + //const sparkHost = 'https://'+window.location.host.replace('play.', '')+'/choose-map.html'; + //TODO fix me: this button can to send us on WorkAdventure BO. + const sparkHost = 'https://workadventu.re/choose-map.html'; window.open(sparkHost, '_blank'); } From 4119f69879166ba152f6daab39459bf953aa7d3b Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Tue, 13 Apr 2021 12:30:15 +0200 Subject: [PATCH 07/16] HotFix - Key up m when user write message - Size game share --- front/dist/resources/html/gameShare.html | 2 +- front/src/Phaser/Game/GameScene.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/front/dist/resources/html/gameShare.html b/front/dist/resources/html/gameShare.html index 85f63b80..60c2ee0f 100644 --- a/front/dist/resources/html/gameShare.html +++ b/front/dist/resources/html/gameShare.html @@ -5,7 +5,7 @@ border-radius: 6px; margin: 20px auto 0; width: 298px; - height: 150px; + height: 160px; } #gameShare h1 { background-image: linear-gradient(top, #f1f3f3, #d4dae0); diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 6c4c6e3e..29d9cd5b 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -440,9 +440,10 @@ export class GameScene extends ResizableScene implements CenterListener { this.openChatIcon = new OpenChatIcon(this, 2, this.game.renderer.height - 2) // FIXME: change this to use the UserInputManager class for input - this.input.keyboard.on('keyup-M', () => { + // FIXME: Comment this feature because when user write M key in report input, the layout change. + /*this.input.keyboard.on('keyup-M', () => { this.switchLayoutMode(); - }); + });*/ this.reposition(); From 5ebb0c94e6737e1b83a9b4a2f0e024b1620bb3ab Mon Sep 17 00:00:00 2001 From: kharhamel Date: Wed, 14 Apr 2021 11:56:54 +0200 Subject: [PATCH 08/16] FIX: calling emitPlayGlobalMessage in pusher without the admin tag will throw an error --- back/src/Services/SocketManager.ts | 13 ------------- pusher/src/Services/SocketManager.ts | 4 ++++ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/back/src/Services/SocketManager.ts b/back/src/Services/SocketManager.ts index 4a76f131..647afc95 100644 --- a/back/src/Services/SocketManager.ts +++ b/back/src/Services/SocketManager.ts @@ -510,19 +510,6 @@ export class SocketManager { return this.rooms; } - /** - * - * @param token - */ - /*searchClientByUuid(uuid: string): ExSocketInterface | null { - for(const socket of this.sockets.values()){ - if(socket.userUuid === uuid){ - return socket; - } - } - return null; - }*/ - public handleQueryJitsiJwtMessage(user: User, queryJitsiJwtMessage: QueryJitsiJwtMessage) { const room = queryJitsiJwtMessage.getJitsiroom(); diff --git a/pusher/src/Services/SocketManager.ts b/pusher/src/Services/SocketManager.ts index 6efd6f8d..726e11a1 100644 --- a/pusher/src/Services/SocketManager.ts +++ b/pusher/src/Services/SocketManager.ts @@ -364,6 +364,10 @@ export class SocketManager implements ZoneEventListener { } emitPlayGlobalMessage(client: ExSocketInterface, playglobalmessage: PlayGlobalMessage) { + if (!client.tags.includes('admin')) { + //In case of xss injection, we just kill the connection. + throw 'Client is not an admin!'; + } const pusherToBackMessage = new PusherToBackMessage(); pusherToBackMessage.setPlayglobalmessage(playglobalmessage); From 1a4f178728093754ef57ab4d5debf633b3bd7322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Wed, 14 Apr 2021 15:57:57 +0200 Subject: [PATCH 09/16] Update front/src/Phaser/Menu/MenuScene.ts --- front/src/Phaser/Menu/MenuScene.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/Phaser/Menu/MenuScene.ts b/front/src/Phaser/Menu/MenuScene.ts index 9093c618..830f8e48 100644 --- a/front/src/Phaser/Menu/MenuScene.ts +++ b/front/src/Phaser/Menu/MenuScene.ts @@ -321,7 +321,7 @@ export class MenuScene extends Phaser.Scene { private gotToCreateMapPage() { //const sparkHost = 'https://'+window.location.host.replace('play.', '')+'/choose-map.html'; //TODO fix me: this button can to send us on WorkAdventure BO. - const sparkHost = 'https://workadventu.re/choose-map.html'; + const sparkHost = 'https://workadventu.re/getting-started'; window.open(sparkHost, '_blank'); } From ce2c5e0cb55af3d452b30b92120b84c37b70b3bf Mon Sep 17 00:00:00 2001 From: kharhamel Date: Wed, 14 Apr 2021 15:36:25 +0200 Subject: [PATCH 10/16] FEATURE: added the env variable MAX_PER_GROUP --- .env.template | 4 ++++ back/src/Enum/EnvironmentVariable.ts | 1 + back/src/Model/Group.ts | 4 ++-- docker-compose.single-domain.yaml | 1 + docker-compose.yaml | 3 +++ front/src/Enum/EnvironmentVariable.ts | 1 + front/src/Phaser/Game/GameScene.ts | 11 +++++++++-- 7 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.env.template b/.env.template index a54df82e..a9ae63d7 100644 --- a/.env.template +++ b/.env.template @@ -13,3 +13,7 @@ TURN_STATIC_AUTH_SECRET= # The email address used by Let's encrypt to send renewal warnings (compulsory) ACME_EMAIL= + +MAX_PER_GROUP=4 +MAX_USERNAME_LENGTH=8 + diff --git a/back/src/Enum/EnvironmentVariable.ts b/back/src/Enum/EnvironmentVariable.ts index 8736a856..81693a98 100644 --- a/back/src/Enum/EnvironmentVariable.ts +++ b/back/src/Enum/EnvironmentVariable.ts @@ -11,6 +11,7 @@ const HTTP_PORT = parseInt(process.env.HTTP_PORT || '8080') || 8080; const GRPC_PORT = parseInt(process.env.GRPC_PORT || '50051') || 50051; export const SOCKET_IDLE_TIMER = parseInt(process.env.SOCKET_IDLE_TIMER as string) || 30; // maximum time (in second) without activity before a socket is closed export const TURN_STATIC_AUTH_SECRET = process.env.TURN_STATIC_AUTH_SECRET || ''; +export const MAX_PER_GROUP = parseInt(process.env.MAX_PER_GROUP || '4'); export { MINIMUM_DISTANCE, diff --git a/back/src/Model/Group.ts b/back/src/Model/Group.ts index f26a0e0d..ffe7a78a 100644 --- a/back/src/Model/Group.ts +++ b/back/src/Model/Group.ts @@ -4,9 +4,9 @@ import {PositionInterface} from "_Model/PositionInterface"; import {Movable} from "_Model/Movable"; import {PositionNotifier} from "_Model/PositionNotifier"; import {gaugeManager} from "../Services/GaugeManager"; +import {MAX_PER_GROUP} from "../Enum/EnvironmentVariable"; export class Group implements Movable { - static readonly MAX_PER_GROUP = 4; private static nextId: number = 1; @@ -88,7 +88,7 @@ export class Group implements Movable { } isFull(): boolean { - return this.users.size >= Group.MAX_PER_GROUP; + return this.users.size >= MAX_PER_GROUP; } isEmpty(): boolean { diff --git a/docker-compose.single-domain.yaml b/docker-compose.single-domain.yaml index 0bd1dcb6..1a390f4c 100644 --- a/docker-compose.single-domain.yaml +++ b/docker-compose.single-domain.yaml @@ -116,6 +116,7 @@ services: ADMIN_API_TOKEN: "$ADMIN_API_TOKEN" JITSI_URL: $JITSI_URL JITSI_ISS: $JITSI_ISS + MAX_PER_GROUP: "$MAX_PER_GROUP" volumes: - ./back:/usr/src/app labels: diff --git a/docker-compose.yaml b/docker-compose.yaml index 504c5b23..cea1bc03 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -38,6 +38,8 @@ services: TURN_USER: "" TURN_PASSWORD: "" START_ROOM_URL: "$START_ROOM_URL" + MAX_PER_GROUP: "$MAX_PER_GROUP" + MAX_USERNAME_LENGTH: "$MAX_USERNAME_LENGTH" command: yarn run start volumes: - ./front:/usr/src/app @@ -110,6 +112,7 @@ services: JITSI_URL: $JITSI_URL JITSI_ISS: $JITSI_ISS TURN_STATIC_AUTH_SECRET: SomeStaticAuthSecret + MAX_PER_GROUP: "MAX_PER_GROUP" volumes: - ./back:/usr/src/app labels: diff --git a/front/src/Enum/EnvironmentVariable.ts b/front/src/Enum/EnvironmentVariable.ts index 5040e59f..11479b0f 100644 --- a/front/src/Enum/EnvironmentVariable.ts +++ b/front/src/Enum/EnvironmentVariable.ts @@ -15,6 +15,7 @@ const ZOOM_LEVEL = 1/*3/4*/; const POSITION_DELAY = 200; // Wait 200ms between sending position events const MAX_EXTRAPOLATION_TIME = 100; // Extrapolate a maximum of 250ms if no new movement is sent by the player export const MAX_USERNAME_LENGTH = parseInt(process.env.MAX_USERNAME_LENGTH || '') || 8; +export const MAX_PER_GROUP = parseInt(process.env.MAX_PER_GROUP || '4'); export { DEBUG_MODE, diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 294174a2..e9028a00 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -10,7 +10,14 @@ import { RoomJoinedMessageInterface } from "../../Connexion/ConnexionModels"; import {CurrentGamerInterface, hasMovedEventName, Player} from "../Player/Player"; -import {DEBUG_MODE, JITSI_PRIVATE_MODE, POSITION_DELAY, RESOLUTION, ZOOM_LEVEL} from "../../Enum/EnvironmentVariable"; +import { + DEBUG_MODE, + JITSI_PRIVATE_MODE, + MAX_PER_GROUP, + POSITION_DELAY, + RESOLUTION, + ZOOM_LEVEL +} from "../../Enum/EnvironmentVariable"; import {ITiledMap, ITiledMapLayer, ITiledMapLayerProperty, ITiledMapObject, ITiledTileSet} from "../Map/ITiledMap"; import {AddPlayerInterface} from "./AddPlayerInterface"; import {PlayerAnimationDirections} from "../Player/Animation"; @@ -1344,7 +1351,7 @@ ${escapedMessage} this, Math.round(groupPositionMessage.position.x), Math.round(groupPositionMessage.position.y), - groupPositionMessage.groupSize === 4 ? 'circleSprite-red' : 'circleSprite-white' + groupPositionMessage.groupSize === MAX_PER_GROUP ? 'circleSprite-red' : 'circleSprite-white' ); sprite.setDisplayOrigin(48, 48); this.add.existing(sprite); From 5028a5442268b458ef7c0d9f29d2303bec15aa5d Mon Sep 17 00:00:00 2001 From: "DESKTOP-FMM8UI0\\CLV" Date: Mon, 19 Apr 2021 10:19:30 +0200 Subject: [PATCH 11/16] Unsubscribe to iframeEvents in CleanUpClosingScene --- front/src/Phaser/Game/GameScene.ts | 34 ++++++++++++++++++------------ 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 9a165eb5..9ecf9d43 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -133,7 +133,7 @@ export class GameScene extends ResizableScene implements CenterListener { // A promise that will resolve when the "create" method is called (signaling loading is ended) private createPromise: Promise; private createPromiseResolve!: (value?: void | PromiseLike) => void; - + private iframeSubscriptionList! : Array; MapUrlFile: string; RoomId: string; instance: string; @@ -716,7 +716,8 @@ export class GameScene extends ResizableScene implements CenterListener { } private listenToIframeEvents(): void { - iframeListener.openPopupStream.subscribe((openPopupEvent) => { + this.iframeSubscriptionList = []; + this.iframeSubscriptionList.push(iframeListener.openPopupStream.subscribe((openPopupEvent) => { let objectLayerSquare : ITiledMapObject; const targetObjectData = this.getObjectLayerData(openPopupEvent.targetObject); @@ -760,7 +761,6 @@ ${escapedMessage} } id++; } - this.tweens.add({ targets : domElement , scale : 1, @@ -769,9 +769,9 @@ ${escapedMessage} }); this.popUpElements.set(openPopupEvent.popupId, domElement); - }); + })); - iframeListener.closePopupStream.subscribe((closePopupEvent) => { + this.iframeSubscriptionList.push(iframeListener.closePopupStream.subscribe((closePopupEvent) => { const popUpElement = this.popUpElements.get(closePopupEvent.popupId); if (popUpElement === undefined) { console.error('Could not close popup with ID ', closePopupEvent.popupId,'. Maybe it has already been closed?'); @@ -787,23 +787,25 @@ ${escapedMessage} this.popUpElements.delete(closePopupEvent.popupId); }, }); - }); + })); - iframeListener.disablePlayerControlStream.subscribe(()=>{ + this.iframeSubscriptionList.push(iframeListener.disablePlayerControlStream.subscribe(()=>{ this.userInputManager.disableControls(); - }) - iframeListener.enablePlayerControlStream.subscribe(()=>{ + })); + + this.iframeSubscriptionList.push(iframeListener.enablePlayerControlStream.subscribe(()=>{ this.userInputManager.restoreControls(); - }) + })); let scriptedBubbleSprite : Sprite; - iframeListener.displayBubbleStream.subscribe(()=>{ + this.iframeSubscriptionList.push(iframeListener.displayBubbleStream.subscribe(()=>{ scriptedBubbleSprite = new Sprite(this,this.CurrentPlayer.x + 25,this.CurrentPlayer.y,'circleSprite-white'); scriptedBubbleSprite.setDisplayOrigin(48, 48); this.add.existing(scriptedBubbleSprite); - }) - iframeListener.removeBubbleStream.subscribe(()=>{ + })); + + this.iframeSubscriptionList.push(iframeListener.removeBubbleStream.subscribe(()=>{ scriptedBubbleSprite.destroy(); - }) + })); } @@ -848,6 +850,10 @@ ${escapedMessage} this.simplePeer.closeAllConnections(); this.simplePeer?.unregister(); this.messageSubscription?.unsubscribe(); + + for(const iframeEvents of this.iframeSubscriptionList){ + iframeEvents.unsubscribe(); + } } private removeAllRemotePlayers(): void { From d31021c02d3a584a79c9701b0fa504deba29cd2d Mon Sep 17 00:00:00 2001 From: "DESKTOP-FMM8UI0\\CLV" Date: Mon, 19 Apr 2021 14:19:16 +0200 Subject: [PATCH 12/16] Replace share screen logo --- front/dist/resources/logos/monitor-close.svg | 45 +------------------- front/dist/resources/logos/monitor.svg | 29 ++++++++----- 2 files changed, 20 insertions(+), 54 deletions(-) diff --git a/front/dist/resources/logos/monitor-close.svg b/front/dist/resources/logos/monitor-close.svg index 80056e2d..52f446d1 100644 --- a/front/dist/resources/logos/monitor-close.svg +++ b/front/dist/resources/logos/monitor-close.svg @@ -1,44 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/front/dist/resources/logos/monitor.svg b/front/dist/resources/logos/monitor.svg index d4b586c6..be50195b 100644 --- a/front/dist/resources/logos/monitor.svg +++ b/front/dist/resources/logos/monitor.svg @@ -1,15 +1,24 @@ - - + + - + + + + + + + + + + + From b9d9a788684032dd171ba404ece76afaf617ddfa Mon Sep 17 00:00:00 2001 From: "DESKTOP-FMM8UI0\\CLV" Date: Mon, 19 Apr 2021 14:42:49 +0200 Subject: [PATCH 13/16] Link changed in Tutov3 Change position of cam and buttons share/cam/Mic --- front/dist/resources/style/style.css | 6 +++--- maps/Tuto/tutoV3.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/front/dist/resources/style/style.css b/front/dist/resources/style/style.css index ba5b6c07..68a59f78 100644 --- a/front/dist/resources/style/style.css +++ b/front/dist/resources/style/style.css @@ -136,7 +136,7 @@ body .message-info.warning{ #div-myCamVideo { position: absolute; right: 15px; - bottom: 15px; + bottom: 30px; border-radius: 15px 15px 15px 15px; } @@ -167,7 +167,7 @@ video#myCamVideo{ background: #666; box-shadow: 2px 2px 24px #444; border-radius: 48px; - transform: translateY(40px); + transform: translateY(20px); transition-timing-function: ease-in-out; bottom: 20px; } @@ -183,7 +183,7 @@ video#myCamVideo{ .btn-cam-action div:hover{ background: #407cf7; box-shadow: 4px 4px 48px #666; - transition: 280ms; + transition: 120ms; } .btn-micro{ transition: all .3s; diff --git a/maps/Tuto/tutoV3.json b/maps/Tuto/tutoV3.json index 0362ae1c..2ae43690 100644 --- a/maps/Tuto/tutoV3.json +++ b/maps/Tuto/tutoV3.json @@ -24,7 +24,7 @@ { "name":"exitUrl", "type":"string", - "value":"@\/tcm\/workadventure\/floor0" + "value":"\/@\/tcm\/workadventure\/floor0" }], "type":"tilelayer", "visible":true, @@ -355,7 +355,7 @@ "value":"scriptTuto.js" }], "renderorder":"right-down", - "tiledversion":"2021.03.23", + "tiledversion":"1.5.0", "tileheight":32, "tilesets":[ { From 7e6a8b477d434d4cb271f49d32261366df3967c0 Mon Sep 17 00:00:00 2001 From: "DESKTOP-FMM8UI0\\CLV" Date: Mon, 19 Apr 2021 15:16:56 +0200 Subject: [PATCH 14/16] Debug state of share Screen button --- front/src/WebRtc/MediaManager.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/front/src/WebRtc/MediaManager.ts b/front/src/WebRtc/MediaManager.ts index 9da4aa59..0c414a3f 100644 --- a/front/src/WebRtc/MediaManager.ts +++ b/front/src/WebRtc/MediaManager.ts @@ -309,12 +309,17 @@ export class MediaManager { } private enableScreenSharing() { - this.monitorClose.style.display = "none"; - this.monitor.style.display = "block"; - this.monitorBtn.classList.add("enabled"); this.getScreenMedia().then((stream) => { this.triggerStartedScreenSharingCallbacks(stream); + this.monitorClose.style.display = "none"; + this.monitor.style.display = "block"; + this.monitorBtn.classList.add("enabled"); + }, () => { + this.monitorClose.style.display = "block"; + this.monitor.style.display = "none"; + this.monitorBtn.classList.remove("enabled"); }); + } private disableScreenSharing() { From dab74460bb857af0f378d0f69647f0928608c7d8 Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Mon, 19 Apr 2021 15:45:46 +0200 Subject: [PATCH 15/16] Hotfix redirect map tuto --- maps/Tuto/tutoV3.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maps/Tuto/tutoV3.json b/maps/Tuto/tutoV3.json index 0362ae1c..9953f5a9 100644 --- a/maps/Tuto/tutoV3.json +++ b/maps/Tuto/tutoV3.json @@ -24,7 +24,7 @@ { "name":"exitUrl", "type":"string", - "value":"@\/tcm\/workadventure\/floor0" + "value":"\/@\/tcm\/workadventure\/floor0" }], "type":"tilelayer", "visible":true, From e7b5bb261d075bd27794b178f5ac944731a18c30 Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Mon, 19 Apr 2021 20:19:40 +0200 Subject: [PATCH 16/16] HotFix performance - Change forceSetTimeOut to false and permit to freeze the scene. - Fix style sending audio message - Fix banned message from admin console --- front/dist/resources/style/style.css | 3 ++- front/src/Connexion/AdminMessagesService.ts | 1 + front/src/Connexion/RoomConnection.ts | 2 +- front/src/index.ts | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/front/dist/resources/style/style.css b/front/dist/resources/style/style.css index 010da692..5680da4a 100644 --- a/front/dist/resources/style/style.css +++ b/front/dist/resources/style/style.css @@ -795,7 +795,7 @@ input[type=range]:focus::-ms-fill-upper { right: 0; } .main-container .audio-playing img{ - width: 30px; + /*width: 30px;*/ border-radius: 50%; background-color: #ffda01; padding: 10px; @@ -803,6 +803,7 @@ input[type=range]:focus::-ms-fill-upper { .main-container .audio-playing p{ color: white; margin-left: 10px; + margin-top: 14px; } /* VIDEO QUALITY */ diff --git a/front/src/Connexion/AdminMessagesService.ts b/front/src/Connexion/AdminMessagesService.ts index 7f96a673..1750dd28 100644 --- a/front/src/Connexion/AdminMessagesService.ts +++ b/front/src/Connexion/AdminMessagesService.ts @@ -5,6 +5,7 @@ export enum AdminMessageEventTypes { admin = 'message', audio = 'audio', ban = 'ban', + banned = 'banned', } interface AdminMessageEvent { diff --git a/front/src/Connexion/RoomConnection.ts b/front/src/Connexion/RoomConnection.ts index 0220cb52..cc3b71de 100644 --- a/front/src/Connexion/RoomConnection.ts +++ b/front/src/Connexion/RoomConnection.ts @@ -184,7 +184,7 @@ export class RoomConnection implements RoomConnection { } else if (message.hasSendusermessage()) { adminMessagesService.onSendusermessage(message.getSendusermessage() as SendUserMessage); } else if (message.hasBanusermessage()) { - adminMessagesService.onSendusermessage(message.getSendusermessage() as BanUserMessage); + adminMessagesService.onSendusermessage(message.getBanusermessage() as BanUserMessage); } else if (message.hasWorldfullwarningmessage()) { worldFullWarningStream.onMessage(); } else if (message.hasRefreshroommessage()) { diff --git a/front/src/index.ts b/front/src/index.ts index c0663acd..f8756d57 100644 --- a/front/src/index.ts +++ b/front/src/index.ts @@ -33,7 +33,7 @@ const fps : Phaser.Types.Core.FPSConfig = { /** * Use setTimeout instead of requestAnimationFrame to run the game loop. */ - forceSetTimeOut: true, + forceSetTimeOut: false, /** * Calculate the average frame delta from this many consecutive frame intervals. */