数数:添加首次通关时间

This commit is contained in:
luying
2022-01-07 14:18:29 +08:00
parent 79163dcb98
commit 1439964664
4 changed files with 40 additions and 7 deletions
@@ -4,9 +4,9 @@ import { ExpeditionRecordModel } from '../../../db/ExpeditionRecord';
import { ExpeditionWarRecordModel } from '../../../db/ExpeditionWarRecord';
import { ExpeditionPointModel } from '../../../db/ExpeditionPoint';
import { RoleModel } from '../../../db/Role';
import { calculateSumCE, genCode } from '../../../pubUtils/util';
import { calculateSumCE, genCode, getWarTypeName } from '../../../pubUtils/util';
import { getPointRewardStatus, getResetRemainCnt, findOrCreateEnemies, getExpeditionStatus } from '../../../services/expeditionService';
import { DEBUG_MAGIC_WORD, EXPEDITION_WAR_RECORD_STATUS, ITEM_CHANGE_REASON, KING_EXP_RATIO_TYPE, LINEUP_NUM, TASK_TYPE } from '../../../consts';
import { DEBUG_MAGIC_WORD, EXPEDITION_WAR_RECORD_STATUS, ITEM_CHANGE_REASON, KING_EXP_RATIO_TYPE, LINEUP_NUM, TASK_TYPE, TA_EVENT } from '../../../consts';
import { WarReward } from '../../../services/warRewardService';
import { addItems } from '../../../services/rewardService';
import { getAp, setAp } from '../../../services/actionPointService';
@@ -16,7 +16,8 @@ import { calculateWarStar, checkBattleHeroes, roleLevelup } from '../../../servi
import { checkActivityTask, checkTask, checkTaskInBattleEnd } from '../../../services/taskService';
import { gameData } from '../../../pubUtils/data';
import * as dicParam from '../../../pubUtils/dicParam';
import { getSeconds } from '../../../pubUtils/timeUtil';
import { getSeconds, nowSeconds } from '../../../pubUtils/timeUtil';
import { reportTAEvent } from '../../../services/sdkService';
export default function (app: Application) {
new HandlerService(app, {});
@@ -244,7 +245,9 @@ export class ExpeditionBattleHandler {
if (isSuccess) {
// 更新下一关状态
await ExpeditionWarRecordModel.updateStatus(expeditionCode, expeditionId + 1, EXPEDITION_WAR_RECORD_STATUS.WAITING);
if(!curWarStar) { // 首通
reportTAEvent(roleId, TA_EVENT.GK_FIRST_PASS, { war_id: battleId, war_type: getWarTypeName(warInfo.warType), pass_time: Date.now(), pass_duration: nowSeconds() - getSeconds(createdAt), hero_list: dbHeroes });
}
if (!curWarStar || newStar > curWarStar.star) {
await RoleModel.updateRoleInfo(roleId, { warStar: newWarStars });
}