From 405f7b11374e6dcbfd1fe069eb663bc9595fadb6 Mon Sep 17 00:00:00 2001 From: Lurkars Date: Tue, 20 Apr 2021 21:37:48 +0200 Subject: [PATCH 001/115] audio player volume improvements --- front/dist/index.tmpl.html | 12 +++++++--- front/dist/resources/style/style.css | 13 +++++++++++ front/src/WebRtc/AudioManager.ts | 34 +++++++++++++++++++--------- 3 files changed, 45 insertions(+), 14 deletions(-) diff --git a/front/dist/index.tmpl.html b/front/dist/index.tmpl.html index 062622b8..2c3aef43 100644 --- a/front/dist/index.tmpl.html +++ b/front/dist/index.tmpl.html @@ -88,9 +88,15 @@ - - - + + + + + + + + + diff --git a/front/dist/resources/style/style.css b/front/dist/resources/style/style.css index ff79245c..3ad0bdcf 100644 --- a/front/dist/resources/style/style.css +++ b/front/dist/resources/style/style.css @@ -403,6 +403,19 @@ body { visibility: hidden; display: none; } +#audioplayer_volume_icon_playing.low #audioplayer_volume_icon_playing_high { + visibility: hidden; + display: none; +} +#audioplayer_volume_icon_playing.low #audioplayer_volume_icon_playing_mid { + visibility: hidden; + display: none; +} +#audioplayer_volume_icon_playing.mid #audioplayer_volume_icon_playing_high { + visibility: hidden; + display: none; +} + #audioplayerctrl > #audioplayer_volume { width: 100%; background-color: rgba(0,0,0,0.5); diff --git a/front/src/WebRtc/AudioManager.ts b/front/src/WebRtc/AudioManager.ts index 60255a77..753cf7fb 100644 --- a/front/src/WebRtc/AudioManager.ts +++ b/front/src/WebRtc/AudioManager.ts @@ -11,7 +11,7 @@ enum audioStates { const audioPlayerDivId = "audioplayer"; const audioPlayerCtrlId = "audioplayerctrl"; const audioPlayerVolId = "audioplayer_volume"; -const audioPlayerMuteId = "audioplayer_volume_icon_playing"; +const audioPlayerVolumeIconId = "audioplayer_volume_icon_playing"; const animationTime = 500; class AudioManager { @@ -21,7 +21,7 @@ class AudioManager { private audioPlayerCtrl: HTMLDivElement; private audioPlayerElem: HTMLAudioElement | undefined; private audioPlayerVol: HTMLInputElement; - private audioPlayerMute: HTMLInputElement; + private audioPlayerVolumeIcon: HTMLInputElement; private volume = 1; private muted = false; @@ -32,14 +32,14 @@ class AudioManager { this.audioPlayerDiv = HtmlUtils.getElementByIdOrFail(audioPlayerDivId); this.audioPlayerCtrl = HtmlUtils.getElementByIdOrFail(audioPlayerCtrlId); this.audioPlayerVol = HtmlUtils.getElementByIdOrFail(audioPlayerVolId); - this.audioPlayerMute = HtmlUtils.getElementByIdOrFail(audioPlayerMuteId); + this.audioPlayerVolumeIcon = HtmlUtils.getElementByIdOrFail(audioPlayerVolumeIconId); this.volume = localUserStore.getAudioPlayerVolume(); this.audioPlayerVol.value = '' + this.volume; this.muted = localUserStore.getAudioPlayerMuted(); if (this.muted) { - this.audioPlayerMute.classList.add('muted'); + this.audioPlayerVolumeIcon.classList.add('muted'); } } @@ -93,7 +93,23 @@ class AudioManager { this.volumeReduced = reduceVolume; this.audioPlayerElem.volume = this.volume; - this.audioPlayerVol.value = '' + this.volume; + if (this.muted) { + this.audioPlayerVolumeIcon.classList.add('muted'); + this.audioPlayerVol.value = '0'; + } else { + this.audioPlayerVol.value = '' + this.volume; + this.audioPlayerVolumeIcon.classList.remove('muted'); + if (this.volume < 0.3) { + this.audioPlayerVolumeIcon.classList.add('low'); + } else if (this.volume < 0.7) { + this.audioPlayerVolumeIcon.classList.remove('low'); + this.audioPlayerVolumeIcon.classList.add('mid'); + } else { + this.audioPlayerVolumeIcon.classList.remove('low'); + this.audioPlayerVolumeIcon.classList.remove('mid'); + } + } + this.audioPlayerElem.muted = this.muted; } @@ -129,16 +145,12 @@ class AudioManager { this.muted = !this.muted; this.changeVolume(); localUserStore.setAudioPlayerMuted(this.muted); - - if (this.muted) { - this.audioPlayerMute.classList.add('muted'); - } else { - this.audioPlayerMute.classList.remove('muted'); - } } this.audioPlayerVol.oninput = (ev: Event)=> { this.setVolume(parseFloat((ev.currentTarget).value)); + this.muted = false; + localUserStore.setAudioPlayerMuted(this.muted); this.changeVolume(); (ev.currentTarget).blur(); From cc44bfac77704eae18a1b1d1bbb20a95748bcda8 Mon Sep 17 00:00:00 2001 From: Lurkars Date: Thu, 13 May 2021 16:13:07 +0200 Subject: [PATCH 002/115] port --- front/webpack.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/webpack.config.ts b/front/webpack.config.ts index 336cad82..5503aa43 100644 --- a/front/webpack.config.ts +++ b/front/webpack.config.ts @@ -20,7 +20,7 @@ module.exports = { devServer: { contentBase: './dist', host: '0.0.0.0', - sockPort: 80, + sockPort: 443, disableHostCheck: true, historyApiFallback: { rewrites: [ From 3e54e7504037c9be7f1039686fb3569bc077ea2b Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Thu, 17 Jun 2021 15:14:54 +0300 Subject: [PATCH 003/115] Add workaround for #932 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 322f06ba..d24dbb4e 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ Note: on some OSes, you will need to add this line to your `/etc/hosts` file: 127.0.0.1 workadventure.localhost ``` +Note: If on the first run you get a page with "network error". Try to ``docker-compose stop`` , then ``docker-compose start``. + ### MacOS developers, your environment with Vagrant If you are using MacOS, you can increase Docker performance using Vagrant. If you want more explanations, you can read [this medium article](https://medium.com/better-programming/vagrant-to-increase-docker-performance-with-macos-25b354b0c65c). From abfaf73a25cb16e34c78560cd472e35fccdeb478 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Jun 2021 20:36:36 +0000 Subject: [PATCH 004/115] Bump striptags from 3.1.1 to 3.2.0 in /messages Bumps [striptags](https://github.com/ericnorris/striptags) from 3.1.1 to 3.2.0. - [Release notes](https://github.com/ericnorris/striptags/releases) - [Commits](https://github.com/ericnorris/striptags/compare/v3.1.1...v3.2.0) --- updated-dependencies: - dependency-name: striptags dependency-type: indirect ... Signed-off-by: dependabot[bot] --- messages/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/messages/yarn.lock b/messages/yarn.lock index 564da3f4..4ad28ec4 100644 --- a/messages/yarn.lock +++ b/messages/yarn.lock @@ -3767,9 +3767,9 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== striptags@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/striptags/-/striptags-3.1.1.tgz#c8c3e7fdd6fb4bb3a32a3b752e5b5e3e38093ebd" - integrity sha1-yMPn/db7S7OjKjt1LltePjgJPr0= + version "3.2.0" + resolved "https://registry.yarnpkg.com/striptags/-/striptags-3.2.0.tgz#cc74a137db2de8b0b9a370006334161f7dd67052" + integrity sha512-g45ZOGzHDMe2bdYMdIvdAfCQkCTDMGBazSw1ypMowwGIee7ZQ5dU0rBJ8Jqgl+jAKIv4dbeE1jscZq9wid1Tkw== success-symbol@^0.1.0: version "0.1.0" From 120f19af65d4fc81ebe01aaa99dd044aef889394 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Thu, 24 Jun 2021 14:35:18 +0300 Subject: [PATCH 005/115] Add anthoer note for https://github.com/thecodingmachine/workadventure/issues/932#issuecomment-867562208 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d24dbb4e..ba9e70ce 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ Note: on some OSes, you will need to add this line to your `/etc/hosts` file: ``` Note: If on the first run you get a page with "network error". Try to ``docker-compose stop`` , then ``docker-compose start``. +Note 2: If you are still getting "network error". Make sure you are authorizing the self-signed certificate by entering https://pusher.workadventure.testing and accepting them. ### MacOS developers, your environment with Vagrant From fecbc8a018fd783fe633dcf417f9f681b4c96752 Mon Sep 17 00:00:00 2001 From: kharhamel Date: Mon, 12 Jul 2021 17:39:16 +0200 Subject: [PATCH 006/115] WIP: svelte menu --- front/dist/static/images/logo-WA-min.png | Bin 0 -> 2136 bytes front/src/Components/App.svelte | 16 +++ .../Components/Menu/EditProfileMenu.svelte | 73 ++++++++++ .../Components/Menu/GameQualityMenu.svelte | 121 ++++++++++++++++ front/src/Components/Menu/Menu.svelte | 73 ++++++++++ front/src/Components/Menu/MenuIcon.svelte | 28 ++-- front/src/Phaser/Components/Loader.ts | 52 ++++--- front/src/Phaser/Game/GameManager.ts | 2 + front/src/Phaser/Login/CustomizeScene.ts | 2 +- front/src/Phaser/Login/EnableCameraScene.ts | 37 ++--- front/src/Phaser/Login/LoginScene.ts | 28 ++-- .../src/Phaser/Login/SelectCharacterScene.ts | 103 +++++++------ .../src/Phaser/Login/SelectCompanionScene.ts | 84 ++++++----- front/src/Phaser/Menu/MenuScene.ts | 40 +++--- front/src/Phaser/Menu/ReportMenu.ts | 23 ++- front/src/Stores/MediaStore.ts | 2 +- front/src/Stores/MenuStore.ts | 1 + maps/tests/MenuSvelte.json | 136 ++++++++++++++++++ 18 files changed, 623 insertions(+), 198 deletions(-) create mode 100644 front/dist/static/images/logo-WA-min.png create mode 100644 front/src/Components/Menu/EditProfileMenu.svelte create mode 100644 front/src/Components/Menu/GameQualityMenu.svelte create mode 100644 front/src/Components/Menu/Menu.svelte create mode 100644 maps/tests/MenuSvelte.json diff --git a/front/dist/static/images/logo-WA-min.png b/front/dist/static/images/logo-WA-min.png new file mode 100644 index 0000000000000000000000000000000000000000..fe2131519735538aa4a2c7bdfcb46f945f54b69d GIT binary patch literal 2136 zcmV-e2&eanP)y0Kf7jVwzah0w!eWcYeU2~_}zu{)LwUPa<9x_AWVAwm*B@}#c= zz$ySNcyK=~4gg>akD-6JH%$lv=-{#J!M%vk&xpZWd=)?wpZ1Q&PdhJ(SJ=QN!n=6E zHvy!EPmYEM_oI_B0Ng||c!N&@=->}jH^b*iJ%SfagAW2|qv2gg^S0@ur*oP)xa|j7_C1tcFfEM;|sHZzggS#g-i<|G5&2bz7!3Nl{zLb zVp0I>XnaDA+a^U|svsmu@va*>cZ{SDlJ?$16CR*L#y5fyPoP@>9di3d(Jlg=X<(AJ z{Hp6@EdIHFfAZ-kmoLNIxpUIrcXD8;!-*>C))L4x z0nS{1J_pZJm6NM}KYxzD|NP_l^|LR&oP6dWB}^HkZGf+%?v~YFr>&o7!GhYbtSw_KpiG& z#>4_|EWqml=;;rSK92}^1klFfM6Eo2{J8XVjYj$4;>(vW;nk~G!CB?v#fxzI^l4j{ ztE?N~X#$i68wjUV+OA3fP0THcFj=jt8K@F~(VBF^IE|{FK@vdyDHT9j5SZkV`=)-L z2M->YI<-^w_V!9Izr4H*mo8nheT(x&lTFJ!fY6`<;WdS}EE9n7iHU?Y3T;_7HH@Nv z13Y>11kRi}BYffu7cQvWjIaQVKmAod!uj*(r#^fA`t{`fyLa#4{rmSP{@=!02T2E1 z8O`R&tZOtn+4Meo^a!3me=dC8YuB!+-1Y*-bW_D5-U@&fC_R1pbn^bqn>WWtmP7!i zMNlPx`T6-1|IQ1*A#K(OVNndw^5w1xZ7?5d5@bDIZG!l>S*JF@9C7@bKZo$@?o;uE=HuQ-L6>3E-+EA%bMewj_YKn2POK zO@Om?YhxgB^?7$+H9m0f-aTEv%#>|e9)L1{`oh%&5F`L17N`k`999tM?OH!FgDAe? zs34>eY62pM1Q0oO-8?#Ivi<(1VF_U1!zNBuvwm3P{x#SL`vQ@!J4M57=+?<9x z|Bs-u03X}@#Q6E*)G}nNf)&fcQ>LbhvzmY@H$l{fspg$xfVklD08V$aCX6v=J={ex zK;QL(kk6hyb9wm*HYRo)9UYyx&f40ViOVn_?4o`E@&fgP8QYNn;z39NlnK-i=0jZ+ z0}OGs$*5)sB@;BNX6UFEr7SHixhM!3$gB`TJA%}QLR*#zfSQ5&ASHk<=8i7*Xho2e(tQJ}3PQT*LWnRK=vXXT zdQUpSIh9-d@GKW^bj47>`oF`&L*?_>$m93-#eNDy{rWtN(RQV65|0N+I)%2a-8P|% zEuNu$-l9;cT`38taP9EMD**BWVX@7-gQ!SZIC+6^;I@_M*0Ec*`UURXxntup%A7iN z>i9@mSy?f8IUY7e1Ry#wWP`egy=E-ByQ`=GhO~XG*KCLu^~y{Q+o0Y-FB!-@oHEj)2_-7`2xK8UIW(yixJCBzhE3TzPFW8CxaeTdhqVMEXP~mMm&)|;5pF9-S%Evo zs+)VMt`D$FTgy77!`tImgpLIwwy2xf37a|!cU5A5JU!Rb$s%G~*RHNQ1wcWe9R`?& zYpFfcDF8qb41Hd0G;p*U9}FxKHNqRD%s@ZdjSq%a3EL$RXvc{0!Qe7+sR(GyKpkVo z2Lmxc9tsTAFlv0TuuxC?bI>PQs8a(1>Q&*l}h3O_B&nosD zQkuvn?c29DGuyTR04FPSDK40zkH)t;xzNR8(L-$8HXU5sN0O)hd(**Q5iUGHmKK&V z#X5%2*D<1}g6rkt)Bb`Rk#!s;{UhJt-|o!#;DHCo(!|<=^%@6>Y1y_nlWcqvKuR5j zkQ)A`Z)-98D1eky2%UhJt2;oWbIsIsfzJZSvWi0Raw7`{J7{$8m)Z+O04a+ZG5FSx zu!9EghP32 + import MenuIcon from "./Menu/MenuIcon.svelte"; + import {menuIconVisible, menuVisible} from "../Stores/MenuStore"; import {enableCameraSceneVisibilityStore} from "../Stores/MediaStore"; import CameraControls from "./CameraControls.svelte"; import MyCamera from "./MyCamera.svelte"; @@ -23,6 +25,7 @@ import AudioPlaying from "./UI/AudioPlaying.svelte"; import {soundPlayingStore} from "../Stores/SoundPlayingStore"; import ErrorDialog from "./UI/ErrorDialog.svelte"; + import Menu from "./Menu/Menu.svelte"; import VideoOverlay from "./Video/VideoOverlay.svelte"; import {gameOverlayVisibilityStore} from "../Stores/GameOverlayStoreVisibility"; import {consoleGlobalMessageManagerVisibleStore} from "../Stores/ConsoleGlobalMessageManagerStore"; @@ -63,6 +66,19 @@ {/if} + + + {#if $menuIconVisible} +
+ +
+ {/if} + {#if $menuVisible} +
+ +
+ {/if} + {#if $gameOverlayVisibilityStore}
diff --git a/front/src/Components/Menu/EditProfileMenu.svelte b/front/src/Components/Menu/EditProfileMenu.svelte new file mode 100644 index 00000000..94dd4308 --- /dev/null +++ b/front/src/Components/Menu/EditProfileMenu.svelte @@ -0,0 +1,73 @@ + + +
+
+
Edit your profile
+
+
+ +
+
+ +
+
+ +
+
+ + \ No newline at end of file diff --git a/front/src/Components/Menu/GameQualityMenu.svelte b/front/src/Components/Menu/GameQualityMenu.svelte new file mode 100644 index 00000000..e57d1336 --- /dev/null +++ b/front/src/Components/Menu/GameQualityMenu.svelte @@ -0,0 +1,121 @@ + + +
+
+
Game quality
+

(Editing these settings will restart the game)

+ +
+
+
Video quality
+ +
+
+ +
+
+ +
+
+ + \ No newline at end of file diff --git a/front/src/Components/Menu/Menu.svelte b/front/src/Components/Menu/Menu.svelte new file mode 100644 index 00000000..69a248b4 --- /dev/null +++ b/front/src/Components/Menu/Menu.svelte @@ -0,0 +1,73 @@ + + + + + + \ No newline at end of file diff --git a/front/src/Components/Menu/MenuIcon.svelte b/front/src/Components/Menu/MenuIcon.svelte index 241bf45f..f70f7eed 100644 --- a/front/src/Components/Menu/MenuIcon.svelte +++ b/front/src/Components/Menu/MenuIcon.svelte @@ -1,33 +1,41 @@
-
diff --git a/front/src/Phaser/Components/Loader.ts b/front/src/Phaser/Components/Loader.ts index 1ee18b32..c80e31b8 100644 --- a/front/src/Phaser/Components/Loader.ts +++ b/front/src/Phaser/Components/Loader.ts @@ -1,48 +1,63 @@ import ImageFrameConfig = Phaser.Types.Loader.FileTypes.ImageFrameConfig; +import { DirtyScene } from "../Game/DirtyScene"; -const LogoNameIndex: string = 'logoLoading'; -const TextName: string = 'Loading...'; -const LogoResource: string = 'resources/logos/logo.png'; -const LogoFrame: ImageFrameConfig = {frameWidth: 307, frameHeight: 59}; +const LogoNameIndex: string = "logoLoading"; +const TextName: string = "Loading..."; +const LogoResource: string = "resources/logos/logo.png"; +const LogoFrame: ImageFrameConfig = { frameWidth: 307, frameHeight: 59 }; export const addLoader = (scene: Phaser.Scene): void => { // If there is nothing to load, do not display the loader. if (scene.load.list.entries.length === 0) { return; } - let loadingText: Phaser.GameObjects.Text|null = null; + let loadingText: Phaser.GameObjects.Text | null = null; const loadingBarWidth: number = Math.floor(scene.game.renderer.width / 3); const loadingBarHeight: number = 16; const padding: number = 5; const promiseLoadLogoTexture = new Promise((res) => { - if(scene.load.textureManager.exists(LogoNameIndex)){ - return res(scene.add.image(scene.game.renderer.width / 2, scene.game.renderer.height / 2 - 150, LogoNameIndex)); - }else{ + if (scene.load.textureManager.exists(LogoNameIndex)) { + return res( + scene.add.image(scene.game.renderer.width / 2, scene.game.renderer.height / 2 - 150, LogoNameIndex) + ); + } else { //add loading if logo image is not ready loadingText = scene.add.text(scene.game.renderer.width / 2, scene.game.renderer.height / 2 - 50, TextName); } scene.load.spritesheet(LogoNameIndex, LogoResource, LogoFrame); scene.load.once(`filecomplete-spritesheet-${LogoNameIndex}`, () => { - if(loadingText){ + if (loadingText) { loadingText.destroy(); } - return res(scene.add.image(scene.game.renderer.width / 2, scene.game.renderer.height / 2 - 150, LogoNameIndex)); + return res( + scene.add.image(scene.game.renderer.width / 2, scene.game.renderer.height / 2 - 150, LogoNameIndex) + ); }); }); const progressContainer = scene.add.graphics(); const progress = scene.add.graphics(); progressContainer.fillStyle(0x444444, 0.8); - progressContainer.fillRect((scene.game.renderer.width - loadingBarWidth) / 2 - padding, scene.game.renderer.height / 2 + 50 - padding, loadingBarWidth + padding * 2, loadingBarHeight + padding * 2); + progressContainer.fillRect( + (scene.game.renderer.width - loadingBarWidth) / 2 - padding, + scene.game.renderer.height / 2 + 50 - padding, + loadingBarWidth + padding * 2, + loadingBarHeight + padding * 2 + ); - scene.load.on('progress', (value: number) => { + scene.load.on("progress", (value: number) => { progress.clear(); - progress.fillStyle(0xBBBBBB, 1); - progress.fillRect((scene.game.renderer.width - loadingBarWidth) / 2, scene.game.renderer.height / 2 + 50, loadingBarWidth * value, loadingBarHeight); + progress.fillStyle(0xbbbbbb, 1); + progress.fillRect( + (scene.game.renderer.width - loadingBarWidth) / 2, + scene.game.renderer.height / 2 + 50, + loadingBarWidth * value, + loadingBarHeight + ); }); - scene.load.on('complete', () => { - if(loadingText){ + scene.load.on("complete", () => { + if (loadingText) { loadingText.destroy(); } promiseLoadLogoTexture.then((resLoadingImage: Phaser.GameObjects.Image) => { @@ -50,5 +65,8 @@ export const addLoader = (scene: Phaser.Scene): void => { }); progress.destroy(); progressContainer.destroy(); + if (scene instanceof DirtyScene) { + scene.markDirty(); + } }); -} +}; diff --git a/front/src/Phaser/Game/GameManager.ts b/front/src/Phaser/Game/GameManager.ts index 3e39de9a..56c0d751 100644 --- a/front/src/Phaser/Game/GameManager.ts +++ b/front/src/Phaser/Game/GameManager.ts @@ -9,6 +9,7 @@ import { localUserStore } from "../../Connexion/LocalUserStore"; import { get } from "svelte/store"; import { requestedCameraState, requestedMicrophoneState } from "../../Stores/MediaStore"; import { helpCameraSettingsVisibleStore } from "../../Stores/HelpCameraSettingsStore"; +import { menuIconVisible } from "../../Stores/MenuStore"; /** * This class should be responsible for any scene starting/stopping @@ -97,6 +98,7 @@ export class GameManager { this.currentGameSceneName = scene.scene.key; const menuScene: MenuScene = scene.scene.get(MenuSceneName) as MenuScene; menuScene.revealMenuIcon(); + menuIconVisible.set(true); } /** diff --git a/front/src/Phaser/Login/CustomizeScene.ts b/front/src/Phaser/Login/CustomizeScene.ts index c65dabbb..c1a31901 100644 --- a/front/src/Phaser/Login/CustomizeScene.ts +++ b/front/src/Phaser/Login/CustomizeScene.ts @@ -281,7 +281,7 @@ export class CustomizeScene extends AbstractCharacterScene { this.scene.sleep(CustomizeSceneName); waScaleManager.restoreZoom(); this.events.removeListener("wake"); - gameManager.tryResumingGame(this, EnableCameraSceneName); + gameManager.tryResumingGame(EnableCameraSceneName); customCharacterSceneVisibleStore.set(false); } diff --git a/front/src/Phaser/Login/EnableCameraScene.ts b/front/src/Phaser/Login/EnableCameraScene.ts index ba27cd07..55fc4b82 100644 --- a/front/src/Phaser/Login/EnableCameraScene.ts +++ b/front/src/Phaser/Login/EnableCameraScene.ts @@ -1,50 +1,43 @@ -import {gameManager} from "../Game/GameManager"; -import {TextField} from "../Components/TextField"; +import { gameManager } from "../Game/GameManager"; +import { TextField } from "../Components/TextField"; import Image = Phaser.GameObjects.Image; -import {mediaManager} from "../../WebRtc/MediaManager"; -import {SoundMeter} from "../Components/SoundMeter"; -import {HtmlUtils} from "../../WebRtc/HtmlUtils"; -import {touchScreenManager} from "../../Touch/TouchScreenManager"; -import {PinchManager} from "../UserInput/PinchManager"; +import { mediaManager } from "../../WebRtc/MediaManager"; +import { SoundMeter } from "../Components/SoundMeter"; +import { HtmlUtils } from "../../WebRtc/HtmlUtils"; +import { touchScreenManager } from "../../Touch/TouchScreenManager"; +import { PinchManager } from "../UserInput/PinchManager"; import Zone = Phaser.GameObjects.Zone; import { MenuScene } from "../Menu/MenuScene"; -import {ResizableScene} from "./ResizableScene"; -import { - enableCameraSceneVisibilityStore, -} from "../../Stores/MediaStore"; +import { ResizableScene } from "./ResizableScene"; +import { enableCameraSceneVisibilityStore } from "../../Stores/MediaStore"; export const EnableCameraSceneName = "EnableCameraScene"; export class EnableCameraScene extends ResizableScene { - constructor() { super({ - key: EnableCameraSceneName + key: EnableCameraSceneName, }); } - preload() { - } + preload() {} create() { - - this.input.keyboard.on('keyup-ENTER', () => { + this.input.keyboard.on("keyup-ENTER", () => { this.login(); }); enableCameraSceneVisibilityStore.showEnableCameraScene(); } - public onResize(): void { - } + public onResize(): void {} - update(time: number, delta: number): void { - } + update(time: number, delta: number): void {} public login(): void { enableCameraSceneVisibilityStore.hideEnableCameraScene(); this.scene.sleep(EnableCameraSceneName); - gameManager.goToStartingMap(this.scene); + gameManager.goToStartingMap(); } } diff --git a/front/src/Phaser/Login/LoginScene.ts b/front/src/Phaser/Login/LoginScene.ts index 39a8f5f3..0cca9ccd 100644 --- a/front/src/Phaser/Login/LoginScene.ts +++ b/front/src/Phaser/Login/LoginScene.ts @@ -1,23 +1,21 @@ -import {gameManager} from "../Game/GameManager"; -import {SelectCharacterSceneName} from "./SelectCharacterScene"; -import {ResizableScene} from "./ResizableScene"; -import {loginSceneVisibleStore} from "../../Stores/LoginSceneStore"; +import { gameManager } from "../Game/GameManager"; +import { SelectCharacterSceneName } from "./SelectCharacterScene"; +import { ResizableScene } from "./ResizableScene"; +import { loginSceneVisibleStore } from "../../Stores/LoginSceneStore"; export const LoginSceneName = "LoginScene"; export class LoginScene extends ResizableScene { - - private name: string = ''; + private name: string = ""; constructor() { super({ - key: LoginSceneName + key: LoginSceneName, }); - this.name = gameManager.getPlayerName() || ''; + this.name = gameManager.getPlayerName() || ""; } - preload() { - } + preload() {} create() { loginSceneVisibleStore.set(true); @@ -27,15 +25,13 @@ export class LoginScene extends ResizableScene { name = name.trim(); gameManager.setPlayerName(name); - this.scene.stop(LoginSceneName) - gameManager.tryResumingGame(this, SelectCharacterSceneName); + this.scene.stop(LoginSceneName); + gameManager.tryResumingGame(SelectCharacterSceneName); this.scene.remove(LoginSceneName); loginSceneVisibleStore.set(false); } - update(time: number, delta: number): void { - } + update(time: number, delta: number): void {} - public onResize(): void { - } + public onResize(): void {} } diff --git a/front/src/Phaser/Login/SelectCharacterScene.ts b/front/src/Phaser/Login/SelectCharacterScene.ts index 0f590840..dd38706f 100644 --- a/front/src/Phaser/Login/SelectCharacterScene.ts +++ b/front/src/Phaser/Login/SelectCharacterScene.ts @@ -1,25 +1,25 @@ -import {gameManager} from "../Game/GameManager"; +import { gameManager } from "../Game/GameManager"; import Rectangle = Phaser.GameObjects.Rectangle; -import {EnableCameraSceneName} from "./EnableCameraScene"; -import {CustomizeSceneName} from "./CustomizeScene"; -import {localUserStore} from "../../Connexion/LocalUserStore"; -import {loadAllDefaultModels} from "../Entity/PlayerTexturesLoadingManager"; -import {addLoader} from "../Components/Loader"; -import type {BodyResourceDescriptionInterface} from "../Entity/PlayerTextures"; -import {AbstractCharacterScene} from "./AbstractCharacterScene"; -import {areCharacterLayersValid} from "../../Connexion/LocalUser"; -import {touchScreenManager} from "../../Touch/TouchScreenManager"; -import {PinchManager} from "../UserInput/PinchManager"; -import {selectCharacterSceneVisibleStore} from "../../Stores/SelectCharacterStore"; -import {waScaleManager} from "../Services/WaScaleManager"; -import {isMobile} from "../../Enum/EnvironmentVariable"; +import { EnableCameraSceneName } from "./EnableCameraScene"; +import { CustomizeSceneName } from "./CustomizeScene"; +import { localUserStore } from "../../Connexion/LocalUserStore"; +import { loadAllDefaultModels } from "../Entity/PlayerTexturesLoadingManager"; +import { addLoader } from "../Components/Loader"; +import type { BodyResourceDescriptionInterface } from "../Entity/PlayerTextures"; +import { AbstractCharacterScene } from "./AbstractCharacterScene"; +import { areCharacterLayersValid } from "../../Connexion/LocalUser"; +import { touchScreenManager } from "../../Touch/TouchScreenManager"; +import { PinchManager } from "../UserInput/PinchManager"; +import { selectCharacterSceneVisibleStore } from "../../Stores/SelectCharacterStore"; +import { waScaleManager } from "../Services/WaScaleManager"; +import { isMobile } from "../../Enum/EnvironmentVariable"; //todo: put this constants in a dedicated file export const SelectCharacterSceneName = "SelectCharacterScene"; export class SelectCharacterScene extends AbstractCharacterScene { protected readonly nbCharactersPerRow = 6; - protected selectedPlayer!: Phaser.Physics.Arcade.Sprite|null; // null if we are selecting the "customize" option + protected selectedPlayer!: Phaser.Physics.Arcade.Sprite | null; // null if we are selecting the "customize" option protected players: Array = new Array(); protected playerModels!: BodyResourceDescriptionInterface[]; @@ -38,7 +38,6 @@ export class SelectCharacterScene extends AbstractCharacterScene { } preload() { - this.loadSelectSceneCharacters().then((bodyResourceDescriptions) => { bodyResourceDescriptions.forEach((bodyResourceDescription) => { this.playerModels.push(bodyResourceDescription); @@ -54,7 +53,7 @@ export class SelectCharacterScene extends AbstractCharacterScene { create() { selectCharacterSceneVisibleStore.set(true); - this.events.addListener('wake', () => { + this.events.addListener("wake", () => { waScaleManager.saveZoom(); waScaleManager.zoomModifier = isMobile() ? 2 : 1; selectCharacterSceneVisibleStore.set(true); @@ -68,26 +67,26 @@ export class SelectCharacterScene extends AbstractCharacterScene { waScaleManager.zoomModifier = isMobile() ? 2 : 1; const rectangleXStart = this.game.renderer.width / 2 - (this.nbCharactersPerRow / 2) * 32 + 16; - this.selectedRectangle = this.add.rectangle(rectangleXStart, 90, 32, 32).setStrokeStyle(2, 0xFFFFFF); + this.selectedRectangle = this.add.rectangle(rectangleXStart, 90, 32, 32).setStrokeStyle(2, 0xffffff); this.selectedRectangle.setDepth(2); /*create user*/ this.createCurrentPlayer(); - this.input.keyboard.on('keyup-ENTER', () => { + this.input.keyboard.on("keyup-ENTER", () => { return this.nextSceneToCameraScene(); }); - this.input.keyboard.on('keydown-RIGHT', () => { + this.input.keyboard.on("keydown-RIGHT", () => { this.moveToRight(); }); - this.input.keyboard.on('keydown-LEFT', () => { + this.input.keyboard.on("keydown-LEFT", () => { this.moveToLeft(); }); - this.input.keyboard.on('keydown-UP', () => { + this.input.keyboard.on("keydown-UP", () => { this.moveToUp(); }); - this.input.keyboard.on('keydown-DOWN', () => { + this.input.keyboard.on("keydown-DOWN", () => { this.moveToDown(); }); } @@ -96,16 +95,16 @@ export class SelectCharacterScene extends AbstractCharacterScene { if (this.selectedPlayer !== null && !areCharacterLayersValid([this.selectedPlayer.texture.key])) { return; } - if(!this.selectedPlayer){ + if (!this.selectedPlayer) { return; } this.scene.stop(SelectCharacterSceneName); waScaleManager.restoreZoom(); gameManager.setCharacterLayers([this.selectedPlayer.texture.key]); - gameManager.tryResumingGame(this, EnableCameraSceneName); + gameManager.tryResumingGame(EnableCameraSceneName); this.players = []; selectCharacterSceneVisibleStore.set(false); - this.events.removeListener('wake'); + this.events.removeListener("wake"); } public nextSceneToCustomizeScene(): void { @@ -119,11 +118,11 @@ export class SelectCharacterScene extends AbstractCharacterScene { } createCurrentPlayer(): void { - for (let i = 0; i c.texture.key === playerResource.name)){ + if (this.players.find((c) => c.texture.key === playerResource.name)) { continue; } @@ -132,9 +131,9 @@ export class SelectCharacterScene extends AbstractCharacterScene { this.setUpPlayer(player, i); this.anims.create({ key: playerResource.name, - frames: this.anims.generateFrameNumbers(playerResource.name, {start: 0, end: 11}), + frames: this.anims.generateFrameNumbers(playerResource.name, { start: 0, end: 11 }), frameRate: 8, - repeat: -1 + repeat: -1, }); player.setInteractive().on("pointerdown", () => { if (this.pointerClicked) { @@ -157,73 +156,72 @@ export class SelectCharacterScene extends AbstractCharacterScene { this.selectedPlayer.play(this.playerModels[this.currentSelectUser].name); } - protected moveUser(){ - for(let i = 0; i < this.players.length; i++){ + protected moveUser() { + for (let i = 0; i < this.players.length; i++) { const player = this.players[i]; this.setUpPlayer(player, i); } this.updateSelectedPlayer(); } - public moveToLeft(){ - if(this.currentSelectUser === 0){ + public moveToLeft() { + if (this.currentSelectUser === 0) { return; } this.currentSelectUser -= 1; this.moveUser(); } - public moveToRight(){ - if(this.currentSelectUser === (this.players.length - 1)){ + public moveToRight() { + if (this.currentSelectUser === this.players.length - 1) { return; } this.currentSelectUser += 1; this.moveUser(); } - protected moveToUp(){ - if(this.currentSelectUser < this.nbCharactersPerRow){ + protected moveToUp() { + if (this.currentSelectUser < this.nbCharactersPerRow) { return; } this.currentSelectUser -= this.nbCharactersPerRow; this.moveUser(); } - protected moveToDown(){ - if((this.currentSelectUser + this.nbCharactersPerRow) > (this.players.length - 1)){ + protected moveToDown() { + if (this.currentSelectUser + this.nbCharactersPerRow > this.players.length - 1) { return; } this.currentSelectUser += this.nbCharactersPerRow; this.moveUser(); } - protected defineSetupPlayer(num: number){ + protected defineSetupPlayer(num: number) { const deltaX = 32; const deltaY = 32; let [playerX, playerY] = this.getCharacterPosition(); // player X and player y are middle of the - playerX = ( (playerX - (deltaX * 2.5)) + ((deltaX) * (num % this.nbCharactersPerRow)) ); // calcul position on line users - playerY = ( (playerY - (deltaY * 2)) + ((deltaY) * ( Math.floor(num / this.nbCharactersPerRow) )) ); // calcul position on column users + playerX = playerX - deltaX * 2.5 + deltaX * (num % this.nbCharactersPerRow); // calcul position on line users + playerY = playerY - deltaY * 2 + deltaY * Math.floor(num / this.nbCharactersPerRow); // calcul position on column users const playerVisible = true; const playerScale = 1; const playerOpacity = 1; // if selected - if( num === this.currentSelectUser ){ + if (num === this.currentSelectUser) { this.selectedRectangle.setX(playerX); this.selectedRectangle.setY(playerY); } - return {playerX, playerY, playerScale, playerOpacity, playerVisible} + return { playerX, playerY, playerScale, playerOpacity, playerVisible }; } - protected setUpPlayer(player: Phaser.Physics.Arcade.Sprite, num: number){ - - const {playerX, playerY, playerScale, playerOpacity, playerVisible} = this.defineSetupPlayer(num); + protected setUpPlayer(player: Phaser.Physics.Arcade.Sprite, num: number) { + const { playerX, playerY, playerScale, playerOpacity, playerVisible } = this.defineSetupPlayer(num); player.setBounce(0.2); player.setCollideWorldBounds(false); - player.setVisible( playerVisible ); + player.setVisible(playerVisible); player.setScale(playerScale, playerScale); player.setAlpha(playerOpacity); player.setX(playerX); @@ -234,10 +232,7 @@ export class SelectCharacterScene extends AbstractCharacterScene { * Returns pixel position by on column and row number */ protected getCharacterPosition(): [number, number] { - return [ - this.game.renderer.width / 2, - this.game.renderer.height / 2.5 - ]; + return [this.game.renderer.width / 2, this.game.renderer.height / 2.5]; } protected updateSelectedPlayer(): void { @@ -256,7 +251,7 @@ export class SelectCharacterScene extends AbstractCharacterScene { this.pointerClicked = false; } - if(this.lazyloadingAttempt){ + if (this.lazyloadingAttempt) { //re-render players list this.createCurrentPlayer(); this.moveUser(); diff --git a/front/src/Phaser/Login/SelectCompanionScene.ts b/front/src/Phaser/Login/SelectCompanionScene.ts index 4c29f942..ed0947cf 100644 --- a/front/src/Phaser/Login/SelectCompanionScene.ts +++ b/front/src/Phaser/Login/SelectCompanionScene.ts @@ -1,18 +1,18 @@ import Image = Phaser.GameObjects.Image; import Rectangle = Phaser.GameObjects.Rectangle; import { addLoader } from "../Components/Loader"; -import { gameManager} from "../Game/GameManager"; +import { gameManager } from "../Game/GameManager"; import { ResizableScene } from "./ResizableScene"; import { EnableCameraSceneName } from "./EnableCameraScene"; import { localUserStore } from "../../Connexion/LocalUserStore"; import type { CompanionResourceDescriptionInterface } from "../Companion/CompanionTextures"; import { getAllCompanionResources } from "../Companion/CompanionTexturesLoadingManager"; -import {touchScreenManager} from "../../Touch/TouchScreenManager"; -import {PinchManager} from "../UserInput/PinchManager"; +import { touchScreenManager } from "../../Touch/TouchScreenManager"; +import { PinchManager } from "../UserInput/PinchManager"; import { MenuScene } from "../Menu/MenuScene"; -import {selectCompanionSceneVisibleStore} from "../../Stores/SelectCompanionStore"; -import {waScaleManager} from "../Services/WaScaleManager"; -import {isMobile} from "../../Enum/EnvironmentVariable"; +import { selectCompanionSceneVisibleStore } from "../../Stores/SelectCompanionStore"; +import { waScaleManager } from "../Services/WaScaleManager"; +import { isMobile } from "../../Enum/EnvironmentVariable"; export const SelectCompanionSceneName = "SelectCompanionScene"; @@ -28,12 +28,12 @@ export class SelectCompanionScene extends ResizableScene { constructor() { super({ - key: SelectCompanionSceneName + key: SelectCompanionSceneName, }); } preload() { - getAllCompanionResources(this.load).forEach(model => { + getAllCompanionResources(this.load).forEach((model) => { this.companionModels.push(model); }); @@ -42,7 +42,6 @@ export class SelectCompanionScene extends ResizableScene { } create() { - selectCompanionSceneVisibleStore.set(true); waScaleManager.saveZoom(); @@ -53,14 +52,16 @@ export class SelectCompanionScene extends ResizableScene { } // input events - this.input.keyboard.on('keyup-ENTER', this.selectCompanion.bind(this)); + this.input.keyboard.on("keyup-ENTER", this.selectCompanion.bind(this)); - this.input.keyboard.on('keydown-RIGHT', this.moveToRight.bind(this)); - this.input.keyboard.on('keydown-LEFT', this.moveToLeft.bind(this)); + this.input.keyboard.on("keydown-RIGHT", this.moveToRight.bind(this)); + this.input.keyboard.on("keydown-LEFT", this.moveToLeft.bind(this)); - if(localUserStore.getCompanion()){ - const companionIndex = this.companionModels.findIndex((companion) => companion.name === localUserStore.getCompanion()); - if(companionIndex > -1 || companionIndex < this.companions.length){ + if (localUserStore.getCompanion()) { + const companionIndex = this.companionModels.findIndex( + (companion) => companion.name === localUserStore.getCompanion() + ); + if (companionIndex > -1 || companionIndex < this.companions.length) { this.currentCompanion = companionIndex; this.selectedCompanion = this.companions[companionIndex]; } @@ -89,26 +90,26 @@ export class SelectCompanionScene extends ResizableScene { this.closeScene(); } - public closeScene(){ + public closeScene() { // next scene this.scene.stop(SelectCompanionSceneName); waScaleManager.restoreZoom(); - gameManager.tryResumingGame(this, EnableCameraSceneName); + gameManager.tryResumingGame(EnableCameraSceneName); this.scene.remove(SelectCompanionSceneName); selectCompanionSceneVisibleStore.set(false); } private createCurrentCompanion(): void { for (let i = 0; i < this.companionModels.length; i++) { - const companionResource = this.companionModels[i] + const companionResource = this.companionModels[i]; const [middleX, middleY] = this.getCompanionPosition(); const companion = this.physics.add.sprite(middleX, middleY, companionResource.name, 0); this.setUpCompanion(companion, i); this.anims.create({ key: companionResource.name, - frames: this.anims.generateFrameNumbers(companionResource.name, {start: 0, end: 2,}), + frames: this.anims.generateFrameNumbers(companionResource.name, { start: 0, end: 2 }), frameRate: 10, - repeat: -1 + repeat: -1, }); companion.setInteractive().on("pointerdown", () => { @@ -140,87 +141,84 @@ export class SelectCompanionScene extends ResizableScene { this.selectedCompanion = companion; } - private moveCompanion(){ - for(let i = 0; i < this.companions.length; i++){ + private moveCompanion() { + for (let i = 0; i < this.companions.length; i++) { const companion = this.companions[i]; this.setUpCompanion(companion, i); } this.updateSelectedCompanion(); } - public moveToRight(){ - if(this.currentCompanion === (this.companions.length - 1)){ + public moveToRight() { + if (this.currentCompanion === this.companions.length - 1) { return; } this.currentCompanion += 1; this.moveCompanion(); } - public moveToLeft(){ - if(this.currentCompanion === 0){ + public moveToLeft() { + if (this.currentCompanion === 0) { return; } this.currentCompanion -= 1; this.moveCompanion(); } - private defineSetupCompanion(num: number){ + private defineSetupCompanion(num: number) { const deltaX = 30; const deltaY = 2; let [companionX, companionY] = this.getCompanionPosition(); let companionVisible = true; let companionScale = 1.5; let companionOpactity = 1; - if( this.currentCompanion !== num ){ + if (this.currentCompanion !== num) { companionVisible = false; } - if( num === (this.currentCompanion + 1) ){ + if (num === this.currentCompanion + 1) { companionY -= deltaY; companionX += deltaX; companionScale = 0.8; companionOpactity = 0.6; companionVisible = true; } - if( num === (this.currentCompanion + 2) ){ + if (num === this.currentCompanion + 2) { companionY -= deltaY; - companionX += (deltaX * 2); + companionX += deltaX * 2; companionScale = 0.8; companionOpactity = 0.6; companionVisible = true; } - if( num === (this.currentCompanion - 1) ){ + if (num === this.currentCompanion - 1) { companionY -= deltaY; companionX -= deltaX; companionScale = 0.8; companionOpactity = 0.6; companionVisible = true; } - if( num === (this.currentCompanion - 2) ){ + if (num === this.currentCompanion - 2) { companionY -= deltaY; - companionX -= (deltaX * 2); + companionX -= deltaX * 2; companionScale = 0.8; companionOpactity = 0.6; companionVisible = true; } - return {companionX, companionY, companionScale, companionOpactity, companionVisible} + return { companionX, companionY, companionScale, companionOpactity, companionVisible }; } /** * Returns pixel position by on column and row number */ private getCompanionPosition(): [number, number] { - return [ - this.game.renderer.width / 2, - this.game.renderer.height / 3 - ]; + return [this.game.renderer.width / 2, this.game.renderer.height / 3]; } - private setUpCompanion(companion: Phaser.Physics.Arcade.Sprite, numero: number){ - - const {companionX, companionY, companionScale, companionOpactity, companionVisible} = this.defineSetupCompanion(numero); + private setUpCompanion(companion: Phaser.Physics.Arcade.Sprite, numero: number) { + const { companionX, companionY, companionScale, companionOpactity, companionVisible } = + this.defineSetupCompanion(numero); companion.setBounce(0.2); companion.setCollideWorldBounds(true); - companion.setVisible( companionVisible ); + companion.setVisible(companionVisible); companion.setScale(companionScale, companionScale); companion.setAlpha(companionOpactity); companion.setX(companionX); diff --git a/front/src/Phaser/Menu/MenuScene.ts b/front/src/Phaser/Menu/MenuScene.ts index da59cecb..960dff8c 100644 --- a/front/src/Phaser/Menu/MenuScene.ts +++ b/front/src/Phaser/Menu/MenuScene.ts @@ -8,7 +8,7 @@ import { connectionManager } from "../../Connexion/ConnectionManager"; import { GameConnexionTypes } from "../../Url/UrlManager"; import { WarningContainer, warningContainerHtml, warningContainerKey } from "../Components/WarningContainer"; import { worldFullWarningStream } from "../../Connexion/WorldFullWarningStream"; -import { menuIconVisible } from "../../Stores/MenuStore"; +import { menuIconVisible, menuVisible } from "../../Stores/MenuStore"; import { videoConstraintStore } from "../../Stores/MediaStore"; import { showReportScreenStore } from "../../Stores/ShowReportScreenStore"; import { HtmlUtils } from "../../WebRtc/HtmlUtils"; @@ -18,7 +18,6 @@ import { registerMenuCommandStream } from "../../Api/Events/ui/MenuItemRegisterE import { sendMenuClickedEvent } from "../../Api/iframe/Ui/MenuItem"; import { consoleGlobalMessageManagerVisibleStore } from "../../Stores/ConsoleGlobalMessageManagerStore"; import { get } from "svelte/store"; -import { playersStore } from "../../Stores/PlayersStore"; export const MenuSceneName = "MenuScene"; const gameMenuKey = "gameMenu"; @@ -93,7 +92,6 @@ export class MenuScene extends Phaser.Scene { } create() { - menuIconVisible.set(true); this.menuElement = this.add.dom(closedSideMenuX, 30).createFromCache(gameMenuKey); this.menuElement.setOrigin(0); MenuScene.revealMenusAfterInit(this.menuElement, "gameMenu"); @@ -121,11 +119,7 @@ export class MenuScene extends Phaser.Scene { showReportScreenStore.subscribe((user) => { if (user !== null) { this.closeAll(); - const uuid = playersStore.getPlayerById(user.userId)?.userUuid; - if (uuid === undefined) { - throw new Error("Could not find UUID for user with ID " + user.userId); - } - this.gameReportElement.open(uuid, user.userName); + this.gameReportElement.open(user.userId, user.userName); } }); @@ -154,6 +148,7 @@ export class MenuScene extends Phaser.Scene { } public revealMenuIcon(): void { + return; //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; @@ -163,26 +158,28 @@ export class MenuScene extends Phaser.Scene { } openSideMenu() { + menuVisible.set(true); if (this.sideMenuOpened) return; - this.closeAll(); + + /*this.closeAll(); this.sideMenuOpened = true; - this.menuButton.getChildByID("openMenuButton").innerHTML = "X"; + this.menuButton.getChildByID('openMenuButton').innerHTML = 'X'; const connection = gameManager.getCurrentGameScene(this).connection; if (connection && connection.isAdmin()) { - const adminSection = this.menuElement.getChildByID("adminConsoleSection") as HTMLElement; + const adminSection = this.menuElement.getChildByID('adminConsoleSection') as HTMLElement; adminSection.hidden = false; } //TODO bind with future metadata of card //if (connectionManager.getConnexionType === GameConnexionTypes.anonymous){ - const adminSection = this.menuElement.getChildByID("socialLinks") as HTMLElement; + const adminSection = this.menuElement.getChildByID('socialLinks') as HTMLElement; adminSection.hidden = false; //} this.tweens.add({ targets: this.menuElement, x: openedSideMenuX, duration: 500, - ease: "Power3", - }); + ease: 'Power3' + });*/ } private showWorldCapacityWarning() { @@ -200,17 +197,18 @@ export class MenuScene extends Phaser.Scene { } private closeSideMenu(): void { - if (!this.sideMenuOpened) return; + menuVisible.set(false); + /* if (!this.sideMenuOpened) return; this.sideMenuOpened = false; this.closeAll(); - this.menuButton.getChildByID("openMenuButton").innerHTML = ``; + this.menuButton.getChildByID('openMenuButton').innerHTML = ``; consoleGlobalMessageManagerVisibleStore.set(false); this.tweens.add({ targets: this.menuElement, x: closedSideMenuX, duration: 500, - ease: "Power3", - }); + ease: 'Power3' + });*/ } private openGameSettingsMenu(): void { @@ -332,18 +330,18 @@ export class MenuScene extends Phaser.Scene { switch ((event?.target as HTMLInputElement).id) { case "changeNameButton": this.closeSideMenu(); - gameManager.leaveGame(this, LoginSceneName, new LoginScene()); + gameManager.leaveGame(LoginSceneName, new LoginScene()); break; case "sparkButton": this.gotToCreateMapPage(); break; case "changeSkinButton": this.closeSideMenu(); - gameManager.leaveGame(this, SelectCharacterSceneName, new SelectCharacterScene()); + gameManager.leaveGame(SelectCharacterSceneName, new SelectCharacterScene()); break; case "changeCompanionButton": this.closeSideMenu(); - gameManager.leaveGame(this, SelectCompanionSceneName, new SelectCompanionScene()); + gameManager.leaveGame(SelectCompanionSceneName, new SelectCompanionScene()); break; case "closeButton": this.closeSideMenu(); diff --git a/front/src/Phaser/Menu/ReportMenu.ts b/front/src/Phaser/Menu/ReportMenu.ts index effb92b2..0bb863b3 100644 --- a/front/src/Phaser/Menu/ReportMenu.ts +++ b/front/src/Phaser/Menu/ReportMenu.ts @@ -1,7 +1,6 @@ import { MenuScene } from "./MenuScene"; import { gameManager } from "../Game/GameManager"; import { blackListManager } from "../../WebRtc/BlackListManager"; -import { playersStore } from "../../Stores/PlayersStore"; export const gameReportKey = "gameReport"; export const gameReportRessource = "resources/html/gameReport.html"; @@ -9,7 +8,7 @@ export const gameReportRessource = "resources/html/gameReport.html"; export class ReportMenu extends Phaser.GameObjects.DOMElement { private opened: boolean = false; - private userUuid!: string; + private userId!: number; private userName!: string | undefined; private anonymous: boolean; @@ -41,13 +40,13 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement { }); } - public open(userUuid: string, userName: string | undefined): void { + public open(userId: number, userName: string | undefined): void { if (this.opened) { this.close(); return; } - this.userUuid = userUuid; + this.userId = userId; this.userName = userName; const mainEl = this.getChildByID("gameReport") as HTMLElement; @@ -58,11 +57,11 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement { gameTitleReport.innerText = userName || ""; const blockButton = this.getChildByID("toggleBlockButton") as HTMLElement; - blockButton.innerText = blackListManager.isBlackListed(this.userUuid) ? "Unblock this user" : "Block this user"; + blockButton.innerText = blackListManager.isBlackListed(this.userId) ? "Unblock this user" : "Block this user"; this.opened = true; - gameManager.getCurrentGameScene(this.scene).userInputManager.disableControls(); + gameManager.getCurrentGameScene().userInputManager.disableControls(); this.scene.tweens.add({ targets: this, @@ -73,7 +72,7 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement { } public close(): void { - gameManager.getCurrentGameScene(this.scene).userInputManager.restoreControls(); + gameManager.getCurrentGameScene().userInputManager.restoreControls(); this.opened = false; const mainEl = this.getChildByID("gameReport") as HTMLElement; this.scene.tweens.add({ @@ -96,9 +95,9 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement { } private toggleBlock(): void { - !blackListManager.isBlackListed(this.userUuid) - ? blackListManager.blackList(this.userUuid) - : blackListManager.cancelBlackList(this.userUuid); + !blackListManager.isBlackListed(this.userId) + ? blackListManager.blackList(this.userId) + : blackListManager.cancelBlackList(this.userId); this.close(); } @@ -112,9 +111,7 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement { gamePError.style.display = "block"; return; } - gameManager - .getCurrentGameScene(this.scene) - .connection?.emitReportPlayerMessage(this.userUuid, gameTextArea.value); + gameManager.getCurrentGameScene().connection?.emitReportPlayerMessage(this.userId, gameTextArea.value); this.close(); } } diff --git a/front/src/Stores/MediaStore.ts b/front/src/Stores/MediaStore.ts index 9144a6ee..8d485328 100644 --- a/front/src/Stores/MediaStore.ts +++ b/front/src/Stores/MediaStore.ts @@ -170,7 +170,7 @@ function createVideoConstraintStore() { setFrameRate: (frameRate: number) => update((constraints) => { constraints.frameRate = { ideal: frameRate }; - + localUserStore.setVideoQualityValue(frameRate); return constraints; }), }; diff --git a/front/src/Stores/MenuStore.ts b/front/src/Stores/MenuStore.ts index c7c02130..39b88b3d 100644 --- a/front/src/Stores/MenuStore.ts +++ b/front/src/Stores/MenuStore.ts @@ -1,3 +1,4 @@ import { derived, writable, Writable } from "svelte/store"; export const menuIconVisible = writable(false); +export const menuVisible = writable(false); diff --git a/maps/tests/MenuSvelte.json b/maps/tests/MenuSvelte.json new file mode 100644 index 00000000..f65c7c6c --- /dev/null +++ b/maps/tests/MenuSvelte.json @@ -0,0 +1,136 @@ +{ "compressionlevel":-1, + "height":20, + "infinite":false, + "layers":[ + { + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":20, + "id":2, + "name":"start", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":20, + "x":0, + "y":0 + }, + { + "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "height":20, + "id":4, + "name":"floor", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":20, + "x":0, + "y":0 + }, + { + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":20, + "id":3, + "name":"playSound", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":20, + "x":0, + "y":0 + }, + { + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":20, + "id":6, + "name":"playSoundLoop", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":20, + "x":0, + "y":0 + }, + { + "draworder":"topdown", + "id":5, + "name":"floorLayer", + "objects":[ + { + "height":19.296875, + "id":2, + "name":"", + "rotation":0, + "text": + { + "text":"Play Sound", + "wrap":true + }, + "type":"", + "visible":true, + "width":107.109375, + "x":258.4453125, + "y":197.018229166667 + }, + { + "height":19.296875, + "id":3, + "name":"", + "rotation":0, + "text": + { + "text":"Bonjour Monde", + "wrap":true + }, + "type":"", + "visible":true, + "width":107.109375, + "x":-348.221354166667, + "y":257.018229166667 + }, + { + "height":55.296875, + "id":4, + "name":"", + "rotation":0, + "text": + { + "text":"Play Sound Loop\nexit Zone Stop Sound \n", + "wrap":true + }, + "type":"", + "visible":true, + "width":176.442708333333, + "x":243.778645833333, + "y":368.3515625 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }], + "nextlayerid":8, + "nextobjectid":5, + "orientation":"orthogonal", + "renderorder":"right-down", + "tiledversion":"1.6.0", + "tileheight":32, + "tilesets":[ + { + "columns":11, + "firstgid":1, + "image":"tileset1.png", + "imageheight":352, + "imagewidth":352, + "margin":0, + "name":"tileset1", + "spacing":0, + "tilecount":121, + "tileheight":32, + "tilewidth":32 + }], + "tilewidth":32, + "type":"map", + "version":"1.6", + "width":20 +} \ No newline at end of file From 50f3af81e469742d7fae712aca29d0d39d4d5921 Mon Sep 17 00:00:00 2001 From: kharhamel Date: Tue, 13 Jul 2021 10:54:53 +0200 Subject: [PATCH 007/115] temp --- front/src/Phaser/Login/EnableCameraScene.ts | 2 +- front/src/Phaser/Menu/MenuScene.ts | 8 ++++---- front/src/Phaser/Menu/ReportMenu.ts | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/front/src/Phaser/Login/EnableCameraScene.ts b/front/src/Phaser/Login/EnableCameraScene.ts index 55fc4b82..faeb9c12 100644 --- a/front/src/Phaser/Login/EnableCameraScene.ts +++ b/front/src/Phaser/Login/EnableCameraScene.ts @@ -38,6 +38,6 @@ export class EnableCameraScene extends ResizableScene { enableCameraSceneVisibilityStore.hideEnableCameraScene(); this.scene.sleep(EnableCameraSceneName); - gameManager.goToStartingMap(); + gameManager.goToStartingMap(this.scene); } } diff --git a/front/src/Phaser/Menu/MenuScene.ts b/front/src/Phaser/Menu/MenuScene.ts index 960dff8c..926a45db 100644 --- a/front/src/Phaser/Menu/MenuScene.ts +++ b/front/src/Phaser/Menu/MenuScene.ts @@ -119,7 +119,7 @@ export class MenuScene extends Phaser.Scene { showReportScreenStore.subscribe((user) => { if (user !== null) { this.closeAll(); - this.gameReportElement.open(user.userId, user.userName); + //this.gameReportElement.open(user., user.userName); } }); @@ -330,18 +330,18 @@ export class MenuScene extends Phaser.Scene { switch ((event?.target as HTMLInputElement).id) { case "changeNameButton": this.closeSideMenu(); - gameManager.leaveGame(LoginSceneName, new LoginScene()); + gameManager.leaveGame(this, LoginSceneName, new LoginScene()); break; case "sparkButton": this.gotToCreateMapPage(); break; case "changeSkinButton": this.closeSideMenu(); - gameManager.leaveGame(SelectCharacterSceneName, new SelectCharacterScene()); + gameManager.leaveGame(this, SelectCharacterSceneName, new SelectCharacterScene()); break; case "changeCompanionButton": this.closeSideMenu(); - gameManager.leaveGame(SelectCompanionSceneName, new SelectCompanionScene()); + gameManager.leaveGame(this, SelectCompanionSceneName, new SelectCompanionScene()); break; case "closeButton": this.closeSideMenu(); diff --git a/front/src/Phaser/Menu/ReportMenu.ts b/front/src/Phaser/Menu/ReportMenu.ts index 0bb863b3..82e2e3f2 100644 --- a/front/src/Phaser/Menu/ReportMenu.ts +++ b/front/src/Phaser/Menu/ReportMenu.ts @@ -8,7 +8,7 @@ export const gameReportRessource = "resources/html/gameReport.html"; export class ReportMenu extends Phaser.GameObjects.DOMElement { private opened: boolean = false; - private userId!: number; + private userUuid!: string; private userName!: string | undefined; private anonymous: boolean; @@ -40,13 +40,13 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement { }); } - public open(userId: number, userName: string | undefined): void { + public open(userUuid: string, userName: string | undefined): void { if (this.opened) { this.close(); return; } - this.userId = userId; + this.userUuid = userUuid; this.userName = userName; const mainEl = this.getChildByID("gameReport") as HTMLElement; @@ -57,11 +57,11 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement { gameTitleReport.innerText = userName || ""; const blockButton = this.getChildByID("toggleBlockButton") as HTMLElement; - blockButton.innerText = blackListManager.isBlackListed(this.userId) ? "Unblock this user" : "Block this user"; + blockButton.innerText = blackListManager.isBlackListed(this.userUuid) ? "Unblock this user" : "Block this user"; this.opened = true; - gameManager.getCurrentGameScene().userInputManager.disableControls(); + //gameManager.getCurrentGameScene().userInputManager.disableControls(); this.scene.tweens.add({ targets: this, @@ -72,7 +72,7 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement { } public close(): void { - gameManager.getCurrentGameScene().userInputManager.restoreControls(); + //gameManager.getCurrentGameScene().userInputManager.restoreControls(); this.opened = false; const mainEl = this.getChildByID("gameReport") as HTMLElement; this.scene.tweens.add({ @@ -95,9 +95,9 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement { } private toggleBlock(): void { - !blackListManager.isBlackListed(this.userId) - ? blackListManager.blackList(this.userId) - : blackListManager.cancelBlackList(this.userId); + !blackListManager.isBlackListed(this.userUuid) + ? blackListManager.blackList(this.userUuid) + : blackListManager.cancelBlackList(this.userUuid); this.close(); } @@ -111,7 +111,7 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement { gamePError.style.display = "block"; return; } - gameManager.getCurrentGameScene().connection?.emitReportPlayerMessage(this.userId, gameTextArea.value); + //gameManager.getCurrentGameScene().connection?.emitReportPlayerMessage(this.userId, gameTextArea.value); this.close(); } } From 1ce801cced88d97d2c1efc7239506e0416bb43fa Mon Sep 17 00:00:00 2001 From: kharhamel Date: Tue, 13 Jul 2021 12:00:09 +0200 Subject: [PATCH 008/115] temp --- front/src/Components/App.svelte | 2 +- .../ConsoleGlobalMessageManager.svelte | 5 +-- .../InputTextGlobalMessage.svelte | 5 +-- .../UploadAudioGlobalMessage.svelte | 5 +-- front/src/Components/Menu/Menu.svelte | 21 ++++++--- front/src/Components/Menu/MenuIcon.svelte | 4 +- front/src/Phaser/Game/GameManager.ts | 44 ++++++++++--------- front/src/Phaser/Game/GameScene.ts | 4 +- front/src/Phaser/Login/EnableCameraScene.ts | 2 +- front/src/Phaser/Menu/MenuScene.ts | 6 +-- 10 files changed, 49 insertions(+), 49 deletions(-) diff --git a/front/src/Components/App.svelte b/front/src/Components/App.svelte index cc40ea07..7db2a8fe 100644 --- a/front/src/Components/App.svelte +++ b/front/src/Components/App.svelte @@ -70,7 +70,7 @@ {#if $menuIconVisible}
- +
{/if} {#if $menuVisible} diff --git a/front/src/Components/ConsoleGlobalMessageManager/ConsoleGlobalMessageManager.svelte b/front/src/Components/ConsoleGlobalMessageManager/ConsoleGlobalMessageManager.svelte index 83837f28..9800817d 100644 --- a/front/src/Components/ConsoleGlobalMessageManager/ConsoleGlobalMessageManager.svelte +++ b/front/src/Components/ConsoleGlobalMessageManager/ConsoleGlobalMessageManager.svelte @@ -4,7 +4,6 @@ import {gameManager} from "../../Phaser/Game/GameManager"; import type {Game} from "../../Phaser/Game/Game"; - export let game: Game; let inputSendTextActive = true; let uploadMusicActive = false; @@ -33,10 +32,10 @@
{#if inputSendTextActive} - + {/if} {#if uploadMusicActive} - + {/if}
diff --git a/front/src/Components/ConsoleGlobalMessageManager/InputTextGlobalMessage.svelte b/front/src/Components/ConsoleGlobalMessageManager/InputTextGlobalMessage.svelte index c11b4b0e..188e0bd3 100644 --- a/front/src/Components/ConsoleGlobalMessageManager/InputTextGlobalMessage.svelte +++ b/front/src/Components/ConsoleGlobalMessageManager/InputTextGlobalMessage.svelte @@ -1,12 +1,10 @@ @@ -20,17 +27,17 @@
-

This room use this map :

+

This room use the following map :

{mapName}

{mapDescription}

diff --git a/front/src/Components/Menu/ContactSubMenu.svelte b/front/src/Components/Menu/ContactSubMenu.svelte index bf16e42d..223f0324 100644 --- a/front/src/Components/Menu/ContactSubMenu.svelte +++ b/front/src/Components/Menu/ContactSubMenu.svelte @@ -22,37 +22,37 @@ The WorkAdventure team has its own offices in ... WorkAdventure! Do not hesitate to come see and talk to us.

- Visit us + Visit us

Our Mail

Although we offer a solution to reduce their use, we have an email address that allows us to receive all your requests.

- hello@workadventu.re + hello@workadventu.re

Our web site

If you want to know more about us, follow the link to our web site.

- About us + About us

Our social media

- {'Discord'} + {'Discord'} - {'Facebook'} + {'Facebook'} - {'Instagram'} + {'Instagram'} - {'LinkedIn'} + {'LinkedIn'} - {'Twitter'} + {'Twitter'} - {'Youtube'} + {'Youtube'}
diff --git a/front/src/Components/Menu/CustomSubMenu.svelte b/front/src/Components/Menu/CustomSubMenu.svelte new file mode 100644 index 00000000..6e51c38d --- /dev/null +++ b/front/src/Components/Menu/CustomSubMenu.svelte @@ -0,0 +1,13 @@ + + +
+ +
\ No newline at end of file diff --git a/front/src/Components/Menu/Menu.svelte b/front/src/Components/Menu/Menu.svelte index 3ac1f781..572fa19e 100644 --- a/front/src/Components/Menu/Menu.svelte +++ b/front/src/Components/Menu/Menu.svelte @@ -1,32 +1,57 @@ + +
- open menu + open menu
- - diff --git a/front/dist/resources/html/gameMenuIcon.html b/front/dist/resources/html/gameMenuIcon.html deleted file mode 100644 index 22fe9867..00000000 --- a/front/dist/resources/html/gameMenuIcon.html +++ /dev/null @@ -1,28 +0,0 @@ - -
-
- -
-
\ No newline at end of file diff --git a/front/dist/resources/html/gameQualityMenu.html b/front/dist/resources/html/gameQualityMenu.html deleted file mode 100644 index babb3f0e..00000000 --- a/front/dist/resources/html/gameQualityMenu.html +++ /dev/null @@ -1,81 +0,0 @@ - - - diff --git a/front/dist/resources/html/gameReport.html b/front/dist/resources/html/gameReport.html deleted file mode 100644 index d35ae556..00000000 --- a/front/dist/resources/html/gameReport.html +++ /dev/null @@ -1,115 +0,0 @@ - - -
-
- -

Moderate

-

What action do you want to take?

-
-
-

Block:

-

Block any communication from and to this user. This can be reverted.

-
- -
-
-
-

Report:

-

Send a report message to the administrators of this room. They may later ban this user.

-
-
-
Your message:
- -

-
-
- -
-
-
-
- diff --git a/front/dist/resources/html/gameShare.html b/front/dist/resources/html/gameShare.html deleted file mode 100644 index 404c8680..00000000 --- a/front/dist/resources/html/gameShare.html +++ /dev/null @@ -1,96 +0,0 @@ - - - diff --git a/front/dist/webpack.config.d.ts b/front/dist/webpack.config.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/front/dist/webpack.config.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; From f7daf16ac5dc4a0f460c9717fb480ded6d909457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?gr=C3=A9goire=20parant?= Date: Wed, 11 Aug 2021 17:09:17 +0200 Subject: [PATCH 015/115] New version of cache management (#1365) Signed-off-by: Gregoire Parant --- front/dist/service-worker-prod.js | 2 +- front/src/Components/Video/VideoMediaBox.svelte | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/front/dist/service-worker-prod.js b/front/dist/service-worker-prod.js index 2f8d6a51..919b0b91 100644 --- a/front/dist/service-worker-prod.js +++ b/front/dist/service-worker-prod.js @@ -1,4 +1,4 @@ -let CACHE_NAME = 'workavdenture-cache-v1.2'; +let CACHE_NAME = 'workavdenture-cache-v1.4.14'; let urlsToCache = [ '/' ]; diff --git a/front/src/Components/Video/VideoMediaBox.svelte b/front/src/Components/Video/VideoMediaBox.svelte index 6b981dc8..924bb13a 100644 --- a/front/src/Components/Video/VideoMediaBox.svelte +++ b/front/src/Components/Video/VideoMediaBox.svelte @@ -22,7 +22,6 @@ let isMobile : boolean|null; const unsubscribe = obtainedMediaConstraintIsMobileStore.subscribe(value => { - console.log('unsubscribe => obtainedMediaConstraintIsMobileStore', value); isMobile = value; }); onDestroy(unsubscribe); From 3702173cd4b773ae9f988041a9e85e9dadcea24a Mon Sep 17 00:00:00 2001 From: Lurkars Date: Wed, 11 Aug 2021 20:01:51 +0200 Subject: [PATCH 016/115] migrate to svelte --- .../AudioManager/AudioManager.svelte | 127 ++++++++++++++---- 1 file changed, 98 insertions(+), 29 deletions(-) diff --git a/front/src/Components/AudioManager/AudioManager.svelte b/front/src/Components/AudioManager/AudioManager.svelte index a78b4bde..6d59b995 100644 --- a/front/src/Components/AudioManager/AudioManager.svelte +++ b/front/src/Components/AudioManager/AudioManager.svelte @@ -1,6 +1,4 @@
-
-

- The WorkAdventure team is always available to help you. - If you have any questions, problems, new features or improvements ideas, or if you just want to give us your feedback, - do not hesitate to contact us. -

-
-
-

Our Office

-

- The WorkAdventure team has its own offices in ... WorkAdventure! - Do not hesitate to come see and talk to us. -

- Visit us -
-
-

Our Mail

-

Although we offer a solution to reduce their use, we have an email address that allows us to receive all your requests.

- hello@workadventu.re -
-
-

Our web site

-

If you want to know more about us, follow the link to our web site.

- About us -
-
-

Our social media

- - {'Discord'} - - - {'Facebook'} - - - {'Instagram'} - - - {'LinkedIn'} - - - {'Twitter'} - - - {'Youtube'} - +
+
+

+ The WorkAdventure team is always available to help you. + If you have any questions, problems, new features or improvements ideas, or if you just want to give us your feedback, + do not hesitate to contact us. +

+
+
+

Our Office

+

+ The WorkAdventure team has its own offices in ... WorkAdventure! + Do not hesitate to come see and talk to us. +

+ Visit us +
+
+

Our Mail

+

Although we offer a solution to reduce their use, we have an email address that allows us to receive all your requests.

+ hello@workadventu.re +
+
+

Our web site

+

If you want to know more about us, follow the link to our web site.

+ About us +
+
+

Our social media

+ + {'Discord'} + + + {'Facebook'} + + + {'Instagram'} + + + {'LinkedIn'} + + + {'Twitter'} + + + {'Youtube'} + +
@@ -63,12 +65,17 @@ height: calc(100% - 56px); width: 100%; - display: grid; - grid-template-rows: 18% 21% 24% 21% 16%; + section.container-overflow { + height: 100%; + margin: 0; + padding: 0; + overflow: auto; + } section { text-align: center; padding: 4px 5px; + margin-bottom: 25px; p { margin: 0; diff --git a/front/src/Components/Menu/CreateMapSubMenu.svelte b/front/src/Components/Menu/CreateMapSubMenu.svelte index 65e2e346..33d677ae 100644 --- a/front/src/Components/Menu/CreateMapSubMenu.svelte +++ b/front/src/Components/Menu/CreateMapSubMenu.svelte @@ -22,20 +22,22 @@
-
-

Create your map

-

- WorkAdventure allows you to create an online space to communicate spontaneously with others. - And it all starts with creating your own space. Choose from a large selection of prefabricated maps by our team. - Or create your own map from scratch. -

- -
-
-

Use the scripting API

-

Make your map more interactive, more alive and totally unique with the scripting API.

-

(Programming skills are required to use the scripting API).

- +
+
+

Create your map

+

+ WorkAdventure allows you to create an online space to communicate spontaneously with others. + And it all starts with creating your own space. Choose from a large selection of prefabricated maps by our team. + Or create your own map from scratch. +

+ +
+
+

Use the scripting API

+

Make your map more interactive, more alive and totally unique with the scripting API.

+

(Programming skills are required to use the scripting API).

+ +
@@ -44,8 +46,17 @@ height: calc(100% - 56px); text-align: center; - display: grid; - grid-template-rows: 50% 50%; + + section { + margin-bottom: 50px; + } + + section.container-overflow { + height: 100%; + margin: 0; + padding: 0; + overflow: auto; + } } \ No newline at end of file diff --git a/front/src/Components/Menu/Menu.svelte b/front/src/Components/Menu/Menu.svelte index 572fa19e..5e7acd64 100644 --- a/front/src/Components/Menu/Menu.svelte +++ b/front/src/Components/Menu/Menu.svelte @@ -17,9 +17,10 @@ let activeComponent: typeof SettingsSubMenu | typeof CustomSubMenu = SettingsSubMenu; onMount(() => { - if(!get(userIsAdminStore)) { + //TODO: Uncomment before final push to merge + /*if(!get(userIsAdminStore)) { subMenusStore.removeMenu(SubMenusInterface.globalMessages); - } + }*/ switchMenu(SubMenusInterface.settings); }) @@ -90,11 +91,11 @@ } div.menu-container-main { - --size-first-columns-grid: 15%; + --size-first-columns-grid: clamp(120px, 15%, 200px); font-family: "Press Start 2P"; pointer-events: auto; - height: 70vh; + height: 80vh; width: 75vw; top: 10vh; @@ -125,4 +126,13 @@ color: whitesmoke; } } + + @media only screen and (max-height: 900px) { + div.menu-container-main { + top: 5vh; + height: 85vh; + width: 100vw; + font-size: 0.5em; + } + } \ No newline at end of file diff --git a/front/src/Components/Menu/MenuIcon.svelte b/front/src/Components/Menu/MenuIcon.svelte index ac409fde..3cdae289 100644 --- a/front/src/Components/Menu/MenuIcon.svelte +++ b/front/src/Components/Menu/MenuIcon.svelte @@ -28,9 +28,12 @@ padding-top: 0; } } - @media only screen and (max-height: 700px) { + @media only screen and (max-height: 900px) { .menuIcon { - margin: 100px; + margin: 3px; + img { + width: 50px; + } } } diff --git a/front/src/Components/Menu/ProfileSubMenu.svelte b/front/src/Components/Menu/ProfileSubMenu.svelte index 1f28bb8b..bb49d45e 100644 --- a/front/src/Components/Menu/ProfileSubMenu.svelte +++ b/front/src/Components/Menu/ProfileSubMenu.svelte @@ -57,7 +57,7 @@ \ No newline at end of file diff --git a/front/src/Components/Menu/SettingsSubMenu.svelte b/front/src/Components/Menu/SettingsSubMenu.svelte index 87974686..0d0dab83 100644 --- a/front/src/Components/Menu/SettingsSubMenu.svelte +++ b/front/src/Components/Menu/SettingsSubMenu.svelte @@ -2,6 +2,7 @@ import {localUserStore} from "../../Connexion/LocalUserStore"; import {videoConstraintStore} from "../../Stores/MediaStore"; import {HtmlUtils} from "../../WebRtc/HtmlUtils"; +import {isMobile} from "../../Enum/EnvironmentVariable"; let fullscreen : boolean = localUserStore.getFullscreen(); let notification : boolean = localUserStore.getNotification() === 'granted'; @@ -55,19 +56,19 @@ function changeNotification() {

Game quality

Video quality

@@ -93,7 +94,7 @@ function changeNotification() { grid-template-rows: 25% 25% 25% 20%; section { - width: 100%; //TODO clamp value + width: 100%; padding: 20px 20px 0; text-align: center; @@ -124,4 +125,18 @@ function changeNotification() { } } } + + @media only screen and (max-height: 900px) { + div.settings-main { + section { + padding: 0; + } + + section.settings-section-noSaveOption { + margin-top: 20px; + grid-template-columns: none; + grid-template-rows: calc(100% / var(--nb-noSaveOptions)) calc(100% / var(--nb-noSaveOptions)); //Same size for every sub-element; + } + } + } \ No newline at end of file From 9e5cc3b9a74ecb14a0a15fde5c63a8984387bd3e Mon Sep 17 00:00:00 2001 From: GRL Date: Tue, 17 Aug 2021 14:44:43 +0200 Subject: [PATCH 028/115] First pass on css --- front/src/Components/Menu/Menu.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/Components/Menu/Menu.svelte b/front/src/Components/Menu/Menu.svelte index 5e7acd64..b75dad89 100644 --- a/front/src/Components/Menu/Menu.svelte +++ b/front/src/Components/Menu/Menu.svelte @@ -8,7 +8,7 @@ import ContactSubMenu from "./ContactSubMenu.svelte"; import CustomSubMenu from "./CustomSubMenu.svelte"; import {menuVisiblilityStore, SubMenusInterface, subMenusStore} from "../../Stores/MenuStore"; - import {userIsAdminStore} from "../../Stores/GameStore"; + //import {userIsAdminStore} from "../../Stores/GameStore"; import {onMount} from "svelte"; import {get} from "svelte/store"; From 4c3097155b8fbf6b12f3bc47da5a514f919b5f29 Mon Sep 17 00:00:00 2001 From: GRL Date: Wed, 18 Aug 2021 11:15:46 +0200 Subject: [PATCH 029/115] Second pass on css and reportMenu --- .../Components/Menu/AboutRoomSubMenu.svelte | 30 ++++++++++++-- .../Components/Menu/CreateMapSubMenu.svelte | 23 ++++------- .../src/Components/Menu/CustomSubMenu.svelte | 13 ------ .../Menu/GlobalMessagesSubMenu.svelte | 15 ++++++- front/src/Components/Menu/Menu.svelte | 16 ++++---- .../src/Components/Menu/ProfileSubMenu.svelte | 13 +++--- .../Components/Menu/SettingsSubMenu.svelte | 17 ++++---- .../Components/Menu/TextGlobalMessage.svelte | 3 +- .../Components/ReportMenu/ReportMenu.svelte | 40 ++++++++++++++----- .../ReportMenu/ReportSubMenu.svelte | 9 +++-- .../style/TextGlobalMessageSvelte-Style.scss | 10 +++++ 11 files changed, 116 insertions(+), 73 deletions(-) delete mode 100644 front/src/Components/Menu/CustomSubMenu.svelte diff --git a/front/src/Components/Menu/AboutRoomSubMenu.svelte b/front/src/Components/Menu/AboutRoomSubMenu.svelte index 7749abd7..9637e9ce 100644 --- a/front/src/Components/Menu/AboutRoomSubMenu.svelte +++ b/front/src/Components/Menu/AboutRoomSubMenu.svelte @@ -43,15 +43,29 @@ HTMLShareLink.select(); document.execCommand('copy'); } + + async function shareLink() { + const shareData = {url: location.toString()}; + + try { + await navigator.share(shareData); + } catch (err) { + console.error('Error: ' + err); + } + }
-
@@ -97,7 +96,7 @@ pointer-events: auto; height: 80vh; width: 75vw; - top: 10vh; + top: clamp(55px, 10vh, 10vh); position: relative; margin: auto; @@ -129,8 +128,7 @@ @media only screen and (max-height: 900px) { div.menu-container-main { - top: 5vh; - height: 85vh; + bottom: 55px; width: 100vw; font-size: 0.5em; } diff --git a/front/src/Components/Menu/ProfileSubMenu.svelte b/front/src/Components/Menu/ProfileSubMenu.svelte index bb49d45e..e2a3a05a 100644 --- a/front/src/Components/Menu/ProfileSubMenu.svelte +++ b/front/src/Components/Menu/ProfileSubMenu.svelte @@ -33,9 +33,10 @@ gameManager.leaveGame(SelectCharacterSceneName,new SelectCharacterScene()); } - function clickLogin() { + //TODO: Uncomment when login will be completely developed + /*function clickLogin() { connectionManager.loadOpenIDScreen(); - } + }*/ @@ -49,20 +50,18 @@
-
+ \ No newline at end of file diff --git a/front/src/Components/ReportMenu/ReportSubMenu.svelte b/front/src/Components/ReportMenu/ReportSubMenu.svelte index e9b63ea4..40a2cb1a 100644 --- a/front/src/Components/ReportMenu/ReportSubMenu.svelte +++ b/front/src/Components/ReportMenu/ReportSubMenu.svelte @@ -1,7 +1,8 @@ @@ -38,7 +39,7 @@ text-align: center; textarea { - height: 200px; + height: clamp(100px, 20vh, 20vh); } } \ No newline at end of file diff --git a/front/style/TextGlobalMessageSvelte-Style.scss b/front/style/TextGlobalMessageSvelte-Style.scss index d09c94ad..dce20378 100644 --- a/front/style/TextGlobalMessageSvelte-Style.scss +++ b/front/style/TextGlobalMessageSvelte-Style.scss @@ -29,3 +29,13 @@ section.section-input-send-text { } } } + +@media only screen and (max-height: 900px) { + section.section-input-send-text { + --height-toolbar: 30%; + + .ql-toolbar { + overflow: auto; + } + } +} From ac825bf7255667e8aa37c7c4b18fcc60ca25eaff Mon Sep 17 00:00:00 2001 From: GRL Date: Wed, 18 Aug 2021 11:15:46 +0200 Subject: [PATCH 030/115] Second pass on css and reportMenu --- front/src/Components/Menu/ProfileSubMenu.svelte | 2 +- front/src/Components/ReportMenu/ReportSubMenu.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/front/src/Components/Menu/ProfileSubMenu.svelte b/front/src/Components/Menu/ProfileSubMenu.svelte index e2a3a05a..c4b0c16c 100644 --- a/front/src/Components/Menu/ProfileSubMenu.svelte +++ b/front/src/Components/Menu/ProfileSubMenu.svelte @@ -7,7 +7,7 @@ import {loginSceneVisibleStore} from "../../Stores/LoginSceneStore"; import {selectCharacterSceneVisibleStore} from "../../Stores/SelectCharacterStore"; import {SelectCharacterScene, SelectCharacterSceneName} from "../../Phaser/Login/SelectCharacterScene"; - import {connectionManager} from "../../Connexion/ConnectionManager"; + //import {connectionManager} from "../../Connexion/ConnectionManager"; function disableMenuStores(){ diff --git a/front/src/Components/ReportMenu/ReportSubMenu.svelte b/front/src/Components/ReportMenu/ReportSubMenu.svelte index 40a2cb1a..47b47d2a 100644 --- a/front/src/Components/ReportMenu/ReportSubMenu.svelte +++ b/front/src/Components/ReportMenu/ReportSubMenu.svelte @@ -2,7 +2,7 @@ import {showReportScreenStore} from "../../Stores/ShowReportScreenStore"; import {gameManager} from "../../Phaser/Game/GameManager"; - export let userUUID: string; + export let userUUID: string | undefined; let reportMessage: string; let hiddenError = true; From 5a8e7d277f5a78eba5b6e25f738abac1620bd957 Mon Sep 17 00:00:00 2001 From: GRL Date: Wed, 18 Aug 2021 11:15:46 +0200 Subject: [PATCH 031/115] Second pass on css and reportMenu --- front/src/Components/Menu/ProfileSubMenu.svelte | 2 +- front/src/Components/ReportMenu/ReportSubMenu.svelte | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/front/src/Components/Menu/ProfileSubMenu.svelte b/front/src/Components/Menu/ProfileSubMenu.svelte index e2a3a05a..c4b0c16c 100644 --- a/front/src/Components/Menu/ProfileSubMenu.svelte +++ b/front/src/Components/Menu/ProfileSubMenu.svelte @@ -7,7 +7,7 @@ import {loginSceneVisibleStore} from "../../Stores/LoginSceneStore"; import {selectCharacterSceneVisibleStore} from "../../Stores/SelectCharacterStore"; import {SelectCharacterScene, SelectCharacterSceneName} from "../../Phaser/Login/SelectCharacterScene"; - import {connectionManager} from "../../Connexion/ConnectionManager"; + //import {connectionManager} from "../../Connexion/ConnectionManager"; function disableMenuStores(){ diff --git a/front/src/Components/ReportMenu/ReportSubMenu.svelte b/front/src/Components/ReportMenu/ReportSubMenu.svelte index 40a2cb1a..36bf878b 100644 --- a/front/src/Components/ReportMenu/ReportSubMenu.svelte +++ b/front/src/Components/ReportMenu/ReportSubMenu.svelte @@ -2,7 +2,7 @@ import {showReportScreenStore} from "../../Stores/ShowReportScreenStore"; import {gameManager} from "../../Phaser/Game/GameManager"; - export let userUUID: string; + export let userUUID: string | undefined; let reportMessage: string; let hiddenError = true; @@ -11,6 +11,9 @@ hiddenError = true; } else { hiddenError = false; + if( userUUID === undefined) { + throw ('User UUID is not valid.'); + } gameManager.getCurrentGameScene().connection?.emitReportPlayerMessage(userUUID, reportMessage); showReportScreenStore.set(null) } From 8a6449195240d311979679aac64c8aef6cbee861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Wed, 18 Aug 2021 11:53:41 +0200 Subject: [PATCH 032/115] Improving popup If a popup message is empty, only the buttons will be displayed (not the container) Unrelated: the Sound.play method in the API now accepts 0 arguments. --- front/src/Api/iframe/Sound/Sound.ts | 33 +++++++++++++---------------- front/src/Phaser/Game/GameScene.ts | 10 ++++++++- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/front/src/Api/iframe/Sound/Sound.ts b/front/src/Api/iframe/Sound/Sound.ts index 3bb3251a..132176c2 100644 --- a/front/src/Api/iframe/Sound/Sound.ts +++ b/front/src/Api/iframe/Sound/Sound.ts @@ -1,38 +1,35 @@ -import {sendToWorkadventure} from "../IframeApiContribution"; -import type {LoadSoundEvent} from "../../Events/LoadSoundEvent"; -import type {PlaySoundEvent} from "../../Events/PlaySoundEvent"; -import type {StopSoundEvent} from "../../Events/StopSoundEvent"; +import { sendToWorkadventure } from "../IframeApiContribution"; +import type { LoadSoundEvent } from "../../Events/LoadSoundEvent"; +import type { PlaySoundEvent } from "../../Events/PlaySoundEvent"; +import type { StopSoundEvent } from "../../Events/StopSoundEvent"; import SoundConfig = Phaser.Types.Sound.SoundConfig; export class Sound { constructor(private url: string) { sendToWorkadventure({ - "type": 'loadSound', - "data": { + type: "loadSound", + data: { url: this.url, - } as LoadSoundEvent - + } as LoadSoundEvent, }); } - public play(config: SoundConfig) { + public play(config: SoundConfig | undefined) { sendToWorkadventure({ - "type": 'playSound', - "data": { + type: "playSound", + data: { url: this.url, - config - } as PlaySoundEvent - + config, + } as PlaySoundEvent, }); return this.url; } public stop() { sendToWorkadventure({ - "type": 'stopSound', - "data": { + type: "stopSound", + data: { url: this.url, - } as StopSoundEvent - + } as StopSoundEvent, }); return this.url; } diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index d396c58b..9a5d8f27 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -953,9 +953,13 @@ export class GameScene extends DirtyScene { return; } const escapedMessage = HtmlUtils.escapeHtml(openPopupEvent.message); - let html = `
{:else}
- Sing in + Sign in
{/if}
- +
- \ No newline at end of file diff --git a/front/src/Stores/MenuStore.ts b/front/src/Stores/MenuStore.ts index 035ba174..96e731a9 100644 --- a/front/src/Stores/MenuStore.ts +++ b/front/src/Stores/MenuStore.ts @@ -71,7 +71,7 @@ function createSubMenusStore() { export const subMenusStore = createSubMenusStore(); -function checkSubMenuToShow() { +export function checkSubMenuToShow() { if (!get(userIsAdminStore)) { subMenusStore.removeMenu(SubMenusInterface.globalMessages); } @@ -81,8 +81,6 @@ function checkSubMenuToShow() { } } -checkSubMenuToShow(); - export const customMenuIframe = new Map(); export function handleMenuRegistrationEvent( diff --git a/front/style/TextGlobalMessageSvelte-Style.scss b/front/style/TextGlobalMessageSvelte-Style.scss index ce67b699..dda65d05 100644 --- a/front/style/TextGlobalMessageSvelte-Style.scss +++ b/front/style/TextGlobalMessageSvelte-Style.scss @@ -1,10 +1,10 @@ //TextGlobalMessage section.section-input-send-text { - --height-toolbar: 15%; + --height-toolbar: 20%; height: 100%; .ql-toolbar{ - height: var(--height-toolbar); + max-height: var(--height-toolbar); background: whitesmoke; } From 36df585a5e84d5074190adcb2a46ac627747063b Mon Sep 17 00:00:00 2001 From: Lurkars Date: Thu, 9 Sep 2021 08:47:38 +0200 Subject: [PATCH 091/115] fix wrong layer names after re-enter room --- front/src/Phaser/Map/LayersFlattener.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/Phaser/Map/LayersFlattener.ts b/front/src/Phaser/Map/LayersFlattener.ts index d28402b5..fabce94b 100644 --- a/front/src/Phaser/Map/LayersFlattener.ts +++ b/front/src/Phaser/Map/LayersFlattener.ts @@ -10,7 +10,7 @@ export function flattenGroupLayersMap(map: ITiledMap) { } function flattenGroupLayers(layers: ITiledMapLayer[], prefix: string, flatLayers: ITiledMapLayer[]) { - for (const layer of layers) { + for (const layer of layers.map((layer) => ({ ...layer }))) { if (layer.type === "group") { flattenGroupLayers(layer.layers, prefix + layer.name + "/", flatLayers); } else { From 30b22d87a6e855f6def3e0491ea577d621bf64a5 Mon Sep 17 00:00:00 2001 From: Lurkars Date: Thu, 9 Sep 2021 08:50:57 +0200 Subject: [PATCH 092/115] .gitignore to upstream --- .env.dev.localhost.single | 24 ++++ .gitignore | 4 +- docker-compose.dev.localhost.single.yaml | 146 +++++++++++++++++++++++ 3 files changed, 171 insertions(+), 3 deletions(-) create mode 100644 .env.dev.localhost.single create mode 100755 docker-compose.dev.localhost.single.yaml diff --git a/.env.dev.localhost.single b/.env.dev.localhost.single new file mode 100644 index 00000000..a75de386 --- /dev/null +++ b/.env.dev.localhost.single @@ -0,0 +1,24 @@ +DEBUG_MODE=false +JITSI_URL=meet.jit.si +JITSI_PRIVATE_MODE=false +JITSI_ISS= +SECRET_JITSI_KEY= +ADMIN_API_TOKEN=123 +START_ROOM_URL=/_/global/workadventure.localhost/maps/Floor0/floor0.json + +STUN_SERVER=stun:stun.l.google.com:19302 +TURN_SERVER=turn:coturn.workadventu.re:443,turns:coturn.workadventu.re:443 +TURN_STATIC_AUTH_SECRET= + +DISABLE_NOTIFICATIONS=true +SKIP_RENDER_OPTIMIZATIONS=false + +ACME_EMAIL= + +MAX_PER_GROUP=4 +MAX_USERNAME_LENGTH=8 + +FRONT_URL= +OPID_CLIENT_ID= +OPID_CLIENT_SECRET= +OPID_CLIENT_ISSUER= diff --git a/.gitignore b/.gitignore index 3e56b379..2acc9cf7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,11 +3,9 @@ .vagrant Vagrantfile docker-compose.override.yaml -docker-compose.dev.* -.env.dev.* *.DS_Store maps/yarn.lock maps/dist/computer.js maps/dist/computer.js.map node_modules -_ \ No newline at end of file +_ diff --git a/docker-compose.dev.localhost.single.yaml b/docker-compose.dev.localhost.single.yaml new file mode 100755 index 00000000..a12dbc34 --- /dev/null +++ b/docker-compose.dev.localhost.single.yaml @@ -0,0 +1,146 @@ +version: "3.3" +services: + reverse-proxy: + image: traefik:v2.5 + command: + - --api.insecure=true + - --providers.docker + - --entryPoints.web.address=:80 + - --entryPoints.websecure.address=:443 + ports: + - "80:80" + - "443:443" + depends_on: + - back + - front + volumes: + - /var/run/docker.sock:/var/run/docker.sock + + front: + image: thecodingmachine/nodejs:14 + environment: + DEBUG_MODE: "$DEBUG_MODE" + JITSI_URL: $JITSI_URL + JITSI_PRIVATE_MODE: "$JITSI_PRIVATE_MODE" + PUSHER_URL: /pusher + STARTUP_COMMAND_1: ./templater.sh + STARTUP_COMMAND_2: yarn install --ignore-engines + TURN_SERVER: "${TURN_SERVER}" + TURN_USER: "${TURN_USER}" + STUN_SERVER: "${STUN_SERVER}" + TURN_PASSWORD: "${TURN_PASSWORD}" + MAX_PER_GROUP: "${MAX_PER_GROUP}" + MAX_USERNAME_LENGTH: "${MAX_USERNAME_LENGTH}" + START_ROOM_URL: "${START_ROOM_URL}" + DISABLE_NOTIFICATIONS: "${DISABLE_NOTIFICATIONS}" + SKIP_RENDER_OPTIMIZATIONS: "${SKIP_RENDER_OPTIMIZATIONS}" + command: yarn run start + volumes: + - ./front:/usr/src/app + labels: + - "traefik.http.routers.front.rule=PathPrefix(`/`)" + - "traefik.http.routers.front.entryPoints=web" + - "traefik.http.routers.front.service=front" + - "traefik.http.services.front.loadbalancer.server.port=8080" + - "traefik.http.routers.front-ssl.rule=PathPrefix(`/`)" + - "traefik.http.routers.front-ssl.entryPoints=websecure" + - "traefik.http.routers.front-ssl.tls=true" + - "traefik.http.routers.front-ssl.service=front" + + pusher: + image: thecodingmachine/nodejs:12 + command: yarn dev + environment: + #DEBUG: "*" + STARTUP_COMMAND_1: yarn install + SECRET_JITSI_KEY: "${SECRET_JITSI_KEY}" + SECRET_KEY: "${SECRET_KEY}" + API_URL: back:50051 + ADMIN_API_URL: "${ADMIN_API_URL}" + ADMIN_API_TOKEN: "${ADMIN_API_TOKEN}" + JITSI_URL: ${JITSI_URL} + JITSI_ISS: ${JITSI_ISS} + FRONT_URL : ${FRONT_URL} + OPID_CLIENT_ID: ${OPID_CLIENT_ID} + OPID_CLIENT_SECRET: ${OPID_CLIENT_SECRET} + OPID_CLIENT_ISSUER: ${OPID_CLIENT_ISSUER} + volumes: + - ./pusher:/usr/src/app + labels: + - "traefik.http.middlewares.strip-pusher-prefix.stripprefix.prefixes=/pusher" + - "traefik.http.routers.pusher.middlewares=strip-pusher-prefix@docker" + - "traefik.http.routers.pusher.rule=PathPrefix(`/pusher`)" + - "traefik.http.routers.pusher.entryPoints=web" + - "traefik.http.routers.pusher.service=pusher" + - "traefik.http.services.pusher.loadbalancer.server.port=8080" + - "traefik.http.routers.pusher-ssl.rule=PathPrefix(`/pusher`)" + - "traefik.http.routers.pusher-ssl.middlewares=strip-pusher-prefix@docker" + - "traefik.http.routers.pusher-ssl.entryPoints=websecure" + - "traefik.http.routers.pusher-ssl.tls=true" + - "traefik.http.routers.pusher-ssl.service=pusher" + + maps: + image: thecodingmachine/nodejs:12-apache + environment: + DEBUG_MODE: "$DEBUG_MODE" + HOST: "0.0.0.0" + NODE_ENV: development + STARTUP_COMMAND_0: sudo a2enmod headers + STARTUP_COMMAND_1: yarn install + STARTUP_COMMAND_2: yarn run dev & + volumes: + - ./maps:/var/www/html + labels: + - "traefik.http.middlewares.strip-maps-prefix.stripprefix.prefixes=/maps" + - "traefik.http.routers.maps.rule=PathPrefix(`/maps`)" + - "traefik.http.routers.maps.middlewares=strip-maps-prefix@docker" + - "traefik.http.routers.maps.entryPoints=web,traefik" + - "traefik.http.services.maps.loadbalancer.server.port=80" + - "traefik.http.routers.maps-ssl.rule=PathPrefix(`/maps`)" + - "traefik.http.routers.maps-ssl.middlewares=strip-maps-prefix@docker" + - "traefik.http.routers.maps-ssl.entryPoints=websecure" + - "traefik.http.routers.maps-ssl.tls=true" + - "traefik.http.routers.maps-ssl.service=maps" + + back: + image: thecodingmachine/nodejs:12 + command: yarn dev + environment: + #DEBUG: "*" + STARTUP_COMMAND_1: yarn install + SECRET_JITSI_KEY: "${SECRET_JITSI_KEY}" + ADMIN_API_TOKEN: "${ADMIN_API_TOKEN}" + ADMIN_API_URL: "${ADMIN_API_URL}" + JITSI_URL: ${JITSI_URL} + JITSI_ISS: ${JITSI_ISS} + MAX_PER_GROUP: ${MAX_PER_GROUP} + REDIS_HOST: redis + NODE_ENV: development + volumes: + - ./back:/usr/src/app + labels: + - "traefik.http.middlewares.strip-api-prefix.stripprefix.prefixes=/api" + - "traefik.http.routers.back.middlewares=strip-api-prefix@docker" + - "traefik.http.routers.back.rule=PathPrefix(`/api`)" + - "traefik.http.routers.back.entryPoints=web" + - "traefik.http.routers.back.service=back" + - "traefik.http.services.back.loadbalancer.server.port=8080" + - "traefik.http.routers.back-ssl.rule=PathPrefix(`/api`)" + - "traefik.http.routers.back-ssl.middlewares=strip-api-prefix@docker" + - "traefik.http.routers.back-ssl.entryPoints=websecure" + - "traefik.http.routers.back-ssl.tls=true" + - "traefik.http.routers.back-ssl.service=back" + + messages: + image: thecodingmachine/workadventure-back-base:latest + environment: + STARTUP_COMMAND_1: yarn install + STARTUP_COMMAND_2: yarn run proto:watch + volumes: + - ./messages:/usr/src/app + - ./back:/usr/src/back + - ./front:/usr/src/front + - ./pusher:/usr/src/pusher + + redis: + image: redis:6 From 8dd404801a182b0131f715fa0885acbc323dc1ce Mon Sep 17 00:00:00 2001 From: Lurkars Date: Thu, 9 Sep 2021 08:51:20 +0200 Subject: [PATCH 093/115] .gitignore to upstream --- .env.dev.localhost.single | 24 ---- docker-compose.dev.localhost.single.yaml | 146 ----------------------- 2 files changed, 170 deletions(-) delete mode 100644 .env.dev.localhost.single delete mode 100755 docker-compose.dev.localhost.single.yaml diff --git a/.env.dev.localhost.single b/.env.dev.localhost.single deleted file mode 100644 index a75de386..00000000 --- a/.env.dev.localhost.single +++ /dev/null @@ -1,24 +0,0 @@ -DEBUG_MODE=false -JITSI_URL=meet.jit.si -JITSI_PRIVATE_MODE=false -JITSI_ISS= -SECRET_JITSI_KEY= -ADMIN_API_TOKEN=123 -START_ROOM_URL=/_/global/workadventure.localhost/maps/Floor0/floor0.json - -STUN_SERVER=stun:stun.l.google.com:19302 -TURN_SERVER=turn:coturn.workadventu.re:443,turns:coturn.workadventu.re:443 -TURN_STATIC_AUTH_SECRET= - -DISABLE_NOTIFICATIONS=true -SKIP_RENDER_OPTIMIZATIONS=false - -ACME_EMAIL= - -MAX_PER_GROUP=4 -MAX_USERNAME_LENGTH=8 - -FRONT_URL= -OPID_CLIENT_ID= -OPID_CLIENT_SECRET= -OPID_CLIENT_ISSUER= diff --git a/docker-compose.dev.localhost.single.yaml b/docker-compose.dev.localhost.single.yaml deleted file mode 100755 index a12dbc34..00000000 --- a/docker-compose.dev.localhost.single.yaml +++ /dev/null @@ -1,146 +0,0 @@ -version: "3.3" -services: - reverse-proxy: - image: traefik:v2.5 - command: - - --api.insecure=true - - --providers.docker - - --entryPoints.web.address=:80 - - --entryPoints.websecure.address=:443 - ports: - - "80:80" - - "443:443" - depends_on: - - back - - front - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - front: - image: thecodingmachine/nodejs:14 - environment: - DEBUG_MODE: "$DEBUG_MODE" - JITSI_URL: $JITSI_URL - JITSI_PRIVATE_MODE: "$JITSI_PRIVATE_MODE" - PUSHER_URL: /pusher - STARTUP_COMMAND_1: ./templater.sh - STARTUP_COMMAND_2: yarn install --ignore-engines - TURN_SERVER: "${TURN_SERVER}" - TURN_USER: "${TURN_USER}" - STUN_SERVER: "${STUN_SERVER}" - TURN_PASSWORD: "${TURN_PASSWORD}" - MAX_PER_GROUP: "${MAX_PER_GROUP}" - MAX_USERNAME_LENGTH: "${MAX_USERNAME_LENGTH}" - START_ROOM_URL: "${START_ROOM_URL}" - DISABLE_NOTIFICATIONS: "${DISABLE_NOTIFICATIONS}" - SKIP_RENDER_OPTIMIZATIONS: "${SKIP_RENDER_OPTIMIZATIONS}" - command: yarn run start - volumes: - - ./front:/usr/src/app - labels: - - "traefik.http.routers.front.rule=PathPrefix(`/`)" - - "traefik.http.routers.front.entryPoints=web" - - "traefik.http.routers.front.service=front" - - "traefik.http.services.front.loadbalancer.server.port=8080" - - "traefik.http.routers.front-ssl.rule=PathPrefix(`/`)" - - "traefik.http.routers.front-ssl.entryPoints=websecure" - - "traefik.http.routers.front-ssl.tls=true" - - "traefik.http.routers.front-ssl.service=front" - - pusher: - image: thecodingmachine/nodejs:12 - command: yarn dev - environment: - #DEBUG: "*" - STARTUP_COMMAND_1: yarn install - SECRET_JITSI_KEY: "${SECRET_JITSI_KEY}" - SECRET_KEY: "${SECRET_KEY}" - API_URL: back:50051 - ADMIN_API_URL: "${ADMIN_API_URL}" - ADMIN_API_TOKEN: "${ADMIN_API_TOKEN}" - JITSI_URL: ${JITSI_URL} - JITSI_ISS: ${JITSI_ISS} - FRONT_URL : ${FRONT_URL} - OPID_CLIENT_ID: ${OPID_CLIENT_ID} - OPID_CLIENT_SECRET: ${OPID_CLIENT_SECRET} - OPID_CLIENT_ISSUER: ${OPID_CLIENT_ISSUER} - volumes: - - ./pusher:/usr/src/app - labels: - - "traefik.http.middlewares.strip-pusher-prefix.stripprefix.prefixes=/pusher" - - "traefik.http.routers.pusher.middlewares=strip-pusher-prefix@docker" - - "traefik.http.routers.pusher.rule=PathPrefix(`/pusher`)" - - "traefik.http.routers.pusher.entryPoints=web" - - "traefik.http.routers.pusher.service=pusher" - - "traefik.http.services.pusher.loadbalancer.server.port=8080" - - "traefik.http.routers.pusher-ssl.rule=PathPrefix(`/pusher`)" - - "traefik.http.routers.pusher-ssl.middlewares=strip-pusher-prefix@docker" - - "traefik.http.routers.pusher-ssl.entryPoints=websecure" - - "traefik.http.routers.pusher-ssl.tls=true" - - "traefik.http.routers.pusher-ssl.service=pusher" - - maps: - image: thecodingmachine/nodejs:12-apache - environment: - DEBUG_MODE: "$DEBUG_MODE" - HOST: "0.0.0.0" - NODE_ENV: development - STARTUP_COMMAND_0: sudo a2enmod headers - STARTUP_COMMAND_1: yarn install - STARTUP_COMMAND_2: yarn run dev & - volumes: - - ./maps:/var/www/html - labels: - - "traefik.http.middlewares.strip-maps-prefix.stripprefix.prefixes=/maps" - - "traefik.http.routers.maps.rule=PathPrefix(`/maps`)" - - "traefik.http.routers.maps.middlewares=strip-maps-prefix@docker" - - "traefik.http.routers.maps.entryPoints=web,traefik" - - "traefik.http.services.maps.loadbalancer.server.port=80" - - "traefik.http.routers.maps-ssl.rule=PathPrefix(`/maps`)" - - "traefik.http.routers.maps-ssl.middlewares=strip-maps-prefix@docker" - - "traefik.http.routers.maps-ssl.entryPoints=websecure" - - "traefik.http.routers.maps-ssl.tls=true" - - "traefik.http.routers.maps-ssl.service=maps" - - back: - image: thecodingmachine/nodejs:12 - command: yarn dev - environment: - #DEBUG: "*" - STARTUP_COMMAND_1: yarn install - SECRET_JITSI_KEY: "${SECRET_JITSI_KEY}" - ADMIN_API_TOKEN: "${ADMIN_API_TOKEN}" - ADMIN_API_URL: "${ADMIN_API_URL}" - JITSI_URL: ${JITSI_URL} - JITSI_ISS: ${JITSI_ISS} - MAX_PER_GROUP: ${MAX_PER_GROUP} - REDIS_HOST: redis - NODE_ENV: development - volumes: - - ./back:/usr/src/app - labels: - - "traefik.http.middlewares.strip-api-prefix.stripprefix.prefixes=/api" - - "traefik.http.routers.back.middlewares=strip-api-prefix@docker" - - "traefik.http.routers.back.rule=PathPrefix(`/api`)" - - "traefik.http.routers.back.entryPoints=web" - - "traefik.http.routers.back.service=back" - - "traefik.http.services.back.loadbalancer.server.port=8080" - - "traefik.http.routers.back-ssl.rule=PathPrefix(`/api`)" - - "traefik.http.routers.back-ssl.middlewares=strip-api-prefix@docker" - - "traefik.http.routers.back-ssl.entryPoints=websecure" - - "traefik.http.routers.back-ssl.tls=true" - - "traefik.http.routers.back-ssl.service=back" - - messages: - image: thecodingmachine/workadventure-back-base:latest - environment: - STARTUP_COMMAND_1: yarn install - STARTUP_COMMAND_2: yarn run proto:watch - volumes: - - ./messages:/usr/src/app - - ./back:/usr/src/back - - ./front:/usr/src/front - - ./pusher:/usr/src/pusher - - redis: - image: redis:6 From 05307355474586ff777a564c8db77fbdde3e9af8 Mon Sep 17 00:00:00 2001 From: Lurkars Date: Thu, 9 Sep 2021 08:52:24 +0200 Subject: [PATCH 094/115] .gitignore to upstream --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2acc9cf7..8fa69985 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,4 @@ maps/yarn.lock maps/dist/computer.js maps/dist/computer.js.map node_modules -_ +_ \ No newline at end of file From 24cd17ac51d0579a4d644a298d5f3428cf951ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Thu, 9 Sep 2021 10:41:17 +0200 Subject: [PATCH 095/115] Adding a new test case to check video display on mobile --- maps/tests/index.html | 8 ++++ maps/tests/mobile_video.json | 82 ++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 maps/tests/mobile_video.json diff --git a/maps/tests/index.html b/maps/tests/index.html index 332875b9..6ea6cf80 100644 --- a/maps/tests/index.html +++ b/maps/tests/index.html @@ -90,6 +90,14 @@ Testing movement on mobile + + + Success Failure Pending + + + Testing video on mobile + + Success Failure Pending diff --git a/maps/tests/mobile_video.json b/maps/tests/mobile_video.json new file mode 100644 index 00000000..e7eb4e09 --- /dev/null +++ b/maps/tests/mobile_video.json @@ -0,0 +1,82 @@ +{ "compressionlevel":-1, + "height":10, + "infinite":false, + "layers":[ + { + "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "height":10, + "id":1, + "name":"floor", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":10, + "x":0, + "y":0 + }, + { + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":10, + "id":2, + "name":"start", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":10, + "x":0, + "y":0 + }, + { + "draworder":"topdown", + "id":3, + "name":"floorLayer", + "objects":[ + { + "height":281.232647439376, + "id":3, + "name":"", + "rotation":0, + "text": + { + "fontfamily":"Sans Serif", + "pixelsize":11, + "text":"Test:\nOpen the page on a mobile device AND on a desktop\nCreate a bubble\n\nResult:\nVideo is displayed correcly on both mobile and desktop. It is correctly centered too.\n\nTest:\nTurn the phone in landscape or portrait mode\n\nResult:\nOn the computer, the displayed video adapts automatically", + "wrap":true + }, + "type":"", + "visible":true, + "width":252.4375, + "x":46.5894222943362, + "y":34.2876372135732 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }], + "nextlayerid":8, + "nextobjectid":5, + "orientation":"orthogonal", + "renderorder":"right-down", + "tiledversion":"2021.03.23", + "tileheight":32, + "tilesets":[ + { + "columns":11, + "firstgid":1, + "image":"tileset1.png", + "imageheight":352, + "imagewidth":352, + "margin":0, + "name":"tileset1", + "spacing":0, + "tilecount":121, + "tileheight":32, + "tilewidth":32 + }], + "tilewidth":32, + "type":"map", + "version":1.5, + "width":10 +} \ No newline at end of file From e715ca42c4481a07e6dca0d4a8d8bb9ede96f9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Thu, 9 Sep 2021 11:35:17 +0200 Subject: [PATCH 096/115] Improving design of the test page --- maps/tests/index.html | 492 ++++++++++++++++++++++-------------------- 1 file changed, 258 insertions(+), 234 deletions(-) diff --git a/maps/tests/index.html b/maps/tests/index.html index 6ea6cf80..17f646bc 100644 --- a/maps/tests/index.html +++ b/maps/tests/index.html @@ -1,241 +1,266 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ResultTest
- Success Failure Pending - - Testing Jitsi special config parameters -
- Success Failure Pending - - Testing jitsiUrl property -
- Success Failure Pending - - Testing scripting API with an iFrame -
- Success Failure Pending - - Testing scripting API with a script -
- Success Failure Pending - - Testing goToPage script Api -
- Success Failure Pending - - Testing scripting API loadSound() function -
- Success Failure Pending - - Testing scripting API deprecated function -
- Success Failure Pending - - Testing auto-zoom of viewport -
- Success Failure Pending - - Testing zoom via mouse wheel -
- Success Failure Pending - - Testing movement on mobile -
- Success Failure Pending - - Testing video on mobile -
- Success Failure Pending - - Test energy consumption -
- Success Failure Pending - - Test the HelpCameraSettingScene -
- Success Failure Pending - - Test a iframe opened by a script can use Iframe API -
- Success Failure Pending - - Testing add a custom menu by scripting API -
- Success Failure Pending - - Testing return current player attributes in Scripting API + WA.onInit -
- Success Failure Pending - - Test listening player movement by Scripting API -
- Success Failure Pending - - Testing set a property on a layer by Scripting API -
- Success Failure Pending - - Testing show or hide a layer by Scripting API -
- Success Failure Pending - - Test animated tiles -
- Success Failure Pending - - Test start tile (S1) -
- Success Failure Pending - - Test start tile (S2) -
- Success Failure Pending - - Test set tiles -
- Success Failure Pending - - Testing scripting variables locally -
- Success Failure Pending - - Testing shared scripting variables -
- Success Failure Pending - - Testing trigger message API -
- Success Failure Pending - - Testing websites inside a map -
- Success Failure Pending - - Testing scripting API for websites inside a map -
- +
+

WorkAdventure test cases

+ + +

Map features / properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ResultTest
+ Success Failure Pending + + Testing Jitsi special config parameters +
+ Success Failure Pending + + Testing jitsiUrl property +
+ Success Failure Pending + + Test animated tiles +
+ Success Failure Pending + + Test start tile (S1) +
+ Success Failure Pending + + Test start tile (S2) +
+ Success Failure Pending + + Testing websites inside a map +
+

Iframe API

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Success Failure Pending + + Testing scripting API with an iFrame +
+ Success Failure Pending + + Testing scripting API with a script +
+ Success Failure Pending + + Testing goToPage script Api +
+ Success Failure Pending + + Testing scripting API loadSound() function +
+ Success Failure Pending + + Test a iframe opened by a script can use Iframe API +
+ Success Failure Pending + + Testing add a custom menu by scripting API +
+ Success Failure Pending + + Testing return current player attributes in Scripting API + WA.onInit +
+ Success Failure Pending + + Test listening player movement by Scripting API +
+ Success Failure Pending + + Testing set a property on a layer by Scripting API +
+ Success Failure Pending + + Testing show or hide a layer by Scripting API +
+ Success Failure Pending + + Test set tiles +
+ Success Failure Pending + + Testing scripting variables locally +
+ Success Failure Pending + + Testing shared scripting variables +
+ Success Failure Pending + + Testing trigger message API +
+ Success Failure Pending + + Testing scripting API deprecated function +
+ Success Failure Pending + + Testing scripting API for websites inside a map +
+

Mobile

+ + + + + + + + + +
+ Success Failure Pending + + Testing movement on mobile +
+ Success Failure Pending + + Testing video on mobile +
+

WebRTC

+ + + + + + + + + +
+ Success Failure Pending + + Test energy consumption +
+ Success Failure Pending + + Test the HelpCameraSettingScene +
+

Others

+ + + + + + + + + + + + + +
+ Success Failure Pending + + Test energy consumption +
+ Success Failure Pending + + Testing auto-zoom of viewport +
+ Success Failure Pending + + Testing zoom via mouse wheel +
+
- From 9f310383bafb886a86ae8d58f2942cf91e9907d1 Mon Sep 17 00:00:00 2001 From: TabascoEye Date: Thu, 9 Sep 2021 22:58:30 +0200 Subject: [PATCH 097/115] explain new property jitsiWidth --- docs/maps/meeting-rooms.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/maps/meeting-rooms.md b/docs/maps/meeting-rooms.md index 97d1b96f..719e0630 100644 --- a/docs/maps/meeting-rooms.md +++ b/docs/maps/meeting-rooms.md @@ -11,6 +11,7 @@ In order to create Jitsi meet zones: * You must create a specific layer. * In layer properties, you MUST add a "`jitsiRoom`" property (of type "`string`"). The value of the property is the name of the room in Jitsi. Note: the name of the room will be "slugified" and prepended with the name of the instance of the map (so that different instances of the map have different rooms) +* You may also use "jitsiWidth" property (of type "number" between 0 and 100) to control the width of the iframe containing the meeting room. ## Triggering of the "Jitsi meet" action From d071f5fa901362168430e2d4f983957472a24464 Mon Sep 17 00:00:00 2001 From: Kharhamel Date: Thu, 9 Sep 2021 16:51:02 +0200 Subject: [PATCH 098/115] FIX: the video element should not have a bigger height than its container --- front/src/Components/Video/VideoMediaBox.svelte | 10 +--------- front/src/WebRtc/VideoPeer.ts | 4 ---- front/style/mobile-style.scss | 1 - front/style/style.scss | 7 +++++-- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/front/src/Components/Video/VideoMediaBox.svelte b/front/src/Components/Video/VideoMediaBox.svelte index 924bb13a..cc7fb424 100644 --- a/front/src/Components/Video/VideoMediaBox.svelte +++ b/front/src/Components/Video/VideoMediaBox.svelte @@ -7,8 +7,6 @@ import {videoFocusStore} from "../../Stores/VideoFocusStore"; import {showReportScreenStore} from "../../Stores/ShowReportScreenStore"; import {getColorByString, srcObject} from "./utils"; - import {obtainedMediaConstraintIsMobileStore} from "../../Stores/MediaStore"; - import {onDestroy} from "svelte"; export let peer: VideoPeer; let streamStore = peer.streamStore; @@ -20,12 +18,6 @@ showReportScreenStore.set({ userId:peer.userId, userName: peer.userName }); } - let isMobile : boolean|null; - const unsubscribe = obtainedMediaConstraintIsMobileStore.subscribe(value => { - isMobile = value; - }); - onDestroy(unsubscribe); -
@@ -45,7 +37,7 @@ Report this user Report/Block - + {#if $constraintStore && $constraintStore.audio !== false} diff --git a/front/src/WebRtc/VideoPeer.ts b/front/src/WebRtc/VideoPeer.ts index b66a27fe..990adb4e 100644 --- a/front/src/WebRtc/VideoPeer.ts +++ b/front/src/WebRtc/VideoPeer.ts @@ -7,7 +7,6 @@ import type { UserSimplePeerInterface } from "./SimplePeer"; import { readable, Readable, Unsubscriber } from "svelte/store"; import { localStreamStore, - obtainedMediaConstraintIsMobileStore, obtainedMediaConstraintStore, ObtainedMediaStreamConstraints, } from "../Stores/MediaStore"; @@ -162,9 +161,6 @@ export class VideoPeer extends Peer { } else { mediaManager.disabledVideoByUserId(this.userId); } - if (message.isMobile != undefined) { - obtainedMediaConstraintIsMobileStore.set(message.isMobile); - } } else if (message.type === MESSAGE_TYPE_MESSAGE) { if (!blackListManager.isBlackListed(this.userUuid)) { chatMessagesStore.addExternalMessage(this.userId, message.message); diff --git a/front/style/mobile-style.scss b/front/style/mobile-style.scss index 7f1e770f..ad91b8dc 100644 --- a/front/style/mobile-style.scss +++ b/front/style/mobile-style.scss @@ -40,7 +40,6 @@ .main-section { position: absolute; width: 100%; - min-width: 400px; & > div { z-index: 2; diff --git a/front/style/style.scss b/front/style/style.scss index d02b7e11..f66875e3 100644 --- a/front/style/style.scss +++ b/front/style/style.scss @@ -44,7 +44,7 @@ body .message-info.warning{ video { width: 100%; height: 100%; - max-height: 90vh; + object-fit: cover; cursor: url('./images/cursor_pointer.png'), pointer; &.mobile{ @@ -76,7 +76,6 @@ body .message-info.warning{ left: 5px; bottom: 5px; padding: 10px; - z-index: 2; &.active { display: block !important; @@ -547,6 +546,10 @@ input[type=range]:focus::-ms-fill-upper { cursor: url('./images/cursor_pointer.png'), pointer; border-radius: 15px 15px 15px 15px; pointer-events: auto; + + video { + max-height: 21vh; + } } .sidebar > div:hover { From 7cabf64b115f711c4300b19004c224eb3ea228ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Fri, 10 Sep 2021 16:40:09 +0200 Subject: [PATCH 099/115] Adding more tests --- maps/tests/inactive_tabs.json | 82 +++++++++++++++++++++++++++++++++++ maps/tests/index.html | 16 +++++++ maps/tests/reconnection.json | 82 +++++++++++++++++++++++++++++++++++ 3 files changed, 180 insertions(+) create mode 100644 maps/tests/inactive_tabs.json create mode 100644 maps/tests/reconnection.json diff --git a/maps/tests/inactive_tabs.json b/maps/tests/inactive_tabs.json new file mode 100644 index 00000000..f2aab52e --- /dev/null +++ b/maps/tests/inactive_tabs.json @@ -0,0 +1,82 @@ +{ "compressionlevel":-1, + "height":10, + "infinite":false, + "layers":[ + { + "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "height":10, + "id":1, + "name":"floor", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":10, + "x":0, + "y":0 + }, + { + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":10, + "id":2, + "name":"start", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":10, + "x":0, + "y":0 + }, + { + "draworder":"topdown", + "id":3, + "name":"floorLayer", + "objects":[ + { + "height":261.73266830836, + "id":3, + "name":"", + "rotation":0, + "text": + { + "fontfamily":"Sans Serif", + "pixelsize":11, + "text":"Test:\nOpen WorkAdventure in 1 tab in Chrome and 1 tab in Firefox. Keep the Firefox tab open and open another tab in Chrome on any website (so that the WA Chrome tab is not visible). Do not enter in a bubble. Wait 6 minutes. (you can check time waited in a \"chrome:\/\/discards\" special tab.\n\nResult:\nOn the Firefox tab, the user of the Chrome tab is still visible. You can speak to the other user in a bubble.\n\nHere, we are checking that the Chrome does not \"freeze\" the non visible tab.\n\nRe-run this test with Safari, Edge and Firefox as the browsers with the hidden tabs", + "wrap":true + }, + "type":"", + "visible":true, + "width":252.4375, + "x":46.5894222943362, + "y":34.2876372135732 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }], + "nextlayerid":8, + "nextobjectid":5, + "orientation":"orthogonal", + "renderorder":"right-down", + "tiledversion":"2021.03.23", + "tileheight":32, + "tilesets":[ + { + "columns":11, + "firstgid":1, + "image":"tileset1.png", + "imageheight":352, + "imagewidth":352, + "margin":0, + "name":"tileset1", + "spacing":0, + "tilecount":121, + "tileheight":32, + "tilewidth":32 + }], + "tilewidth":32, + "type":"map", + "version":1.5, + "width":10 +} \ No newline at end of file diff --git a/maps/tests/index.html b/maps/tests/index.html index 17f646bc..20f48274 100644 --- a/maps/tests/index.html +++ b/maps/tests/index.html @@ -235,6 +235,22 @@

Others

+ + + + + + + +
+ Success Failure Pending + + Test reconnection +
+ Success Failure Pending + + Test inactive tabs on Chrome +
Success Failure Pending diff --git a/maps/tests/reconnection.json b/maps/tests/reconnection.json new file mode 100644 index 00000000..495ae39c --- /dev/null +++ b/maps/tests/reconnection.json @@ -0,0 +1,82 @@ +{ "compressionlevel":-1, + "height":10, + "infinite":false, + "layers":[ + { + "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "height":10, + "id":1, + "name":"floor", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":10, + "x":0, + "y":0 + }, + { + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":10, + "id":2, + "name":"start", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":10, + "x":0, + "y":0 + }, + { + "draworder":"topdown", + "id":3, + "name":"floorLayer", + "objects":[ + { + "height":261.73266830836, + "id":3, + "name":"", + "rotation":0, + "text": + { + "fontfamily":"Sans Serif", + "pixelsize":11, + "text":"Test:\nTest to be run on a remote site (not locally)\nOpen WorkAdventure in 2 tabs.\nClose the network connection (close Wifi, ...)\n\nResult:\nAfter a few seconds, WorkAdventure displays a \"reconnecting scene\"\n\nTest:\nResume network connection, without switching tabs (one tab on front)\n\nResult:\nWorkAdventure reconnects automatically. From the tab that resumed, you can connect to the other tab (that is not visible), therefore testing that the invisible tab has resumed too.", + "wrap":true + }, + "type":"", + "visible":true, + "width":252.4375, + "x":46.5894222943362, + "y":34.2876372135732 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }], + "nextlayerid":8, + "nextobjectid":5, + "orientation":"orthogonal", + "renderorder":"right-down", + "tiledversion":"2021.03.23", + "tileheight":32, + "tilesets":[ + { + "columns":11, + "firstgid":1, + "image":"tileset1.png", + "imageheight":352, + "imagewidth":352, + "margin":0, + "name":"tileset1", + "spacing":0, + "tilecount":121, + "tileheight":32, + "tilewidth":32 + }], + "tilewidth":32, + "type":"map", + "version":1.5, + "width":10 +} \ No newline at end of file From 05646718a95a02a8285c954001e1f86628fa3c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Fri, 10 Sep 2021 18:30:36 +0200 Subject: [PATCH 100/115] Fix disconnects after 5 minutes in Chrome This commit increases idle timeout for websocket connection Issue: after 5 minutes of inactive tab (hidden tab) in Chrome, WorkAdventure was disconnected. I believe Google was going in "intensive throttling" mode (see https://developer.chrome.com/blog/timer-throttling-in-chrome-88/#intensive-throttling) This means setTimeouts are run only once per minute. And I believe the "keep alive" must be implemented with a "setTimeout" (one way or another even if I can't find a trace of this in the code). This would mean that the browser would send keep alive requests only once per minute. But the pusher is configured to shut the connection after 30 seconds of idle activity. Therefore, the pusher disconnects inactive Chrome tabs. By raising the Pusher idle timer to 2 minutes, we give a chance to Chrome to send a ping to the server in time (since Chrome won't send more than 1 ping per minute). --- back/src/Enum/EnvironmentVariable.ts | 1 - pusher/src/Enum/EnvironmentVariable.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/back/src/Enum/EnvironmentVariable.ts b/back/src/Enum/EnvironmentVariable.ts index 92f62b0b..493f97a2 100644 --- a/back/src/Enum/EnvironmentVariable.ts +++ b/back/src/Enum/EnvironmentVariable.ts @@ -9,7 +9,6 @@ const JITSI_ISS = process.env.JITSI_ISS || ""; const SECRET_JITSI_KEY = process.env.SECRET_JITSI_KEY || ""; 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 const REDIS_HOST = process.env.REDIS_HOST || undefined; diff --git a/pusher/src/Enum/EnvironmentVariable.ts b/pusher/src/Enum/EnvironmentVariable.ts index 4a078d90..ab1ce110 100644 --- a/pusher/src/Enum/EnvironmentVariable.ts +++ b/pusher/src/Enum/EnvironmentVariable.ts @@ -9,7 +9,7 @@ const JITSI_URL: string | undefined = process.env.JITSI_URL === "" ? undefined : const JITSI_ISS = process.env.JITSI_ISS || ""; const SECRET_JITSI_KEY = process.env.SECRET_JITSI_KEY || ""; const PUSHER_HTTP_PORT = parseInt(process.env.PUSHER_HTTP_PORT || "8080") || 8080; -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 SOCKET_IDLE_TIMER = parseInt(process.env.SOCKET_IDLE_TIMER as string) || 120; // maximum time (in second) without activity before a socket is closed. Should be greater than 60 seconds in order to cope for Chrome intensive throttling (https://developer.chrome.com/blog/timer-throttling-in-chrome-88/#intensive-throttling) export const FRONT_URL = process.env.FRONT_URL || "http://localhost"; export const OPID_CLIENT_ID = process.env.OPID_CLIENT_ID || ""; From 94517c0f4b61950839936ca9847648550b89efc9 Mon Sep 17 00:00:00 2001 From: TabascoEye Date: Fri, 10 Sep 2021 23:17:04 +0200 Subject: [PATCH 101/115] add the possibilities of "onaction" and message to new "openTab" property --- .../Phaser/Game/GameMapPropertiesListener.ts | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/front/src/Phaser/Game/GameMapPropertiesListener.ts b/front/src/Phaser/Game/GameMapPropertiesListener.ts index db100935..950e1ebc 100644 --- a/front/src/Phaser/Game/GameMapPropertiesListener.ts +++ b/front/src/Phaser/Game/GameMapPropertiesListener.ts @@ -13,9 +13,27 @@ export class GameMapPropertiesListener { constructor(private scene: GameScene, private gameMap: GameMap) {} register() { - this.gameMap.onPropertyChange("openTab", (newValue) => { + this.gameMap.onPropertyChange("openTab", (newValue, oldvalue, allProps) => { + if (newValue === undefined) { + layoutManagerActionStore.removeAction("openTab"); + } if (typeof newValue == "string" && newValue.length) { - scriptUtils.openTab(newValue); + const openWebsiteTriggerValue = allProps.get(TRIGGER_WEBSITE_PROPERTIES); + if (openWebsiteTriggerValue && openWebsiteTriggerValue === ON_ACTION_TRIGGER_BUTTON) { + let message = allProps.get(WEBSITE_MESSAGE_PROPERTIES); + if (message === undefined) { + message = "Press SPACE or touch here to open web site in new tab"; + } + layoutManagerActionStore.addAction({ + uuid: "openTab", + type: "message", + message: message, + callback: () => scriptUtils.openTab(newValue), + userInputManager: this.scene.userInputManager, + }); + } else { + scriptUtils.openTab(newValue); + } } }); this.gameMap.onPropertyChange("openWebsite", (newValue, oldValue, allProps) => { From f0b83663f6909b5763d82f1bb977c058a94c1038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Mon, 13 Sep 2021 10:06:08 +0200 Subject: [PATCH 102/115] Fixing broken sound controls Because of the rework of the menu, the clickable zone for the menu was extending at the complete top of the screen, which caused interactive items at the top of the screen (like sound controls) to be broken. This commit fixes this. --- front/src/Components/Menu/MenuIcon.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/Components/Menu/MenuIcon.svelte b/front/src/Components/Menu/MenuIcon.svelte index 2da9e870..92a52ba3 100644 --- a/front/src/Components/Menu/MenuIcon.svelte +++ b/front/src/Components/Menu/MenuIcon.svelte @@ -22,9 +22,9 @@