Availability indicator (#2044)
* status indicators changing properly * away status wip * updating away status on connection * remove obsolete logs * fix typecheck * minor adjustments * darker outline * Trying darker outline * Apply suggestions from code review * Update pusher/src/Model/Zone.ts * Making the dot smaller * Marking onleavezone as deprecated Co-authored-by: Piotr 'pwh' Hanusiak <p.hanusiak@workadventu.re> Co-authored-by: David Négrier <d.negrier@thecodingmachine.com>
This commit is contained in:
@@ -14,6 +14,7 @@ export interface MessageUserPositionInterface {
|
||||
name: string;
|
||||
characterLayers: BodyResourceDescriptionInterface[];
|
||||
position: PointInterface;
|
||||
away: boolean;
|
||||
visitCardUrl: string | null;
|
||||
companion: string | null;
|
||||
userUuid: string;
|
||||
@@ -29,6 +30,7 @@ export interface MessageUserJoined {
|
||||
name: string;
|
||||
characterLayers: BodyResourceDescriptionInterface[];
|
||||
position: PointInterface;
|
||||
away: boolean;
|
||||
visitCardUrl: string | null;
|
||||
companion: string | null;
|
||||
userUuid: string;
|
||||
|
||||
@@ -518,6 +518,20 @@ export class RoomConnection implements RoomConnection {
|
||||
this.socket.send(bytes);
|
||||
}
|
||||
|
||||
public emitPlayerAway(away: boolean): void {
|
||||
const message = SetPlayerDetailsMessageTsProto.fromPartial({
|
||||
away,
|
||||
});
|
||||
const bytes = ClientToServerMessageTsProto.encode({
|
||||
message: {
|
||||
$case: "setPlayerDetailsMessage",
|
||||
setPlayerDetailsMessage: message,
|
||||
},
|
||||
}).finish();
|
||||
|
||||
this.socket.send(bytes);
|
||||
}
|
||||
|
||||
public emitPlayerOutlineColor(color: number | null) {
|
||||
let message: SetPlayerDetailsMessageTsProto;
|
||||
if (color === null) {
|
||||
@@ -654,6 +668,7 @@ export class RoomConnection implements RoomConnection {
|
||||
characterLayers,
|
||||
visitCardUrl: message.visitCardUrl,
|
||||
position: ProtobufClientUtils.toPointInterface(position),
|
||||
away: message.away,
|
||||
companion: companion ? companion.name : null,
|
||||
userUuid: message.userUuid,
|
||||
outlineColor: message.hasOutline ? message.outlineColor : undefined,
|
||||
|
||||
Reference in New Issue
Block a user