From fe570c9117926707d7bbd550cba2fa07bca9e747 Mon Sep 17 00:00:00 2001 From: Hanusiak Piotr Date: Wed, 9 Feb 2022 10:17:31 +0100 Subject: [PATCH 01/31] moveTo object position --- front/src/Phaser/Game/GameMap.ts | 4 +++ front/src/Phaser/Game/GameScene.ts | 49 ++++++++++++++++++------------ maps/tests/move_to.json | 33 ++++++++++++++++++-- 3 files changed, 65 insertions(+), 21 deletions(-) diff --git a/front/src/Phaser/Game/GameMap.ts b/front/src/Phaser/Game/GameMap.ts index 7e9a486d..8e377ae7 100644 --- a/front/src/Phaser/Game/GameMap.ts +++ b/front/src/Phaser/Game/GameMap.ts @@ -323,6 +323,10 @@ export class GameMap { throw new Error("No possible position found"); } + public getObjectWithName(name: string): ITiledMapObject | undefined { + return this.tiledObjects.find((object) => object.name === name); + } + private getLayersByKey(key: number): Array { return this.flatLayers.filter((flatLayer) => flatLayer.type === "tilelayer" && flatLayer.data[key] !== 0); } diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 9b758a45..44992d85 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -568,6 +568,8 @@ export class GameScene extends DirtyScene { this.createCurrentPlayer(); this.removeAllRemotePlayers(); //cleanup the list of remote players in case the scene was rebooted + this.tryMovePlayerWithMoveToParameter(); + this.cameraManager = new CameraManager( this, { x: this.Map.widthInPixels, y: this.Map.heightInPixels }, @@ -1460,9 +1462,9 @@ ${escapedMessage} }); iframeListener.registerAnswerer("movePlayerTo", async (message) => { - const index = this.getGameMap().getTileIndexAt(message.x, message.y); - const startTile = this.getGameMap().getTileIndexAt(this.CurrentPlayer.x, this.CurrentPlayer.y); - const path = await this.getPathfindingManager().findPath(startTile, index, true, true); + const startTileIndex = this.getGameMap().getTileIndexAt(this.CurrentPlayer.x, this.CurrentPlayer.y); + const destinationTileIndex = this.getGameMap().getTileIndexAt(message.x, message.y); + const path = await this.getPathfindingManager().findPath(startTileIndex, destinationTileIndex, true, true); path.shift(); if (path.length === 0) { throw new Error("no path available"); @@ -1626,6 +1628,31 @@ ${escapedMessage} this.MapPlayersByKey.clear(); } + private tryMovePlayerWithMoveToParameter(): void { + const moveToParam = urlManager.getHashParameter("moveTo"); + if (moveToParam) { + try { + const destinationObject = this.gameMap.getObjectWithName(moveToParam); + let endPos; + if (destinationObject) { + endPos = this.gameMap.getTileIndexAt(destinationObject.x, destinationObject.y); + } else { + endPos = this.gameMap.getRandomPositionFromLayer(moveToParam); + } + this.pathfindingManager + .findPath(this.gameMap.getTileIndexAt(this.CurrentPlayer.x, this.CurrentPlayer.y), endPos) + .then((path) => { + if (path && path.length > 0) { + this.CurrentPlayer.setPathToFollow(path).catch((reason) => console.warn(reason)); + } + }) + .catch((reason) => console.warn(reason)); + } catch (err) { + console.warn(`Cannot proceed with moveTo command:\n\t-> ${err}`); + } + } + } + private getExitUrl(layer: ITiledMapLayer): string | undefined { return this.getProperty(layer, GameMapProperties.EXIT_URL) as string | undefined; } @@ -1748,22 +1775,6 @@ ${escapedMessage} this.connection?.emitEmoteEvent(emoteKey); analyticsClient.launchEmote(emoteKey); }); - const moveToParam = urlManager.getHashParameter("moveTo"); - if (moveToParam) { - try { - const endPos = this.gameMap.getRandomPositionFromLayer(moveToParam); - this.pathfindingManager - .findPath(this.gameMap.getTileIndexAt(this.CurrentPlayer.x, this.CurrentPlayer.y), endPos) - .then((path) => { - if (path && path.length > 0) { - this.CurrentPlayer.setPathToFollow(path).catch((reason) => console.warn(reason)); - } - }) - .catch((reason) => console.warn(reason)); - } catch (err) { - console.warn(`Cannot proceed with moveTo command:\n\t-> ${err}`); - } - } } catch (err) { if (err instanceof TextureError) { gameManager.leaveGame(SelectCharacterSceneName, new SelectCharacterScene()); diff --git a/maps/tests/move_to.json b/maps/tests/move_to.json index 796a9d46..6776bd6b 100644 --- a/maps/tests/move_to.json +++ b/maps/tests/move_to.json @@ -3,7 +3,7 @@ "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], + "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, 12, 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", @@ -204,6 +204,35 @@ "width":92.7120717279925, "x":233.848901257569, "y":135.845612785282 + }, + { + "height":0, + "id":9, + "name":"destination", + "point":true, + "rotation":0, + "type":"", + "visible":true, + "width":0, + "x":207.918025151374, + "y":243.31625523987 + }, + { + "height":45.0829063809967, + "id":10, + "name":"", + "rotation":0, + "text": + { + "halign":"center", + "text":"destination object", + "wrap":true + }, + "type":"", + "visible":true, + "width":83, + "x":167.26, + "y":254.682580344667 }], "opacity":1, "type":"objectgroup", @@ -212,7 +241,7 @@ "y":0 }], "nextlayerid":11, - "nextobjectid":9, + "nextobjectid":11, "orientation":"orthogonal", "renderorder":"right-down", "tiledversion":"1.7.2", From b565080312f02ee51ba22f7f84327a18b130ad77 Mon Sep 17 00:00:00 2001 From: Hanusiak Piotr Date: Wed, 9 Feb 2022 10:52:44 +0100 Subject: [PATCH 02/31] parse x and y position from moveTo param --- front/src/Phaser/Game/GameScene.ts | 14 ++++++++++---- front/src/Utils/StringUtils.ts | 12 ++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 front/src/Utils/StringUtils.ts diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 44992d85..8d13cb7b 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -92,6 +92,7 @@ import { MapStore } from "../../Stores/Utils/MapStore"; import { followUsersColorStore } from "../../Stores/FollowStore"; import { GameSceneUserInputHandler } from "../UserInput/GameSceneUserInputHandler"; import { locale } from "../../i18n/i18n-svelte"; +import { StringUtils } from "../../Utils/StringUtils"; export interface GameSceneInitInterface { initPosition: PointInterface | null; reconnecting: boolean; @@ -1632,12 +1633,17 @@ ${escapedMessage} const moveToParam = urlManager.getHashParameter("moveTo"); if (moveToParam) { try { - const destinationObject = this.gameMap.getObjectWithName(moveToParam); let endPos; - if (destinationObject) { - endPos = this.gameMap.getTileIndexAt(destinationObject.x, destinationObject.y); + const posFromParam = StringUtils.parsePointFromParam(moveToParam); + if (posFromParam) { + endPos = this.gameMap.getTileIndexAt(posFromParam.x, posFromParam.y); } else { - endPos = this.gameMap.getRandomPositionFromLayer(moveToParam); + const destinationObject = this.gameMap.getObjectWithName(moveToParam); + if (destinationObject) { + endPos = this.gameMap.getTileIndexAt(destinationObject.x, destinationObject.y); + } else { + endPos = this.gameMap.getRandomPositionFromLayer(moveToParam); + } } this.pathfindingManager .findPath(this.gameMap.getTileIndexAt(this.CurrentPlayer.x, this.CurrentPlayer.y), endPos) diff --git a/front/src/Utils/StringUtils.ts b/front/src/Utils/StringUtils.ts new file mode 100644 index 00000000..1f168c15 --- /dev/null +++ b/front/src/Utils/StringUtils.ts @@ -0,0 +1,12 @@ +export class StringUtils { + public static parsePointFromParam(param: string, separator: string = ","): { x: number; y: number } | undefined { + const values = param.split(separator).map((val) => parseInt(val)); + if (values.length !== 2) { + return; + } + if (isNaN(values[0]) || isNaN(values[1])) { + return; + } + return { x: values[0], y: values[1] }; + } +} From 71e18d1838e8b5dd54589e283cc2213039ab6ddd Mon Sep 17 00:00:00 2001 From: Hanusiak Piotr Date: Wed, 9 Feb 2022 11:05:43 +0100 Subject: [PATCH 03/31] update moveTo test map --- maps/tests/move_to.json | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/maps/tests/move_to.json b/maps/tests/move_to.json index 6776bd6b..0801831a 100644 --- a/maps/tests/move_to.json +++ b/maps/tests/move_to.json @@ -233,6 +233,42 @@ "width":83, "x":167.26, "y":254.682580344667 + }, + { + "height":19.6921, + "id":11, + "name":"", + "rotation":0, + "text": + { + "fontfamily":"Sans Serif", + "pixelsize":13, + "text":"...#start&moveTo=destination", + "wrap":true + }, + "type":"", + "visible":true, + "width":202.260327899394, + "x":32.2652715416861, + "y":148.51445302748 + }, + { + "height":19.6921, + "id":12, + "name":"", + "rotation":0, + "text": + { + "fontfamily":"Sans Serif", + "pixelsize":13, + "text":"...#start2&moveTo=200,100", + "wrap":true + }, + "type":"", + "visible":true, + "width":202.26, + "x":32.2654354913834, + "y":169.008165183978 }], "opacity":1, "type":"objectgroup", @@ -241,7 +277,7 @@ "y":0 }], "nextlayerid":11, - "nextobjectid":11, + "nextobjectid":13, "orientation":"orthogonal", "renderorder":"right-down", "tiledversion":"1.7.2", From 9cccdca3dc5d52a1590c55df57f816448d932696 Mon Sep 17 00:00:00 2001 From: Hanusiak Piotr Date: Wed, 9 Feb 2022 11:09:20 +0100 Subject: [PATCH 04/31] docs update --- docs/maps/entry-exit.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/maps/entry-exit.md b/docs/maps/entry-exit.md index 2040beb3..25e530de 100644 --- a/docs/maps/entry-exit.md +++ b/docs/maps/entry-exit.md @@ -82,7 +82,11 @@ We are able to direct a Woka to the desired place immediately after spawn. To ma ``` .../my_map.json#moveTo=meeting-room&start ``` +*...or even like this!* +``` +.../my_map.json#start&moveTo=200,100 +``` -For this to work, moveTo must be equal to the layer name of interest. This layer should have at least one tile defined. In case of layer having many tiles, user will go to one of them, randomly selected. +For this to work, moveTo must be equal to the x and y position, layer name, or object name of interest. Layer should have at least one tile defined. In case of layer having many tiles, user will go to one of them, randomly selected. ![](images/moveTo-layer-example.png) \ No newline at end of file From c13672c9dca959b1a260d28fe5dd2d36e7efdc7c Mon Sep 17 00:00:00 2001 From: Hanusiak Piotr Date: Wed, 9 Feb 2022 13:03:14 +0100 Subject: [PATCH 05/31] updated invitation link creator --- front/src/Components/Menu/GuestSubMenu.svelte | 50 +++++++++++++- front/src/Phaser/Game/GameScene.ts | 3 + .../Phaser/Game/StartPositionCalculator.ts | 67 ++++++++++++------- front/src/Stores/StartLayerNamesStore.ts | 6 ++ 4 files changed, 99 insertions(+), 27 deletions(-) create mode 100644 front/src/Stores/StartLayerNamesStore.ts diff --git a/front/src/Components/Menu/GuestSubMenu.svelte b/front/src/Components/Menu/GuestSubMenu.svelte index a0cd94d7..34fba1af 100644 --- a/front/src/Components/Menu/GuestSubMenu.svelte +++ b/front/src/Components/Menu/GuestSubMenu.svelte @@ -1,5 +1,12 @@ - WorkAdventure diff --git a/front/dist/index.tmpl.html.tmp b/front/dist/index.tmpl.html.tmp deleted file mode 100644 index 7a3e210d..00000000 --- a/front/dist/index.tmpl.html.tmp +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WorkAdventure - - -
- -
-
-
-
-
- - -
-
-
- -
-
-
-
- -
-
- - -
-
-
- -
-
-
- -
-
- - -
-
-
- -
-
-
- -
-
- - -
-
-
-
-
-
-
-
-
- - -
-
- -
-
- -
-
- - - - From 7da4fd7da64761ac5f0fcda76a4f38cc08abf65f Mon Sep 17 00:00:00 2001 From: Lurkars Date: Sat, 12 Feb 2022 14:37:25 +0100 Subject: [PATCH 21/31] merge latest translations --- front/src/i18n/de-DE/index.ts | 2 ++ front/src/i18n/de-DE/menu.ts | 2 +- front/src/i18n/de-DE/trigger.ts | 9 +++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 front/src/i18n/de-DE/trigger.ts diff --git a/front/src/i18n/de-DE/index.ts b/front/src/i18n/de-DE/index.ts index 40b63558..a72ecc1f 100644 --- a/front/src/i18n/de-DE/index.ts +++ b/front/src/i18n/de-DE/index.ts @@ -12,6 +12,7 @@ import menu from "./menu"; import report from "./report"; import warning from "./warning"; import woka from "./woka"; +import trigger from "./trigger"; const de_DE: Translation = { ...(en_US as Translation), @@ -29,6 +30,7 @@ const de_DE: Translation = { report, warning, emoji, + trigger, }; export default de_DE; diff --git a/front/src/i18n/de-DE/menu.ts b/front/src/i18n/de-DE/menu.ts index 5e695d95..c1b7bc18 100644 --- a/front/src/i18n/de-DE/menu.ts +++ b/front/src/i18n/de-DE/menu.ts @@ -70,7 +70,7 @@ const menu: NonNullable = { description: "Link zu diesem Raum teilen!", copy: "Kopieren", share: "Teilen", - walk_automatically_to_position: "Walk automatically to my position", + walk_automatically_to_position: "Automatisch zu meiner Position gehen", }, globalMessage: { text: "Text", diff --git a/front/src/i18n/de-DE/trigger.ts b/front/src/i18n/de-DE/trigger.ts new file mode 100644 index 00000000..9239c0fc --- /dev/null +++ b/front/src/i18n/de-DE/trigger.ts @@ -0,0 +1,9 @@ +import type { Translation } from "../i18n-types"; + +const trigger: NonNullable = { + cowebsite: "Drücke LEERTASTE oder tippe hier um die Webseite zu öffnen", + newTab: "Drücke LEERTASTE oder tippe hier um die Webseite in einem neuen Tab zu öffnen", + jitsiRoom: "Drücke LEERTASTE oder tippe hier um dem Jitsi Meet Raum beizutreten", +}; + +export default trigger; From c6b125b347e52fa1790c275328b9fd6f642fc5ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 13 Feb 2022 09:55:59 +0000 Subject: [PATCH 22/31] Bump follow-redirects from 1.14.7 to 1.14.8 in /front Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] --- front/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/front/yarn.lock b/front/yarn.lock index 3572e44b..f156abf7 100644 --- a/front/yarn.lock +++ b/front/yarn.lock @@ -2795,9 +2795,9 @@ focus-trap@^5.1.0: xtend "^4.0.1" follow-redirects@^1.0.0, follow-redirects@^1.14.0: - version "1.14.7" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685" - integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ== + version "1.14.8" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc" + integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA== for-in@^1.0.2: version "1.0.2" From aef64afdb9476a3aadc03400ca8f1e1d12f05ee6 Mon Sep 17 00:00:00 2001 From: Anton Bracke Date: Sun, 13 Feb 2022 20:20:38 +0100 Subject: [PATCH 23/31] fix quill import --- front/src/Components/Menu/TextGlobalMessage.svelte | 4 ---- front/style/TextGlobalMessageSvelte-Style.scss | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/front/src/Components/Menu/TextGlobalMessage.svelte b/front/src/Components/Menu/TextGlobalMessage.svelte index be6a57a4..6b42e42e 100644 --- a/front/src/Components/Menu/TextGlobalMessage.svelte +++ b/front/src/Components/Menu/TextGlobalMessage.svelte @@ -76,7 +76,3 @@
- - diff --git a/front/style/TextGlobalMessageSvelte-Style.scss b/front/style/TextGlobalMessageSvelte-Style.scss index 4baa8c8a..94baa67a 100644 --- a/front/style/TextGlobalMessageSvelte-Style.scss +++ b/front/style/TextGlobalMessageSvelte-Style.scss @@ -1,4 +1,8 @@ //TextGlobalMessage + +// TODO: load on demand with TextGlobalMessage component +@import "quill/dist/quill.snow.css"; + section.section-input-send-text { --height-toolbar: 20%; height: 100%; From f9e8e0bd60010bab5135fd56169f1bfc56298be0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 13 Feb 2022 20:09:24 +0000 Subject: [PATCH 24/31] Bump follow-redirects from 1.14.7 to 1.14.8 in /back Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] --- back/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/back/yarn.lock b/back/yarn.lock index 04c6929b..31bd1a09 100644 --- a/back/yarn.lock +++ b/back/yarn.lock @@ -935,9 +935,9 @@ flatted@^3.1.0: integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== follow-redirects@^1.14.0: - version "1.14.7" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685" - integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ== + version "1.14.8" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc" + integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA== fs-minipass@^2.0.0: version "2.1.0" From 2cb7c518c182e9cd1c5fb51fe85bf7f99a448172 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 13 Feb 2022 21:56:46 +0000 Subject: [PATCH 25/31] Bump follow-redirects from 1.14.7 to 1.14.8 in /pusher Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] --- pusher/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pusher/yarn.lock b/pusher/yarn.lock index 1321a9c3..8992a72c 100644 --- a/pusher/yarn.lock +++ b/pusher/yarn.lock @@ -950,9 +950,9 @@ flatted@^2.0.0: integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== follow-redirects@^1.14.0: - version "1.14.7" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685" - integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ== + version "1.14.8" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc" + integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA== fs-minipass@^2.0.0: version "2.1.0" From 9073024b1d69b993475a61a5b13669f5d1e7d50a Mon Sep 17 00:00:00 2001 From: Ludwig Behm Date: Sat, 12 Feb 2022 22:19:48 +0100 Subject: [PATCH 26/31] pusher: add missing Content-Type header for json responses --- pusher/src/Controller/AuthenticateController.ts | 5 +++++ pusher/src/Controller/MapController.ts | 3 +++ 2 files changed, 8 insertions(+) diff --git a/pusher/src/Controller/AuthenticateController.ts b/pusher/src/Controller/AuthenticateController.ts index fe80eafa..fff76c40 100644 --- a/pusher/src/Controller/AuthenticateController.ts +++ b/pusher/src/Controller/AuthenticateController.ts @@ -79,6 +79,7 @@ export class AuthenticateController extends BaseController { if (!code && !nonce) { res.writeStatus("200"); this.addCorsHeaders(res); + res.writeHeader('Content-Type', 'application/json'); return res.end(JSON.stringify({ ...resUserData, authToken: token })); } console.error("Token cannot to be check on OpenId provider"); @@ -91,6 +92,7 @@ export class AuthenticateController extends BaseController { const resCheckTokenAuth = await openIDClient.checkTokenAuth(authTokenData.accessToken); res.writeStatus("200"); this.addCorsHeaders(res); + res.writeHeader('Content-Type', 'application/json'); return res.end(JSON.stringify({ ...resCheckTokenAuth, ...resUserData, authToken: token })); } catch (err) { console.info("User was not connected", err); @@ -121,6 +123,7 @@ export class AuthenticateController extends BaseController { res.writeStatus("200"); this.addCorsHeaders(res); + res.writeHeader('Content-Type', 'application/json'); return res.end(JSON.stringify({ ...data, authToken })); } catch (e) { console.error("openIDCallback => ERROR", e); @@ -183,6 +186,7 @@ export class AuthenticateController extends BaseController { const authToken = jwtTokenManager.createAuthToken(email || userUuid); res.writeStatus("200 OK"); this.addCorsHeaders(res); + res.writeHeader('Content-Type', 'application/json'); res.end( JSON.stringify({ authToken, @@ -222,6 +226,7 @@ export class AuthenticateController extends BaseController { const authToken = jwtTokenManager.createAuthToken(userUuid); res.writeStatus("200 OK"); this.addCorsHeaders(res); + res.writeHeader('Content-Type', 'application/json'); res.end( JSON.stringify({ authToken, diff --git a/pusher/src/Controller/MapController.ts b/pusher/src/Controller/MapController.ts index 00936b44..9dd2aaf8 100644 --- a/pusher/src/Controller/MapController.ts +++ b/pusher/src/Controller/MapController.ts @@ -47,6 +47,7 @@ export class MapController extends BaseController { if (!match) { res.writeStatus("404 Not Found"); this.addCorsHeaders(res); + res.writeHeader('Content-Type', 'application/json'); res.end(JSON.stringify({})); return; } @@ -55,6 +56,7 @@ export class MapController extends BaseController { res.writeStatus("200 OK"); this.addCorsHeaders(res); + res.writeHeader('Content-Type', 'application/json'); res.end( JSON.stringify({ mapUrl, @@ -106,6 +108,7 @@ export class MapController extends BaseController { res.writeStatus("200 OK"); this.addCorsHeaders(res); + res.writeHeader('Content-Type', 'application/json'); res.end(JSON.stringify(mapDetails)); } catch (e) { this.errorToResponse(e, res); From d0af76639407ff68943bcda644d5d2202fc2fe1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Mon, 14 Feb 2022 09:07:37 +0100 Subject: [PATCH 27/31] Adding missing reference to Camera doc --- docs/maps/menu.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/maps/menu.php b/docs/maps/menu.php index b8d0e638..c8afc2c0 100644 --- a/docs/maps/menu.php +++ b/docs/maps/menu.php @@ -141,6 +141,12 @@ return [ 'markdown' => 'maps.api-controls', 'editUrl' => 'https://github.com/thecodingmachine/workadventure/edit/develop/docs/maps/api-controls.md', ], + [ + 'title' => 'Camera', + 'url' => '/map-building/api-camera.md', + 'markdown' => 'maps.api-camera', + 'editUrl' => 'https://github.com/thecodingmachine/workadventure/edit/develop/docs/maps/api-camera.md', + ], [ 'title' => 'Deprecated', 'url' => '/map-building/api-deprecated.md', From 9bfce8412af99c253eedb5cae0f6ad2f20823b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Mon, 14 Feb 2022 15:59:04 +0100 Subject: [PATCH 28/31] Adding a missing translation for "Visiting card" Also, changing "Visiting Card" to "Business Card" in English --- front/src/Phaser/Entity/RemotePlayer.ts | 3 ++- front/src/i18n/de-DE/woka.ts | 3 +++ front/src/i18n/en-US/woka.ts | 3 +++ front/src/i18n/fr-FR/woka.ts | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/front/src/Phaser/Entity/RemotePlayer.ts b/front/src/Phaser/Entity/RemotePlayer.ts index 7af6da2e..a2ca63ea 100644 --- a/front/src/Phaser/Entity/RemotePlayer.ts +++ b/front/src/Phaser/Entity/RemotePlayer.ts @@ -7,6 +7,7 @@ import type { PlayerAnimationDirections } from "../Player/Animation"; import type { Unsubscriber } from "svelte/store"; import type { ActivatableInterface } from "../Game/ActivatableInterface"; import type CancelablePromise from "cancelable-promise"; +import LL from "../../i18n/i18n-svelte"; /** * Class representing the sprite of a remote player (a player that plays on another computer) @@ -107,7 +108,7 @@ export class RemotePlayer extends Character implements ActivatableInterface { private registerDefaultActionsMenuActions(): void { if (this.visitCardUrl) { this.registeredActions.push({ - actionName: "Visiting Card", + actionName: LL.woka.menu.businessCard(), callback: () => { requestVisitCardsStore.set(this.visitCardUrl); actionsMenuStore.clear(); diff --git a/front/src/i18n/de-DE/woka.ts b/front/src/i18n/de-DE/woka.ts index 640cd756..98046f3b 100644 --- a/front/src/i18n/de-DE/woka.ts +++ b/front/src/i18n/de-DE/woka.ts @@ -15,6 +15,9 @@ const woka: NonNullable = { continue: "Auswählen", customize: "Bearbeite dein WOKA", }, + menu: { + businessCard: "Visitenkarte", + }, }; export default woka; diff --git a/front/src/i18n/en-US/woka.ts b/front/src/i18n/en-US/woka.ts index 6c1e02ad..ac4aaa64 100644 --- a/front/src/i18n/en-US/woka.ts +++ b/front/src/i18n/en-US/woka.ts @@ -15,6 +15,9 @@ const woka: BaseTranslation = { continue: "Continue", customize: "Customize your WOKA", }, + menu: { + businessCard: "Business Card", + }, }; export default woka; diff --git a/front/src/i18n/fr-FR/woka.ts b/front/src/i18n/fr-FR/woka.ts index 36ef463b..3225a8a2 100644 --- a/front/src/i18n/fr-FR/woka.ts +++ b/front/src/i18n/fr-FR/woka.ts @@ -15,6 +15,9 @@ const woka: NonNullable = { continue: "Continuer", customize: "Personnalisez votre WOKA", }, + menu: { + businessCard: "Carte de visite", + }, }; export default woka; From 73e20c3a24d032b91ed64cbe01d10f2c8e70fb20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Feb 2022 17:46:49 +0000 Subject: [PATCH 29/31] Bump follow-redirects from 1.14.7 to 1.14.8 in /tests Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] --- tests/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/package-lock.json b/tests/package-lock.json index 2a9888da..0547c2a3 100644 --- a/tests/package-lock.json +++ b/tests/package-lock.json @@ -3182,9 +3182,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.14.7", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz", - "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==", + "version": "1.14.8", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.8.tgz", + "integrity": "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==", "funding": [ { "type": "individual", @@ -8177,9 +8177,9 @@ } }, "follow-redirects": { - "version": "1.14.7", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz", - "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==" + "version": "1.14.8", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.8.tgz", + "integrity": "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==" }, "fp-ts": { "version": "2.11.8", From 4bcdbcb1bd6b11e42a60bd47fe6b0cf69f05228a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Tue, 15 Feb 2022 09:15:41 +0100 Subject: [PATCH 30/31] Fixing linting --- pusher/src/Controller/AuthenticateController.ts | 10 +++++----- pusher/src/Controller/MapController.ts | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pusher/src/Controller/AuthenticateController.ts b/pusher/src/Controller/AuthenticateController.ts index fff76c40..89d3adf3 100644 --- a/pusher/src/Controller/AuthenticateController.ts +++ b/pusher/src/Controller/AuthenticateController.ts @@ -79,7 +79,7 @@ export class AuthenticateController extends BaseController { if (!code && !nonce) { res.writeStatus("200"); this.addCorsHeaders(res); - res.writeHeader('Content-Type', 'application/json'); + res.writeHeader("Content-Type", "application/json"); return res.end(JSON.stringify({ ...resUserData, authToken: token })); } console.error("Token cannot to be check on OpenId provider"); @@ -92,7 +92,7 @@ export class AuthenticateController extends BaseController { const resCheckTokenAuth = await openIDClient.checkTokenAuth(authTokenData.accessToken); res.writeStatus("200"); this.addCorsHeaders(res); - res.writeHeader('Content-Type', 'application/json'); + res.writeHeader("Content-Type", "application/json"); return res.end(JSON.stringify({ ...resCheckTokenAuth, ...resUserData, authToken: token })); } catch (err) { console.info("User was not connected", err); @@ -123,7 +123,7 @@ export class AuthenticateController extends BaseController { res.writeStatus("200"); this.addCorsHeaders(res); - res.writeHeader('Content-Type', 'application/json'); + res.writeHeader("Content-Type", "application/json"); return res.end(JSON.stringify({ ...data, authToken })); } catch (e) { console.error("openIDCallback => ERROR", e); @@ -186,7 +186,7 @@ export class AuthenticateController extends BaseController { const authToken = jwtTokenManager.createAuthToken(email || userUuid); res.writeStatus("200 OK"); this.addCorsHeaders(res); - res.writeHeader('Content-Type', 'application/json'); + res.writeHeader("Content-Type", "application/json"); res.end( JSON.stringify({ authToken, @@ -226,7 +226,7 @@ export class AuthenticateController extends BaseController { const authToken = jwtTokenManager.createAuthToken(userUuid); res.writeStatus("200 OK"); this.addCorsHeaders(res); - res.writeHeader('Content-Type', 'application/json'); + res.writeHeader("Content-Type", "application/json"); res.end( JSON.stringify({ authToken, diff --git a/pusher/src/Controller/MapController.ts b/pusher/src/Controller/MapController.ts index 9dd2aaf8..eae205f9 100644 --- a/pusher/src/Controller/MapController.ts +++ b/pusher/src/Controller/MapController.ts @@ -47,7 +47,7 @@ export class MapController extends BaseController { if (!match) { res.writeStatus("404 Not Found"); this.addCorsHeaders(res); - res.writeHeader('Content-Type', 'application/json'); + res.writeHeader("Content-Type", "application/json"); res.end(JSON.stringify({})); return; } @@ -56,7 +56,7 @@ export class MapController extends BaseController { res.writeStatus("200 OK"); this.addCorsHeaders(res); - res.writeHeader('Content-Type', 'application/json'); + res.writeHeader("Content-Type", "application/json"); res.end( JSON.stringify({ mapUrl, @@ -108,7 +108,7 @@ export class MapController extends BaseController { res.writeStatus("200 OK"); this.addCorsHeaders(res); - res.writeHeader('Content-Type', 'application/json'); + res.writeHeader("Content-Type", "application/json"); res.end(JSON.stringify(mapDetails)); } catch (e) { this.errorToResponse(e, res); From cdc3d182bc52c33d8fa95282f5d818b70cef75bc Mon Sep 17 00:00:00 2001 From: Lukas Hass Date: Tue, 15 Feb 2022 12:00:32 +0100 Subject: [PATCH 31/31] fix comparison that is always false --- front/src/Phaser/Game/GameScene.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 87ca28af..2fcccf99 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -1405,7 +1405,7 @@ ${escapedMessage} phaserLayer.setCollisionByProperty({ collides: true }, visible); } else { const phaserLayers = this.gameMap.findPhaserLayers(layerName + "/"); - if (phaserLayers === []) { + if (phaserLayers.length === 0) { console.warn( 'Could not find layer with name that contains "' + layerName +