diff --git a/src/rooms/GeneralRoom.ts b/src/rooms/GeneralRoom.ts index 291c559..e69e0f4 100644 --- a/src/rooms/GeneralRoom.ts +++ b/src/rooms/GeneralRoom.ts @@ -48,6 +48,9 @@ export class GeneralRoom extends Room { this.maxClients = options.clients } this.setState(cs); + if (options.mode) { + this.state.mode = +options.mode; + } this.setPrivate(true); if (options.count) { this.robotCount = Math.min(Math.max(0, options.count), this.maxClients - 1); diff --git a/src/rooms/RankedLobbyRoom.ts b/src/rooms/RankedLobbyRoom.ts index 91488bc..2eb7ba8 100644 --- a/src/rooms/RankedLobbyRoom.ts +++ b/src/rooms/RankedLobbyRoom.ts @@ -360,6 +360,7 @@ export class RankedLobbyRoom extends Room { match: this.matchid, rank: group.averageRank, score: avaScore, + mode: 1, count: this.numClientsToMatch - group.count }) }, 10) diff --git a/src/rooms/schema/CardGameState.ts b/src/rooms/schema/CardGameState.ts index 3b8cc7f..676c044 100644 --- a/src/rooms/schema/CardGameState.ts +++ b/src/rooms/schema/CardGameState.ts @@ -32,6 +32,15 @@ export class CardGameState extends Schema { */ @type("number") round: number; + /** + * 游戏模式 + * 1: 匹配 + * 2: 好友对战 + * 3: 娱乐 + * @type {number} + */ + @type("number") + mode: number; /** * 当局游戏卡组队列 */