gamestate增加mode字段, 用于区分游戏模式

This commit is contained in:
zhl 2021-02-25 19:21:30 +08:00
parent 30f1650a10
commit 9411e3e133
3 changed files with 13 additions and 0 deletions

View File

@ -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);

View File

@ -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)

View File

@ -32,6 +32,15 @@ export class CardGameState extends Schema {
*/
@type("number")
round: number;
/**
*
* 1: 匹配
* 2: 好友对战
* 3: 娱乐
* @type {number}
*/
@type("number")
mode: number;
/**
*
*/