Confirms the exit of a member from a room and optionally bans them.
This method emits a socket event to disconnect the specified member from the given room.
If the ban option is set to true, the member will be banned from rejoining the room.
Param: options
The options for confirming the exit.
Param: options.socket
The socket instance to emit the event.
Param: options.localSocket
The local socket instance to emit the event.
Param: options.member
The member who is exiting.
Param: options.roomName
The name of the room the member is exiting from.
Param: options.ban
Whether to ban the member from the room.
Returns
A promise that resolves when the exit is confirmed.
Example
constconfirmExitService = newConfirmExit(); awaitconfirmExitService.confirmExit({ socket:socketInstance, localSocket:localSocketInstance, member:'JohnDoe', roomName:'Room1', ban:true, // Optional: set to true if you want to ban the member });
Confirms the exit of a member from a room and optionally bans them.
This method emits a socket event to disconnect the specified member from the given room. If the
ban
option is set to true, the member will be banned from rejoining the room.Param: options
The options for confirming the exit.
Param: options.socket
The socket instance to emit the event.
Param: options.localSocket
The local socket instance to emit the event.
Param: options.member
The member who is exiting.
Param: options.roomName
The name of the room the member is exiting from.
Param: options.ban
Whether to ban the member from the room.
Returns
A promise that resolves when the exit is confirmed.
Example