{name: string,
creatorId:
number,
typeRoom: string,
password: string,
avatar: string}
idRoom
{id: number}
{userId: string,
roomId: number}
participantId
{id: number}
room_id: number
socket.join subscribe the socket to a given roomId
ParticipantDto
{userId: string,
roomId: number}
msgToClient
type: newUser_In_Room_Message
{blockList : number[],
message_history: Message[]}
message: MessageDto
MsgToClient:
message[0].contentToSend
{userId: number,
roomId: number,
entered_pw: string
}
hasJoined
boolean to tell FRONT successfully joined or not with password
a new user use password to join a room already existed, BACK compare his password with the one in db
userId: number
UNDEFINED
RoomSnippetDto contain
{
room_id : number,
room_name : string
}
from a userId, we will get all the room he joined et name
room_id: number
UNDEFINED
Participant[]
when the user is in a room, FRONT show all participant in the same room
BE CAREFUUL: FRONT fileter participant in block list
room_id: number
NO NEED
when a user join a room, socket.io will manager the join of the room
{userId: number,
roomId: number,
password: string};
UpdatePwRes
boolean
{userId: number,
roomId: number
}
deletePWRes
boolean
{userId:number,
roomId: number,
toAdd: boolean};
UNDEFINED
void
toADD is to declare it is to add the administrator or to remove the admin.
if the admin is not in the list owner[] and toAdd is true, so add into db;
if the admin is already inside of list and toadd is false, so remove it from db
{
userId: number,
blockUserId:number}
UNDEFINED
void
ParticipantDto
void
in the case of a user leave the room, BACK: remove the item of this participant from the participant table
also if the participant is the owner of the room, remove his userId from the owner array in the table of room
JoinRoomDto
{
roomName: string,
userId: number
}
hasJoined
boolean
Ban user at a room, he/she can anymore see the message caming into that room
muteUser (front to back) {
userId: number,
userIdToMute: string,
roomId: number,
time: number
}
back-end send all room informations inside a array object
##request data
[
{
name: string,
id: number,
typeRoom: string,
password: string,
owner: number[],
participants: user
[
{
id: number,
roomId: number,
userId: 1
}
...
],
avatar: string,
};
]
the message send to a room:
it go first to the back-end, then back-end relay it to the room destinate
user send message to user/room, it go through the back-end then the back broadcast that message to the room.
##request data
{
userId: number,
contentToSend: string,
channelIdDst: string,
sender: string,
}
MsgtoChat
{
content: string;
id: number;
roomId: number;
sender: string;
userId: number;
};
font-send send it when user click on one of item (user/room) on the left bar chat
the data send back from the back-end it is a array contain all the message history
request data
{
userId: number;
roomId: number;
};
msgToClient
[
{
content: string;
id: number;
roomId: number;
sender: string;
userId: number;
}
]
A admin add another admin into a room
request data
{
userId: number,
roomId: number,
login: string,
state: boolean,
};
void
front-end send to back-end the room to delete password
request data
{
userId: number,
roomId: number,
};
void
this event it send when you send a invitation to play pong
request data
{
userId: number,
difficulty: string,
maxScore:number
};
printInvitation
request data
{
userName: string,
roomId: number,
};