聊天室信息发送

This commit is contained in:
chanbook 2022-08-08 16:51:31 +08:00
parent d6b62f282b
commit 082aedafdf
1 changed files with 4 additions and 4 deletions

View File

@ -39,10 +39,10 @@ public class ChatRoom {
*/
@OnOpen
public void onOpen(Session session, @PathParam("roomId") String roomId) {
// if (getRoomCache().createSuccess(roomId)) {
// this.sendMessage("无此房间,拒绝连接", session);
// return;
// }
if (getRoomCache().createSuccess(roomId)) {
this.sendMessage("无此房间,拒绝连接", session);
return;
}
Principal userPrincipal = session.getUserPrincipal();
if (Objects.isNull(userPrincipal)) {
this.sendMessage("用户验证失败,拒绝连接", session);