Fix deny proximity meeting

This commit is contained in:
Alexis Faizeau 2022-05-06 15:45:10 +02:00 committed by David Négrier
parent c96c6a357c
commit 1b4582fca0
7 changed files with 17 additions and 10 deletions

View File

@ -96,6 +96,7 @@ export class User implements Movable {
public get silent(): boolean { public get silent(): boolean {
return ( return (
this.availabilityStatus === AvailabilityStatus.DENY_PROXIMITY_MEETING ||
this.availabilityStatus === AvailabilityStatus.SILENT || this.availabilityStatus === AvailabilityStatus.SILENT ||
this.availabilityStatus === AvailabilityStatus.JITSI this.availabilityStatus === AvailabilityStatus.JITSI
); );

View File

@ -12,6 +12,7 @@ export class PlayerStatusDot extends Phaser.GameObjects.Container {
[AvailabilityStatus.ONLINE]: { filling: 0x8cc43f, outline: 0x427a25 }, [AvailabilityStatus.ONLINE]: { filling: 0x8cc43f, outline: 0x427a25 },
[AvailabilityStatus.SILENT]: { filling: 0xe74c3c, outline: 0xc0392b }, [AvailabilityStatus.SILENT]: { filling: 0xe74c3c, outline: 0xc0392b },
[AvailabilityStatus.JITSI]: { filling: 0x8cc43f, outline: 0x427a25 }, [AvailabilityStatus.JITSI]: { filling: 0x8cc43f, outline: 0x427a25 },
[AvailabilityStatus.DENY_PROXIMITY_MEETING]: { filling: 0xffffff, outline: 0x404040 },
[AvailabilityStatus.UNRECOGNIZED]: { filling: 0xffffff, outline: 0xffffff }, [AvailabilityStatus.UNRECOGNIZED]: { filling: 0xffffff, outline: 0xffffff },
[AvailabilityStatus.UNCHANGED]: { filling: 0xffffff, outline: 0xffffff }, [AvailabilityStatus.UNCHANGED]: { filling: 0xffffff, outline: 0xffffff },
}; };

View File

@ -92,7 +92,7 @@ import { MapStore } from "../../Stores/Utils/MapStore";
import { followUsersColorStore } from "../../Stores/FollowStore"; import { followUsersColorStore } from "../../Stores/FollowStore";
import { GameSceneUserInputHandler } from "../UserInput/GameSceneUserInputHandler"; import { GameSceneUserInputHandler } from "../UserInput/GameSceneUserInputHandler";
import LL, { locale } from "../../i18n/i18n-svelte"; import LL, { locale } from "../../i18n/i18n-svelte";
import { availabilityStatusStore, localVolumeStore } from "../../Stores/MediaStore"; import { availabilityStatusStore, denyProximityMeetingStore, localVolumeStore } from "../../Stores/MediaStore";
import { StringUtils } from "../../Utils/StringUtils"; import { StringUtils } from "../../Utils/StringUtils";
import { startLayerNamesStore } from "../../Stores/StartLayerNamesStore"; import { startLayerNamesStore } from "../../Stores/StartLayerNamesStore";
import { JitsiCoWebsite } from "../../WebRtc/CoWebsite/JitsiCoWebsite"; import { JitsiCoWebsite } from "../../WebRtc/CoWebsite/JitsiCoWebsite";
@ -227,7 +227,6 @@ export class GameScene extends DirtyScene {
private jitsiDominantSpeaker: boolean = false; private jitsiDominantSpeaker: boolean = false;
private jitsiParticipantsCount: number = 0; private jitsiParticipantsCount: number = 0;
public readonly superLoad: SuperLoaderPlugin; public readonly superLoad: SuperLoaderPlugin;
private allowProximityMeeting: boolean = true;
constructor(private room: Room, MapUrlFile: string, customKey?: string | undefined) { constructor(private room: Room, MapUrlFile: string, customKey?: string | undefined) {
super({ super({
@ -1118,14 +1117,14 @@ ${escapedMessage}
this.iframeSubscriptionList.push( this.iframeSubscriptionList.push(
iframeListener.disablePlayerProximityMeetingStream.subscribe(() => { iframeListener.disablePlayerProximityMeetingStream.subscribe(() => {
this.allowProximityMeeting = false; denyProximityMeetingStore.set(true);
this.disableMediaBehaviors(); this.disableMediaBehaviors();
}) })
); );
this.iframeSubscriptionList.push( this.iframeSubscriptionList.push(
iframeListener.enablePlayerProximityMeetingStream.subscribe(() => { iframeListener.enablePlayerProximityMeetingStream.subscribe(() => {
this.allowProximityMeeting = true; denyProximityMeetingStore.set(false);
this.enableMediaBehaviors(); this.enableMediaBehaviors();
}) })
); );
@ -2191,7 +2190,7 @@ ${escapedMessage}
} }
public enableMediaBehaviors() { public enableMediaBehaviors() {
if (this.allowProximityMeeting) { if (!get(denyProximityMeetingStore)) {
mediaManager.showMyCamera(); mediaManager.showMyCamera();
} }
} }

View File

@ -26,7 +26,7 @@ export class GameSceneUserInputHandler implements UserInputHandlerInterface {
return; return;
} }
if (!this.gameScene.userInputManager.isControlsEnable()) { if (!this.gameScene.userInputManager.isControlsEnabled) {
return; return;
} }

View File

@ -186,7 +186,7 @@ export class UserInputManager {
this.isInputDisabled = false; this.isInputDisabled = false;
} }
isControlsEnable() { get isControlsEnabled() {
return !this.isInputDisabled; return !this.isInputDisabled;
} }

View File

@ -182,11 +182,13 @@ function createVideoConstraintStore() {
export const inJitsiStore = writable(false); export const inJitsiStore = writable(false);
export const silentStore = writable(false); export const silentStore = writable(false);
export const denyProximityMeetingStore = writable(false);
export const availabilityStatusStore = derived( export const availabilityStatusStore = derived(
[inJitsiStore, silentStore, privacyShutdownStore], [inJitsiStore, silentStore, privacyShutdownStore, denyProximityMeetingStore],
([$inJitsiStore, $silentStore, $privacyShutdownStore]) => { ([$inJitsiStore, $silentStore, $privacyShutdownStore, $denyProximityMeetingStore]) => {
if ($inJitsiStore) return AvailabilityStatus.JITSI; if ($inJitsiStore) return AvailabilityStatus.JITSI;
if ($denyProximityMeetingStore) return AvailabilityStatus.DENY_PROXIMITY_MEETING;
if ($silentStore) return AvailabilityStatus.SILENT; if ($silentStore) return AvailabilityStatus.SILENT;
if ($privacyShutdownStore) return AvailabilityStatus.AWAY; if ($privacyShutdownStore) return AvailabilityStatus.AWAY;
return AvailabilityStatus.ONLINE; return AvailabilityStatus.ONLINE;
@ -320,7 +322,10 @@ export const mediaStreamConstraintsStore = derived(
//currentAudioConstraint = false; //currentAudioConstraint = false;
} }
if ($availabilityStatusStore === AvailabilityStatus.SILENT) { if (
$availabilityStatusStore === AvailabilityStatus.DENY_PROXIMITY_MEETING ||
$availabilityStatusStore === AvailabilityStatus.SILENT
) {
currentVideoConstraint = false; currentVideoConstraint = false;
currentAudioConstraint = false; currentAudioConstraint = false;
} }

View File

@ -10,6 +10,7 @@ enum AvailabilityStatus {
SILENT = 2; SILENT = 2;
AWAY = 3; AWAY = 3;
JITSI = 4; JITSI = 4;
DENY_PROXIMITY_MEETING = 5;
} }
message PositionMessage { message PositionMessage {