From 9a9b144580c08440c47361bef806c974bcf0fdc2 Mon Sep 17 00:00:00 2001 From: yuexin Date: Mon, 4 Jan 2021 15:47:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E8=AE=A2=E6=97=B6=E9=97=B4=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/logic/Handler/BattleHandler.ts | 33 ++++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/rooms/logic/Handler/BattleHandler.ts b/src/rooms/logic/Handler/BattleHandler.ts index d3ac938..6e35d39 100644 --- a/src/rooms/logic/Handler/BattleHandler.ts +++ b/src/rooms/logic/Handler/BattleHandler.ts @@ -12,7 +12,7 @@ import { PetHandler } from "./PetHandler"; import { SKillEffectData, SkillInfoMsg } from "message/SkillInfo"; import { PetInfo } from "message/PetInfo"; import arrUtil from "../../../utils/array.util"; -import { debugRoom } from "common/Debug"; +import { debugRoom } from "../../../common/Debug"; export class BattleHandler { @@ -419,23 +419,30 @@ export class BattleHandler { } this._flowcount++; + + debugRoom(`[beginFlow]${step}|${this._flowcount}`); }; public endFlow(step: string){ - this._flowcount--; - if(this._flowcount < 0){ + let res = this._flowcount - 1; + if(res < 0){ debugRoom(`[endFlow]${step}[error flowcount]${this._flowcount}`); - this._flowcount = 0; + res = 0; } - if(this._flowcount == 0){ + + debugRoom(`[endFlow]${step}|${res}`); + + if(res == 0){ if(this._cacheSkills.length > 0){ this.onSkillResultNotify(this._cacheSkills); this._cacheSkills.length = 0; } this.checkPets(); + this._flowcount = res; return this._sktime * 1000; } + this._flowcount = res; return 0; }; //--------------------对外接口(外部调用)---------------------------- @@ -537,11 +544,13 @@ export class BattleHandler { return 0; } - this.beginFlow('onCardLinkReady'); + // this.beginFlow('onCardLinkReady'); ph.onCardLinkReady(fromph); - return this.endFlow('onCardLinkReady'); + // return this.endFlow('onCardLinkReady'); + + return 0; }; /** @@ -604,11 +613,12 @@ export class BattleHandler { if(!ph){ return 0; } - this.beginFlow('onCardDroped'); + // this.beginFlow('onCardDroped'); ph.onCardDroped(dropcards, fromph); - return this.endFlow('onCardDroped'); + // return this.endFlow('onCardDroped'); + return 0; }; /** @@ -626,11 +636,12 @@ export class BattleHandler { if(!ph){ return 0; } - this.beginFlow('onCardGetted'); + // this.beginFlow('onCardGetted'); ph.onCardGetted(getcards, fromph); - return this.endFlow('onCardGetted'); + // return this.endFlow('onCardGetted'); + return 0; }; /**