活动:节日活动添加每日关卡
This commit is contained in:
@@ -22,6 +22,7 @@ import { Rank } from '../../../services/rankService';
|
||||
import { checkTaskWithWar, checkTaskInBattleEnd, checkActivityTask } from '../../../services/taskService';
|
||||
import { ActivitySelfServiceModel } from '../../../db/ActivitySelfService';
|
||||
import { getSelfServiceShopActivityData } from '../../../services/selfServiceShopActivityService';
|
||||
import { challengeDailyGK } from '../../../services/dailyGKService';
|
||||
|
||||
export default function (app: Application) {
|
||||
return new NormalBattleHandler(app);
|
||||
@@ -119,8 +120,8 @@ export class NormalBattleHandler {
|
||||
}
|
||||
|
||||
// 关卡结算,记录使用的武将,获得奖励
|
||||
async battleEnd(msg: { battleCode: string, battleId: number, isSuccess: boolean, star: number, heroes: Array<any>, }, session: BackendSession) {
|
||||
const { battleCode, battleId, isSuccess, heroes = [], star } = msg;
|
||||
async battleEnd(msg: { battleCode: string, battleId: number, isSuccess: boolean, star: number, heroes: Array<any>, activityId: number }, session: BackendSession) {
|
||||
const { battleCode, battleId, isSuccess, heroes = [], star, activityId } = msg;
|
||||
let roleId = session.get('roleId');
|
||||
let roleName = session.get('roleName');
|
||||
let sid = session.get('sid');
|
||||
@@ -213,6 +214,10 @@ export class NormalBattleHandler {
|
||||
let playerData = await getSelfServiceShopActivityData(serverId, roleId)
|
||||
await ActivitySelfServiceModel.addChallengeRecord(serverId, playerData.activityId, roleId, playerData.roundIndex, 1, new Date())
|
||||
}
|
||||
} else if (warInfo.warType == WAR_TYPE.ACT_DAILY_GK) {
|
||||
if (isSuccess) {
|
||||
await challengeDailyGK(serverId, roleId, activityId, battleId)
|
||||
}
|
||||
}
|
||||
|
||||
if (isSuccess) { // 挑战胜利
|
||||
|
||||
Reference in New Issue
Block a user