|
@@ -36,6 +36,7 @@ export class RoomController extends BasicController {
|
|
await this.init();
|
|
await this.init();
|
|
this.initBaseAction();
|
|
this.initBaseAction();
|
|
this.roomMasterAutoRejoin();
|
|
this.roomMasterAutoRejoin();
|
|
|
|
+ this.roomAssistant.watchRoomExpired();
|
|
} catch (error) {
|
|
} catch (error) {
|
|
this.logger.error("roomController::run::error", error);
|
|
this.logger.error("roomController::run::error", error);
|
|
}
|
|
}
|
|
@@ -81,7 +82,7 @@ export class RoomController extends BasicController {
|
|
this.roomId = `room-${uRoomId}_${oneSceneNum}_web`;
|
|
this.roomId = `room-${uRoomId}_${oneSceneNum}_web`;
|
|
this.user.roomId = uRoomId;
|
|
this.user.roomId = uRoomId;
|
|
this.roomConfigId = `config-${this.roomId}`;
|
|
this.roomConfigId = `config-${this.roomId}`;
|
|
- return Promise.resolve(true)
|
|
|
|
|
|
+ return Promise.resolve(true);
|
|
}
|
|
}
|
|
|
|
|
|
initBaseAction() {
|
|
initBaseAction() {
|
|
@@ -167,17 +168,16 @@ export class RoomController extends BasicController {
|
|
const sessionExist = await this.redisCli.exists(this.sessionId);
|
|
const sessionExist = await this.redisCli.exists(this.sessionId);
|
|
const roomConfig = await getRoomConfig(this.roomId);
|
|
const roomConfig = await getRoomConfig(this.roomId);
|
|
if (sessionExist > 0 && roomConfig.isStart && roomConfig.isStart === "true") {
|
|
if (sessionExist > 0 && roomConfig.isStart && roomConfig.isStart === "true") {
|
|
-
|
|
|
|
const AllRoomUsers = await getAllRoomUsers(this.roomId);
|
|
const AllRoomUsers = await getAllRoomUsers(this.roomId);
|
|
// 房主
|
|
// 房主
|
|
if (this.isHoster(this.user.role)) {
|
|
if (this.isHoster(this.user.role)) {
|
|
console.log("自动接连", this.roomId);
|
|
console.log("自动接连", this.roomId);
|
|
this.socket.join(this.roomId);
|
|
this.socket.join(this.roomId);
|
|
-
|
|
|
|
|
|
+
|
|
this.socket.emit("autoReJoin", {
|
|
this.socket.emit("autoReJoin", {
|
|
user: this.user,
|
|
user: this.user,
|
|
roomsPerson: AllRoomUsers,
|
|
roomsPerson: AllRoomUsers,
|
|
- roomId:this.user.roomId
|
|
|
|
|
|
+ roomId: this.user.roomId,
|
|
});
|
|
});
|
|
}
|
|
}
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|