From ee3097e6b068a095858bef361519705a3663c182 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 May 2021 13:41:07 +0000 Subject: [PATCH 01/31] Bump dns-packet from 1.3.1 to 1.3.4 in /front Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4. - [Release notes](https://github.com/mafintosh/dns-packet/releases) - [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md) - [Commits](https://github.com/mafintosh/dns-packet/compare/v1.3.1...v1.3.4) Signed-off-by: dependabot[bot] --- front/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/front/yarn.lock b/front/yarn.lock index 180c82bf..f625748d 100644 --- a/front/yarn.lock +++ b/front/yarn.lock @@ -1626,9 +1626,9 @@ dns-equal@^1.0.0: integrity sha1-s55/HabrCnW6nBcySzR1PEfgZU0= dns-packet@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.1.tgz#12aa426981075be500b910eedcd0b47dd7deda5a" - integrity sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg== + version "1.3.4" + resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.4.tgz#e3455065824a2507ba886c55a89963bb107dec6f" + integrity sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA== dependencies: ip "^1.1.0" safe-buffer "^5.0.1" From c435b7451e04d56bc4bb16fc4e5a9c31d55a730c Mon Sep 17 00:00:00 2001 From: GRL Date: Thu, 3 Jun 2021 16:54:52 +0200 Subject: [PATCH 02/31] Update don't call createPlayer but call moveUser Change time of pointerclicked from 100ms to 250ms Suppression of console.log --- front/src/Phaser/Login/SelectCharacterScene.ts | 4 ++-- front/src/Phaser/Services/WaScaleManager.ts | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/front/src/Phaser/Login/SelectCharacterScene.ts b/front/src/Phaser/Login/SelectCharacterScene.ts index 0cfbbdef..b56e38f5 100644 --- a/front/src/Phaser/Login/SelectCharacterScene.ts +++ b/front/src/Phaser/Login/SelectCharacterScene.ts @@ -143,7 +143,7 @@ export class SelectCharacterScene extends AbstractCharacterScene { this.pointerClicked = true; this.currentSelectUser = i; this.moveUser(); - setTimeout(() => {this.pointerClicked = false;}, 100); + setTimeout(() => {this.pointerClicked = false;}, 250); }); this.players.push(player); } @@ -244,7 +244,7 @@ export class SelectCharacterScene extends AbstractCharacterScene { update(time: number, delta: number): void { if(this.lazyloadingAttempt){ - this.createCurrentPlayer(); + this.moveUser(); this.lazyloadingAttempt = false; } } diff --git a/front/src/Phaser/Services/WaScaleManager.ts b/front/src/Phaser/Services/WaScaleManager.ts index 4e0e9208..acbecc38 100644 --- a/front/src/Phaser/Services/WaScaleManager.ts +++ b/front/src/Phaser/Services/WaScaleManager.ts @@ -60,7 +60,6 @@ class WaScaleManager { public saveZoom(): void { this._saveZoom = this.hdpiManager.zoomModifier; - console.log(this._saveZoom); } public restoreZoom(): void{ From 02ff6fb5bf4a9718715b093e28984cd79996eed3 Mon Sep 17 00:00:00 2001 From: GRL Date: Thu, 3 Jun 2021 17:08:56 +0200 Subject: [PATCH 03/31] Add timer so that pointerdown event can't be call two time in one click --- front/src/Phaser/Login/SelectCompanionScene.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/front/src/Phaser/Login/SelectCompanionScene.ts b/front/src/Phaser/Login/SelectCompanionScene.ts index 9caa88f7..8f641a3a 100644 --- a/front/src/Phaser/Login/SelectCompanionScene.ts +++ b/front/src/Phaser/Login/SelectCompanionScene.ts @@ -23,6 +23,7 @@ export class SelectCompanionScene extends ResizableScene { private saveZoom: number = 0; private currentCompanion = 0; + private pointerClicked: boolean = false; constructor() { super({ @@ -105,8 +106,13 @@ export class SelectCompanionScene extends ResizableScene { }); companion.setInteractive().on("pointerdown", () => { + if (this.pointerClicked) { + return; + } + this.pointerClicked = true; this.currentCompanion = i; this.moveCompanion(); + setTimeout(() => {this.pointerClicked = false;}, 250) }); this.companions.push(companion); From 0d2b1902222b244869a2eee93693496bea92cb3a Mon Sep 17 00:00:00 2001 From: GRL Date: Fri, 4 Jun 2021 09:39:33 +0200 Subject: [PATCH 04/31] Replace setTimeout by timer manage in Update --- front/src/Phaser/Login/SelectCharacterScene.ts | 13 +++++++++++-- front/src/Phaser/Login/SelectCompanionScene.ts | 8 ++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/front/src/Phaser/Login/SelectCharacterScene.ts b/front/src/Phaser/Login/SelectCharacterScene.ts index b56e38f5..052e5900 100644 --- a/front/src/Phaser/Login/SelectCharacterScene.ts +++ b/front/src/Phaser/Login/SelectCharacterScene.ts @@ -32,6 +32,7 @@ export class SelectCharacterScene extends AbstractCharacterScene { protected selectCharacterSceneElement!: Phaser.GameObjects.DOMElement; protected currentSelectUser = 0; protected pointerClicked: boolean = false; + protected pointerTimer: number = 0; protected lazyloadingAttempt = true; //permit to update texture loaded after renderer @@ -137,13 +138,16 @@ export class SelectCharacterScene extends AbstractCharacterScene { repeat: -1 }); player.setInteractive().on("pointerdown", () => { - if (this.pointerClicked || this.currentSelectUser === i) { + if (this.pointerClicked) { + return; + } + if (this.currentSelectUser === i) { return; } this.pointerClicked = true; + this.pointerTimer = 250; this.currentSelectUser = i; this.moveUser(); - setTimeout(() => {this.pointerClicked = false;}, 250); }); this.players.push(player); } @@ -243,6 +247,11 @@ export class SelectCharacterScene extends AbstractCharacterScene { } update(time: number, delta: number): void { + this.pointerTimer -= delta; + if (this.pointerTimer <= 0) { + this.pointerClicked = false; + } + if(this.lazyloadingAttempt){ this.moveUser(); this.lazyloadingAttempt = false; diff --git a/front/src/Phaser/Login/SelectCompanionScene.ts b/front/src/Phaser/Login/SelectCompanionScene.ts index 8f641a3a..b240a553 100644 --- a/front/src/Phaser/Login/SelectCompanionScene.ts +++ b/front/src/Phaser/Login/SelectCompanionScene.ts @@ -24,6 +24,7 @@ export class SelectCompanionScene extends ResizableScene { private currentCompanion = 0; private pointerClicked: boolean = false; + private pointerTimer: number = 0; constructor() { super({ @@ -73,7 +74,10 @@ export class SelectCompanionScene extends ResizableScene { } update(time: number, delta: number): void { - + this.pointerTimer -= delta; + if (this.pointerTimer <= 0) { + this.pointerClicked = false; + } } public selectCompanion(): void { @@ -110,9 +114,9 @@ export class SelectCompanionScene extends ResizableScene { return; } this.pointerClicked = true; + this.pointerTimer = 250; this.currentCompanion = i; this.moveCompanion(); - setTimeout(() => {this.pointerClicked = false;}, 250) }); this.companions.push(companion); From 8afa94aae3732746cef5b670c7436a949db20557 Mon Sep 17 00:00:00 2001 From: kharhamel Date: Fri, 4 Jun 2021 19:36:30 +0200 Subject: [PATCH 05/31] FIX: temporary fix for visit card on mobile --- front/src/Components/VisitCard/VisitCard.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/front/src/Components/VisitCard/VisitCard.svelte b/front/src/Components/VisitCard/VisitCard.svelte index 8c3706b0..7a289eae 100644 --- a/front/src/Components/VisitCard/VisitCard.svelte +++ b/front/src/Components/VisitCard/VisitCard.svelte @@ -14,14 +14,15 @@ pointer-events: all; margin-left: auto; margin-right: auto; - width: 515px; + width: 530px; margin-top: 200px; + max-width: 100vw; .defaultCard { border-radius: 5px; border: 2px black solid; background-color: whitesmoke; - width: 500px; + width: 530px; header { padding: 5px; @@ -30,7 +31,7 @@ iframe { border: 0; - width: 515px; + width: 530px; height: 270px; overflow: hidden; } @@ -60,5 +61,4 @@
- From dfb02af0f3fd84c53d86668383f2689630d4ba9a Mon Sep 17 00:00:00 2001 From: GRL Date: Mon, 7 Jun 2021 09:15:34 +0200 Subject: [PATCH 06/31] comment on pointerTimer and pointerClicked --- front/src/Phaser/Login/SelectCharacterScene.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/front/src/Phaser/Login/SelectCharacterScene.ts b/front/src/Phaser/Login/SelectCharacterScene.ts index 052e5900..552cd709 100644 --- a/front/src/Phaser/Login/SelectCharacterScene.ts +++ b/front/src/Phaser/Login/SelectCharacterScene.ts @@ -144,6 +144,9 @@ export class SelectCharacterScene extends AbstractCharacterScene { if (this.currentSelectUser === i) { return; } + //To not trigger two time the pointerdown events : + // We set a boolean to true so that pointerdown events does nothing when the boolean is true + // We set a timer that we decrease in update function to not trigger the pointerdown events twice this.pointerClicked = true; this.pointerTimer = 250; this.currentSelectUser = i; @@ -247,6 +250,8 @@ export class SelectCharacterScene extends AbstractCharacterScene { } update(time: number, delta: number): void { + // pointerTimer is set to 250 when pointerdown events is trigger + // After 250ms, pointerClicked is set to false and the pointerdown events can be trigger again this.pointerTimer -= delta; if (this.pointerTimer <= 0) { this.pointerClicked = false; From edfdc3bf47207214285164bb9c384a1503927991 Mon Sep 17 00:00:00 2001 From: GRL Date: Mon, 7 Jun 2021 09:15:34 +0200 Subject: [PATCH 07/31] comment on pointerTimer and pointerClicked --- front/src/Phaser/Login/SelectCharacterScene.ts | 5 +++++ front/src/Phaser/Login/SelectCompanionScene.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/front/src/Phaser/Login/SelectCharacterScene.ts b/front/src/Phaser/Login/SelectCharacterScene.ts index 052e5900..552cd709 100644 --- a/front/src/Phaser/Login/SelectCharacterScene.ts +++ b/front/src/Phaser/Login/SelectCharacterScene.ts @@ -144,6 +144,9 @@ export class SelectCharacterScene extends AbstractCharacterScene { if (this.currentSelectUser === i) { return; } + //To not trigger two time the pointerdown events : + // We set a boolean to true so that pointerdown events does nothing when the boolean is true + // We set a timer that we decrease in update function to not trigger the pointerdown events twice this.pointerClicked = true; this.pointerTimer = 250; this.currentSelectUser = i; @@ -247,6 +250,8 @@ export class SelectCharacterScene extends AbstractCharacterScene { } update(time: number, delta: number): void { + // pointerTimer is set to 250 when pointerdown events is trigger + // After 250ms, pointerClicked is set to false and the pointerdown events can be trigger again this.pointerTimer -= delta; if (this.pointerTimer <= 0) { this.pointerClicked = false; diff --git a/front/src/Phaser/Login/SelectCompanionScene.ts b/front/src/Phaser/Login/SelectCompanionScene.ts index b240a553..4c29f942 100644 --- a/front/src/Phaser/Login/SelectCompanionScene.ts +++ b/front/src/Phaser/Login/SelectCompanionScene.ts @@ -74,6 +74,8 @@ export class SelectCompanionScene extends ResizableScene { } update(time: number, delta: number): void { + // pointerTimer is set to 250 when pointerdown events is trigger + // After 250ms, pointerClicked is set to false and the pointerdown events can be trigger again this.pointerTimer -= delta; if (this.pointerTimer <= 0) { this.pointerClicked = false; @@ -113,6 +115,9 @@ export class SelectCompanionScene extends ResizableScene { if (this.pointerClicked) { return; } + //To not trigger two time the pointerdown events : + // We set a boolean to true so that pointerdown events does nothing when the boolean is true + // We set a timer that we decrease in update function to not trigger the pointerdown events twice this.pointerClicked = true; this.pointerTimer = 250; this.currentCompanion = i; From 23c74bd7aafd20eb0e0f7968254c06b4233d11bb Mon Sep 17 00:00:00 2001 From: GRL Date: Mon, 7 Jun 2021 09:27:49 +0200 Subject: [PATCH 08/31] Create a PR to fix broken layout on EnableCameraScene on mobile --- front/src/Components/EnableCamera/EnableCameraScene.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/Components/EnableCamera/EnableCameraScene.svelte b/front/src/Components/EnableCamera/EnableCameraScene.svelte index 537e8bdb..effaa099 100644 --- a/front/src/Components/EnableCamera/EnableCameraScene.svelte +++ b/front/src/Components/EnableCamera/EnableCameraScene.svelte @@ -136,7 +136,7 @@ margin-top: 3vh; margin-bottom: 3vh; min-height: 10vh; - width: 50%; + width: 50vw; margin-left: auto; margin-right: auto; From e45198e4031952638772f19e4b0e1252c22be7b6 Mon Sep 17 00:00:00 2001 From: GRL Date: Mon, 7 Jun 2021 10:09:51 +0200 Subject: [PATCH 09/31] Remove marging bottom of SelectWebcamForm --- front/src/Components/EnableCamera/EnableCameraScene.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/front/src/Components/EnableCamera/EnableCameraScene.svelte b/front/src/Components/EnableCamera/EnableCameraScene.svelte index effaa099..42b58d85 100644 --- a/front/src/Components/EnableCamera/EnableCameraScene.svelte +++ b/front/src/Components/EnableCamera/EnableCameraScene.svelte @@ -134,7 +134,7 @@ section.selectWebcamForm { margin-top: 3vh; - margin-bottom: 3vh; +/* margin-bottom: 3vh;*/ min-height: 10vh; width: 50vw; margin-left: auto; @@ -158,6 +158,7 @@ } h2{ + color: pink; font-family: "Press Start 2P"; margin: 1px; } @@ -176,7 +177,7 @@ img { width: 30px; - margin-right: 10px; + margin-right: 5px; } } From cbf786fd5655b9dd227201d16c702e684a402f79 Mon Sep 17 00:00:00 2001 From: GRL Date: Mon, 7 Jun 2021 10:29:38 +0200 Subject: [PATCH 10/31] Remove img and margin --- .../src/Components/EnableCamera/EnableCameraScene.svelte | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/front/src/Components/EnableCamera/EnableCameraScene.svelte b/front/src/Components/EnableCamera/EnableCameraScene.svelte index 42b58d85..342c2a32 100644 --- a/front/src/Components/EnableCamera/EnableCameraScene.svelte +++ b/front/src/Components/EnableCamera/EnableCameraScene.svelte @@ -92,7 +92,7 @@ {#if $cameraListStore.length > 1 }
- Camera +
{#each $cameraListStore as camera} @@ -142,8 +142,8 @@ select { font-family: "Press Start 2P"; -/* margin-top: 1vh; - margin-bottom: 1vh;*/ + margin-top: 1vh; + margin-bottom: 1vh; option { font-family: "Press Start 2P"; @@ -176,7 +176,7 @@ img { width: 30px; - margin-right: 5px; + margin-right: 10px; } } @@ -210,8 +210,18 @@ align-items: center; justify-content: center; } - - } + + @media only screen and (max-width: 800px) { + * { + font-size: 80%; + } + .enableCameraScene .control-group img { + width: 15px; + margin-right: 5px; + } + } + + From 3e1f10491a4fab4ff02e3586935c5c1b342d6834 Mon Sep 17 00:00:00 2001 From: GRL Date: Mon, 7 Jun 2021 14:40:38 +0200 Subject: [PATCH 12/31] font-size reduce by 20% img width = 1vw --- .../EnableCamera/EnableCameraScene.svelte | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/front/src/Components/EnableCamera/EnableCameraScene.svelte b/front/src/Components/EnableCamera/EnableCameraScene.svelte index 0e7e84bb..ac8debc0 100644 --- a/front/src/Components/EnableCamera/EnableCameraScene.svelte +++ b/front/src/Components/EnableCamera/EnableCameraScene.svelte @@ -213,13 +213,22 @@ } @media only screen and (max-width: 800px) { - * { + .enableCameraScene h2 { font-size: 80%; } - .enableCameraScene .control-group img { - width: 15px; - margin-right: 5px; - } + + .enableCameraScene .control-group select { + font-size: 80%; + } + + .enableCameraScene button.letsgo { + font-size: 160%; + } + + .enableCameraScene .control-group img { + width: 1vw; + margin-right: 0px; + } } From 88a72e015395b8894b517136871b824f12ed2525 Mon Sep 17 00:00:00 2001 From: GRL Date: Mon, 7 Jun 2021 15:00:01 +0200 Subject: [PATCH 13/31] change width of select field --- .../src/Components/EnableCamera/EnableCameraScene.svelte | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/front/src/Components/EnableCamera/EnableCameraScene.svelte b/front/src/Components/EnableCamera/EnableCameraScene.svelte index ac8debc0..c77342bc 100644 --- a/front/src/Components/EnableCamera/EnableCameraScene.svelte +++ b/front/src/Components/EnableCamera/EnableCameraScene.svelte @@ -217,18 +217,14 @@ font-size: 80%; } - .enableCameraScene .control-group select { + .enableCameraScene .control-group .nes-select { font-size: 80%; + width: calc(100% - 50px); } .enableCameraScene button.letsgo { font-size: 160%; } - - .enableCameraScene .control-group img { - width: 1vw; - margin-right: 0px; - } } From 26f21fe6e4d556bf43db08ce918a019a8f94af49 Mon Sep 17 00:00:00 2001 From: kharhamel Date: Mon, 7 Jun 2021 15:01:21 +0200 Subject: [PATCH 14/31] FIX: the visit card feature can now be disabled client side --- front/src/Enum/EnvironmentVariable.ts | 1 + front/src/Phaser/Entity/RemotePlayer.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/front/src/Enum/EnvironmentVariable.ts b/front/src/Enum/EnvironmentVariable.ts index 73f6427c..89562456 100644 --- a/front/src/Enum/EnvironmentVariable.ts +++ b/front/src/Enum/EnvironmentVariable.ts @@ -10,6 +10,7 @@ const TURN_USER: string = process.env.TURN_USER || ''; const TURN_PASSWORD: string = process.env.TURN_PASSWORD || ''; const JITSI_URL : string|undefined = (process.env.JITSI_URL === '') ? undefined : process.env.JITSI_URL; const JITSI_PRIVATE_MODE : boolean = process.env.JITSI_PRIVATE_MODE == "true"; +export const DISABLE_VISIT_CARD_FEATURE : boolean = process.env.DISABLE_VISIT_CARD_FEATURE == "true"; 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; diff --git a/front/src/Phaser/Entity/RemotePlayer.ts b/front/src/Phaser/Entity/RemotePlayer.ts index c2384357..1ebf72af 100644 --- a/front/src/Phaser/Entity/RemotePlayer.ts +++ b/front/src/Phaser/Entity/RemotePlayer.ts @@ -2,6 +2,7 @@ import type {GameScene} from "../Game/GameScene"; import type {PointInterface} from "../../Connexion/ConnexionModels"; import {Character} from "../Entity/Character"; import type {PlayerAnimationDirections} from "../Player/Animation"; +import {DISABLE_VISIT_CARD_FEATURE} from "../../Enum/EnvironmentVariable"; export const playerClickedEvent = 'playerClickedEvent'; @@ -46,6 +47,6 @@ export class RemotePlayer extends Character { } isClickable(): boolean { - return true; //todo: make remote players clickable if they are logged in. + return !DISABLE_VISIT_CARD_FEATURE; //todo: make remote players clickable if they are logged in. } } From 1264b286b242d188a2be986a979beefa72e2aa8b Mon Sep 17 00:00:00 2001 From: kharhamel Date: Mon, 7 Jun 2021 15:11:54 +0200 Subject: [PATCH 15/31] FIX: trying to start a emote after a scene is desotryed should not crash the game --- front/src/Phaser/Entity/Character.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/front/src/Phaser/Entity/Character.ts b/front/src/Phaser/Entity/Character.ts index 9c3273ec..931efb8e 100644 --- a/front/src/Phaser/Entity/Character.ts +++ b/front/src/Phaser/Entity/Character.ts @@ -261,7 +261,7 @@ export abstract class Character extends Container { } private createStartTransition(scalingFactor: number, emoteY: number) { - this.emoteTween = this.scene.tweens.add({ + this.emoteTween = this.scene?.tweens.add({ targets: this.emote, props: { scale: scalingFactor, @@ -277,7 +277,7 @@ export abstract class Character extends Container { } private startPulseTransition(emoteY: number, scalingFactor: number) { - this.emoteTween = this.scene.tweens.add({ + this.emoteTween = this.scene?.tweens.add({ targets: this.emote, props: { y: emoteY * 1.3, @@ -294,7 +294,7 @@ export abstract class Character extends Container { } private startExitTransition(emoteY: number) { - this.emoteTween = this.scene.tweens.add({ + this.emoteTween = this.scene?.tweens.add({ targets: this.emote, props: { alpha: 0, From 000be7aa499a113c9cecb9bfe3909d211bcea641 Mon Sep 17 00:00:00 2001 From: GRL Date: Mon, 7 Jun 2021 16:12:31 +0200 Subject: [PATCH 16/31] console --- front/src/Phaser/Login/EnableCameraScene.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/front/src/Phaser/Login/EnableCameraScene.ts b/front/src/Phaser/Login/EnableCameraScene.ts index ba27cd07..3468f98c 100644 --- a/front/src/Phaser/Login/EnableCameraScene.ts +++ b/front/src/Phaser/Login/EnableCameraScene.ts @@ -33,6 +33,9 @@ export class EnableCameraScene extends ResizableScene { }); enableCameraSceneVisibilityStore.showEnableCameraScene(); + + console.log('TEST'); + console.error('TEST !!!!!'); } public onResize(): void { From c9da38c7ec37b6de96268f5b2834d1669e16b576 Mon Sep 17 00:00:00 2001 From: GRL Date: Mon, 7 Jun 2021 16:23:00 +0200 Subject: [PATCH 17/31] reduce select field --- front/src/Components/EnableCamera/EnableCameraScene.svelte | 2 +- front/src/Phaser/Login/EnableCameraScene.ts | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/front/src/Components/EnableCamera/EnableCameraScene.svelte b/front/src/Components/EnableCamera/EnableCameraScene.svelte index c77342bc..8de52018 100644 --- a/front/src/Components/EnableCamera/EnableCameraScene.svelte +++ b/front/src/Components/EnableCamera/EnableCameraScene.svelte @@ -219,7 +219,7 @@ .enableCameraScene .control-group .nes-select { font-size: 80%; - width: calc(100% - 50px); + width: 50% } .enableCameraScene button.letsgo { diff --git a/front/src/Phaser/Login/EnableCameraScene.ts b/front/src/Phaser/Login/EnableCameraScene.ts index 3468f98c..ba27cd07 100644 --- a/front/src/Phaser/Login/EnableCameraScene.ts +++ b/front/src/Phaser/Login/EnableCameraScene.ts @@ -33,9 +33,6 @@ export class EnableCameraScene extends ResizableScene { }); enableCameraSceneVisibilityStore.showEnableCameraScene(); - - console.log('TEST'); - console.error('TEST !!!!!'); } public onResize(): void { From b03ee5bd53101267f91f67b88165e719e41c3a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Mon, 7 Jun 2021 16:48:52 +0200 Subject: [PATCH 18/31] Fixing scripting origin check When working on making the openCoWebsite URL relative, we introduced a regression. In production, the iframe generated by "script" properties have no "src" and therefore, were treated as invalid messages. This should fix everything in prod. --- front/src/Api/IframeListener.ts | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/front/src/Api/IframeListener.ts b/front/src/Api/IframeListener.ts index fbc2b4f1..6c3afa31 100644 --- a/front/src/Api/IframeListener.ts +++ b/front/src/Api/IframeListener.ts @@ -70,15 +70,23 @@ class IframeListener { // Do we trust the sender of this message? // Let's only accept messages from the iframe that are allowed. // Note: maybe we could restrict on the domain too for additional security (in case the iframe goes to another domain). - let foundSrc: string | null = null; - for (const iframe of this.iframes) { - if (iframe.contentWindow === message.source) { - foundSrc = iframe.src; - break; + let foundSrc: string | undefined; + + foundSrc = [...this.scripts.keys()].find(key => { + return this.scripts.get(key)?.contentWindow == message.source + }); + + if (foundSrc === undefined) { + for (const iframe of this.iframes) { + if (iframe.contentWindow === message.source) { + foundSrc = iframe.src; + break; + } + } + + if (foundSrc === undefined) { + return; } - } - if (!foundSrc) { - return; } const payload = message.data; @@ -106,11 +114,7 @@ class IframeListener { this._loadSoundStream.next(payload.data); } else if (payload.type === 'openCoWebSite' && isOpenCoWebsite(payload.data)) { - const scriptUrl = [...this.scripts.keys()].find(key => { - return this.scripts.get(key)?.contentWindow == message.source - }) - - scriptUtils.openCoWebsite(payload.data.url, scriptUrl || foundSrc); + scriptUtils.openCoWebsite(payload.data.url, foundSrc); } else if (payload.type === 'closeCoWebSite') { From aa9c3b9f4ff5a6f732db266ea8b946c78968db88 Mon Sep 17 00:00:00 2001 From: GRL Date: Mon, 7 Jun 2021 17:18:39 +0200 Subject: [PATCH 19/31] max height on select --- .../EnableCamera/EnableCameraScene.svelte | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/front/src/Components/EnableCamera/EnableCameraScene.svelte b/front/src/Components/EnableCamera/EnableCameraScene.svelte index 8de52018..9318a1df 100644 --- a/front/src/Components/EnableCamera/EnableCameraScene.svelte +++ b/front/src/Components/EnableCamera/EnableCameraScene.svelte @@ -90,7 +90,7 @@
- {#if $cameraListStore.length > 1 } +
Camera
@@ -103,9 +103,9 @@
- {/if} +
Microphone
@@ -118,7 +118,7 @@
- {/if} +
@@ -144,12 +144,12 @@ font-family: "Press Start 2P"; margin-top: 1vh; margin-bottom: 1vh; + } - option { + option { font-family: "Press Start 2P"; } } - } section.action{ text-align: center; @@ -219,14 +219,16 @@ .enableCameraScene .control-group .nes-select { font-size: 80%; - width: 50% + } + + .enableCameraScene .control-group { + max-height: 60px; + margin-top: 10px; } .enableCameraScene button.letsgo { font-size: 160%; } } - - From a7cf0719719a37e15cbc6aaca6438790f167e544 Mon Sep 17 00:00:00 2001 From: GRL Date: Tue, 8 Jun 2021 09:10:06 +0200 Subject: [PATCH 20/31] max height on select on all device and screen --- front/src/Components/EnableCamera/EnableCameraScene.svelte | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/front/src/Components/EnableCamera/EnableCameraScene.svelte b/front/src/Components/EnableCamera/EnableCameraScene.svelte index 9318a1df..d80c4267 100644 --- a/front/src/Components/EnableCamera/EnableCameraScene.svelte +++ b/front/src/Components/EnableCamera/EnableCameraScene.svelte @@ -173,6 +173,8 @@ .control-group { display: flex; flex-direction: row; + max-height: 60px; + margin-top: 10px; img { width: 30px; @@ -221,11 +223,6 @@ font-size: 80%; } - .enableCameraScene .control-group { - max-height: 60px; - margin-top: 10px; - } - .enableCameraScene button.letsgo { font-size: 160%; } From 1cceed2fd63e788833a724a03375a1a1ddea2853 Mon Sep 17 00:00:00 2001 From: GRL Date: Tue, 8 Jun 2021 09:52:52 +0200 Subject: [PATCH 21/31] dark mode on select --- front/src/Components/EnableCamera/EnableCameraScene.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/Components/EnableCamera/EnableCameraScene.svelte b/front/src/Components/EnableCamera/EnableCameraScene.svelte index d80c4267..7f567009 100644 --- a/front/src/Components/EnableCamera/EnableCameraScene.svelte +++ b/front/src/Components/EnableCamera/EnableCameraScene.svelte @@ -93,7 +93,7 @@
Camera -
+
{#each $microphoneListStore as microphone}