Send event and play animation with user frame

This commit is contained in:
gparant 2020-05-06 01:50:01 +02:00
parent b51ce51847
commit 5a6415607d
12 changed files with 128 additions and 84 deletions

View file

@ -7,5 +7,6 @@ export interface ExSocketInterface extends Socket {
webRtcRoomId: string;
userId: string;
name: string;
frame: string;
position: PointInterface;
}

View file

@ -25,6 +25,7 @@ let RefreshUserPositionFunction = function(rooms : ExtRooms, Io: socketIO.Server
roomId: socket.roomId,
position: socket.position,
name: socket.name,
frame: socket.frame,
};
let dataArray = <any>[];
if (mapPositionUserByRoom.get(data.roomId)) {

View file

@ -2,6 +2,7 @@ export class Message {
userId: string;
roomId: string;
name: string;
frame: string;
constructor(data: any) {
if (!data.userId || !data.roomId) {
@ -10,13 +11,15 @@ export class Message {
this.userId = data.userId;
this.roomId = data.roomId;
this.name = data.name;
this.frame = data.frame;
}
toJson() {
return {
userId: this.userId,
roomId: this.roomId,
name: this.name
name: this.name,
frame: this.frame
}
}
}