From 183ec67bcbf97af1d98aad72e8ad79b3398c414b Mon Sep 17 00:00:00 2001 From: liangtongchuan Date: Mon, 25 Jan 2021 12:01:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BB=E5=AE=9D=EF=BC=9A=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=8E=89=E7=BA=BF=E6=97=B6=E6=B8=85=E9=99=A4=20redis=20?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=8C=B9=E9=85=8D=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/servers/connector/handler/entryHandler.ts | 5 +++-- game-server/app/services/comBattleService.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/game-server/app/servers/connector/handler/entryHandler.ts b/game-server/app/servers/connector/handler/entryHandler.ts index f061a9c12..10de6932b 100644 --- a/game-server/app/servers/connector/handler/entryHandler.ts +++ b/game-server/app/servers/connector/handler/entryHandler.ts @@ -7,13 +7,13 @@ import { Application } from 'pinus'; import {FrontendSession} from 'pinus'; import { HeroModel } from './../../../db/Hero'; import { resResult, returnHeroCeRatio, reduceCe } from '../../../pubUtils/util'; -import { FUNC_OPT_TYPE } from '../../../consts'; +import { COM_BTL_QUALITY } from '../../../consts'; import { getAp } from '../../../services/actionPointService'; import { ItemModel } from '../../../db/Item'; import { chackFunOpenWhenLogin } from '../../../services/funcSwitchService'; import { loginRefresh } from '../../../services/playerEventService'; -import { getRedis, setRedis, delRedis } from '../../../services/redisService'; import { nowSeconds } from '../../../pubUtils/timeUtil'; +import { getRedis, setRedis, delRedis, rmRoleFromQueue } from '../../../services/redisService'; export default function (app: Application) { return new EntryHandler(app); } @@ -117,6 +117,7 @@ export class EntryHandler { let serverId = session.get('serverId'); let key = 'login_roleId_' + roleId; delRedis(key); + rmRoleFromQueue(roleId, sid, COM_BTL_QUALITY, null); // 删除redis中寻宝的匹配记录 let channelService = this.app.get('channelService'); let channel = channelService.getChannel(roleId, true); channel.leave(roleId, sid); diff --git a/game-server/app/services/comBattleService.ts b/game-server/app/services/comBattleService.ts index 0725f77c0..accf6bfad 100644 --- a/game-server/app/services/comBattleService.ts +++ b/game-server/app/services/comBattleService.ts @@ -288,7 +288,7 @@ export function updateRobotHurtByTime(teamStatus, roleSt: RoleStatus, interval: const timerKey = `${teamStatus.teamCode}_${roleSt.roleId}`; const robotTimer = setInterval(() => { const robotTotalHurt = teamStatus.bossHp * COM_BTL_CONST.ROBOT_HURT_RATIO; - if (roleSt.totalDmg < robotTotalHurt && teamStatus.bossCurHp > 0) { + if (roleSt.totalDmg < robotTotalHurt && teamStatus.bossCurHp > 0 && teamMap.has(teamStatus.teamCode)) { updateRobotHurt(teamStatus, roleSt, channel); handleComBtlProgress(teamStatus, sid, robotHurtTimer, teamMap, channel); } else {