From 26f21fe6e4d556bf43db08ce918a019a8f94af49 Mon Sep 17 00:00:00 2001 From: kharhamel Date: Mon, 7 Jun 2021 15:01:21 +0200 Subject: [PATCH] FIX: the visit card feature can now be disabled client side --- front/src/Enum/EnvironmentVariable.ts | 1 + front/src/Phaser/Entity/RemotePlayer.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/front/src/Enum/EnvironmentVariable.ts b/front/src/Enum/EnvironmentVariable.ts index 73f6427c..89562456 100644 --- a/front/src/Enum/EnvironmentVariable.ts +++ b/front/src/Enum/EnvironmentVariable.ts @@ -10,6 +10,7 @@ const TURN_USER: string = process.env.TURN_USER || ''; const TURN_PASSWORD: string = process.env.TURN_PASSWORD || ''; const JITSI_URL : string|undefined = (process.env.JITSI_URL === '') ? undefined : process.env.JITSI_URL; const JITSI_PRIVATE_MODE : boolean = process.env.JITSI_PRIVATE_MODE == "true"; +export const DISABLE_VISIT_CARD_FEATURE : boolean = process.env.DISABLE_VISIT_CARD_FEATURE == "true"; const POSITION_DELAY = 200; // Wait 200ms between sending position events const MAX_EXTRAPOLATION_TIME = 100; // Extrapolate a maximum of 250ms if no new movement is sent by the player export const MAX_USERNAME_LENGTH = parseInt(process.env.MAX_USERNAME_LENGTH || '') || 8; diff --git a/front/src/Phaser/Entity/RemotePlayer.ts b/front/src/Phaser/Entity/RemotePlayer.ts index c2384357..1ebf72af 100644 --- a/front/src/Phaser/Entity/RemotePlayer.ts +++ b/front/src/Phaser/Entity/RemotePlayer.ts @@ -2,6 +2,7 @@ import type {GameScene} from "../Game/GameScene"; import type {PointInterface} from "../../Connexion/ConnexionModels"; import {Character} from "../Entity/Character"; import type {PlayerAnimationDirections} from "../Player/Animation"; +import {DISABLE_VISIT_CARD_FEATURE} from "../../Enum/EnvironmentVariable"; export const playerClickedEvent = 'playerClickedEvent'; @@ -46,6 +47,6 @@ export class RemotePlayer extends Character { } isClickable(): boolean { - return true; //todo: make remote players clickable if they are logged in. + return !DISABLE_VISIT_CARD_FEATURE; //todo: make remote players clickable if they are logged in. } }