workadventure/back/src/Model/Websocket/Message.ts
gparant 53e1600e67 Add authenticate
- Create new controller authenticate with login root..
 - Update and manage error message socket io.
 - Create enum for environment variables
2020-04-04 17:22:02 +02:00

20 lines
444 B
TypeScript

export class Message {
userId: string;
roomId: string;
constructor(message: string) {
let data = JSON.parse(message);
if(!data.userId || !data.roomId){
throw Error("userId and roomId cannot be null");
}
this.userId = data.userId;
this.roomId = data.roomId;
}
toJson() {
return {
userId: this.userId,
roomId: this.roomId,
}
}
}