Create backend
- NodeJs - Express - Socket.io - Eslint - TypeScript
This commit is contained in:
parent
c0e75ae07e
commit
ba335aa33d
10 changed files with 2277 additions and 0 deletions
23
back/src/Model/Websocket/JoinRoomMessage.ts
Normal file
23
back/src/Model/Websocket/JoinRoomMessage.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
export class JoinRoomMessage {
|
||||
userId: string;
|
||||
roomId: string;
|
||||
positionXUser: string;
|
||||
positionYUser: string;
|
||||
|
||||
constructor(message: string) {
|
||||
let data = JSON.parse(message);
|
||||
this.userId = data.userId;
|
||||
this.roomId = data.roomId;
|
||||
this.positionXUser = data.positionXUser;
|
||||
this.positionYUser = data.positionYUser;
|
||||
}
|
||||
|
||||
toString(){
|
||||
return JSON.stringify({
|
||||
userId: this.userId,
|
||||
roomId: this.roomId,
|
||||
positionXUser: this.positionXUser,
|
||||
positionYUser: this.positionYUser
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue