removed silent message

This commit is contained in:
Piotr 'pwh' Hanusiak
2022-04-14 11:41:01 +02:00
parent 8f0b02a9c8
commit 99854e2d62
12 changed files with 15 additions and 65 deletions
-13
View File
@@ -615,19 +615,6 @@ export class RoomConnection implements RoomConnection {
this.socket.send(bytes);
}
public setSilent(silent: boolean): void {
const bytes = ClientToServerMessageTsProto.encode({
message: {
$case: "silentMessage",
silentMessage: {
silent,
},
},
}).finish();
this.socket.send(bytes);
}
public setViewport(viewport: ViewportInterface): void {
const bytes = ClientToServerMessageTsProto.encode({
message: {
@@ -73,7 +73,7 @@ export class PlayerStatusDot extends Phaser.GameObjects.Container {
return { filling: this.COLORS.online, outline: this.COLORS.onlineOutline };
case AvailabilityStatus.AWAY:
return { filling: this.COLORS.away, outline: this.COLORS.awayOutline };
case AvailabilityStatus.SILENCED:
case AvailabilityStatus.SILENT:
return { filling: this.COLORS.silenced, outline: this.COLORS.silencedOutline };
default:
return { filling: this.COLORS.never, outline: this.COLORS.never };
+3 -2
View File
@@ -19,7 +19,8 @@ import type { OutlineableInterface } from "../Game/OutlineableInterface";
import type CancelablePromise from "cancelable-promise";
import { TalkIcon } from "../Components/TalkIcon";
import { Deferred } from "ts-deferred";
import { PlayerStatus, PlayerStatusDot } from "../Components/PlayerStatusDot";
import { PlayerStatusDot } from "../Components/PlayerStatusDot";
import { AvailabilityStatus } from "../../Messages/ts-proto-generated/protos/messages";
const playerNameY = -25;
const interactiveRadius = 35;
@@ -236,7 +237,7 @@ export abstract class Character extends Container implements OutlineableInterfac
this.talkIcon.show(show, forceClose);
}
public setStatus(status: PlayerStatus, instant: boolean = false): void {
public setStatus(status: AvailabilityStatus, instant: boolean = false): void {
this.statusDot.setStatus(status, instant);
}
@@ -144,10 +144,10 @@ export class GameMapPropertiesListener {
this.gameMap.onPropertyChange(GameMapProperties.SILENT, (newValue) => {
if (newValue === undefined || newValue === false || newValue === "") {
this.scene.connection?.setSilent(false);
// this.scene.connection?.setSilent(false);
this.scene.CurrentPlayer.noSilent();
} else {
this.scene.connection?.setSilent(true);
// this.scene.connection?.setSilent(true);
this.scene.CurrentPlayer.isSilent();
}
});
+4 -4
View File
@@ -709,7 +709,7 @@ export class GameScene extends DirtyScene {
});
this.privacyShutdownStoreUnsubscribe = privacyShutdownStore.subscribe((away) => {
// TODO: Might be a problem with SILENCED here
// TODO: Might be a problem with SILENT here
this.connection?.emitPlayerStatusChange(away ? AvailabilityStatus.AWAY : AvailabilityStatus.ONLINE);
});
@@ -2153,13 +2153,13 @@ ${escapedMessage}
}
public enableMediaBehaviors() {
const silent = this.gameMap.getCurrentProperties().get(GameMapProperties.SILENT);
this.connection?.setSilent(!!silent);
// const silent = this.gameMap.getCurrentProperties().get(GameMapProperties.SILENT);
// this.connection?.setSilent(!!silent);
mediaManager.showMyCamera();
}
public disableMediaBehaviors() {
this.connection?.setSilent(true);
// this.connection?.setSilent(true);
mediaManager.hideMyCamera();
}