From 5f37ab604ee217ba433909f69291bade4a78e603 Mon Sep 17 00:00:00 2001 From: zhl Date: Mon, 14 Dec 2020 20:54:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=87=8D=E7=BD=AE=E6=B8=B8?= =?UTF-8?q?=E6=88=8F=E7=8A=B6=E6=80=81=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/commands/GameResultCommand.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rooms/commands/GameResultCommand.ts b/src/rooms/commands/GameResultCommand.ts index 7abbef1..0289ff4 100644 --- a/src/rooms/commands/GameResultCommand.ts +++ b/src/rooms/commands/GameResultCommand.ts @@ -7,6 +7,8 @@ import {singleton} from "../../common/Singleton"; import {GameEnv} from "../../cfg/GameEnv"; import {debugRoom, error} from "../../common/Debug"; import gameUtil from "../../utils/game.util"; +import {Card} from "../schema/Card"; +import {MapSchema, SetSchema} from "@colyseus/schema"; /** * 游戏结束 @@ -108,10 +110,13 @@ export class GameResultCommand extends Command { this.state.round = 0; this.state.cardQueue.length = 0; this.state.cards.clear(); + this.state.cards = new MapSchema(); for (let [,player] of this.state.players) { player.cards.clear(); + player.cards = new MapSchema() player.cardSet.clear(); + player.cardSet = new SetSchema(); player.countTotal = 0; player.countPresent = 0; for(let [,pet] of player.pets) {