|
@@ -326,6 +326,7 @@ export class RoomAssistant {
|
|
|
} else {
|
|
|
const hasRoom = await this.redis.hVals(getInKey(roomId));
|
|
|
if (hasRoom.length === 0) {
|
|
|
+ this.illegalMaster = false;
|
|
|
this.room.logger.info("房主主动创建房间 :", { roomId, userId });
|
|
|
await this.buildRoom(roomId, userId, user);
|
|
|
} else {
|
|
@@ -333,12 +334,15 @@ export class RoomAssistant {
|
|
|
const checkIsRoomMaster = await isRoomMaster(roomId, userId);
|
|
|
console.log("isRoomMaster", checkIsRoomMaster);
|
|
|
if (checkIsRoomMaster) {
|
|
|
+ this.illegalMaster = false;
|
|
|
this.room.logger.info("房主已存在房间 :", { roomId, userId, from: user.from });
|
|
|
await this.joinRoom(roomId, userId, user);
|
|
|
+
|
|
|
// this.notifyUserJitter(roomId);
|
|
|
} else {
|
|
|
this.room.logger.error("存在非法房主", roomId, userId);
|
|
|
await removeRoomUser(roomId, userId);
|
|
|
+ this.illegalMaster = true;
|
|
|
this.socket.broadcast.to(this.room.syncId).emit(EVENT.unKnowError);
|
|
|
}
|
|
|
}
|