|
@@ -16,14 +16,28 @@ export class RoomAssistant {
|
|
this.room = room;
|
|
this.room = room;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 准备房间
|
|
|
|
+ * @param {*} roomSessionId
|
|
|
|
+ * @param {*} roomId
|
|
|
|
+ * @returns
|
|
|
|
+ */
|
|
async prepearRoom(roomSessionId, roomId) {
|
|
async prepearRoom(roomSessionId, roomId) {
|
|
- const uRoomId = await this.redis.get(getInKey(roomSessionId));
|
|
|
|
- const mergeRoomId = uRoomId || roomId;
|
|
|
|
- this.roomId = mergeRoomId;
|
|
|
|
- this.room.logger.info("prepearRoom", roomSessionId, this.roomId);
|
|
|
|
- await this.redis.set(getInKey(roomSessionId), mergeRoomId);
|
|
|
|
- return Promise.resolve(this.roomId);
|
|
|
|
|
|
+ // const uRoomId = await this.redis.get(getInKey(roomSessionId));
|
|
|
|
+ // const mergeRoomId = uRoomId || roomId;
|
|
|
|
+ // this.roomId = mergeRoomId;
|
|
|
|
+ this.room.logger.info("prepearRoom", roomSessionId, roomId);
|
|
|
|
+ await this.redis.set(getInKey(roomSessionId), roomId);
|
|
|
|
+ return Promise.resolve(roomId);
|
|
}
|
|
}
|
|
|
|
+ // async prepearRoom(roomSessionId, roomId) {
|
|
|
|
+ // const uRoomId = await this.redis.get(getInKey(roomSessionId));
|
|
|
|
+ // const mergeRoomId = uRoomId || roomId;
|
|
|
|
+ // this.roomId = mergeRoomId;
|
|
|
|
+ // this.room.logger.info("prepearRoom", roomSessionId, this.roomId);
|
|
|
|
+ // await this.redis.set(getInKey(roomSessionId), mergeRoomId);
|
|
|
|
+ // return Promise.resolve(this.roomId);
|
|
|
|
+ // }
|
|
|
|
|
|
async destoryRoom(roomSessionId, roomConfigId) {
|
|
async destoryRoom(roomSessionId, roomConfigId) {
|
|
this.room.logger.info("destoryRoom", roomSessionId, roomConfigId);
|
|
this.room.logger.info("destoryRoom", roomSessionId, roomConfigId);
|