任务:埋点完成
This commit is contained in:
@@ -7,7 +7,7 @@ import { TaskParam } from '../domain/roleField/task';
|
||||
import { HeroType } from '../db/Hero';
|
||||
import { EquipType } from '../db/Equip';
|
||||
import { getRoleOnlineInfo } from './redisService';
|
||||
import { TASK } from '../pubUtils/dicParam';
|
||||
import { HeroScores } from '../db/PvpHistoryOpp';
|
||||
|
||||
export async function checkTaskWithRoles(roleId: string, sid: string, taskType: number, roles: RoleType[]) {
|
||||
for(let role of roles) {
|
||||
@@ -69,5 +69,30 @@ export async function checkTaskInBattleEnd(roleId: string, sid: string, battleId
|
||||
await checkTaskWithWar(roleId, sid, TASK_TYPE.BATTLE_DUNGEON_WAR, battleId, heroes, 1, star);
|
||||
await checkTaskWithWar(roleId, sid, TASK_TYPE.BATTLE_TOWER, battleId, heroes, 1, star);
|
||||
await checkTaskWithWar(roleId, sid, TASK_TYPE.BATTLE_VESTIGE, battleId, heroes, 1, star);
|
||||
await checkTaskWithWar(roleId, sid, TASK_TYPE.BATTLE_EXPEDITION, battleId, heroes, 1, star);
|
||||
|
||||
}
|
||||
|
||||
export async function checkTaskInComBattleEnd(roleIds: string[], capId: string, quality: number) {
|
||||
for(let roleId of roleIds) {
|
||||
if(roleId == capId && roleIds.length > 1) { // 招募队友
|
||||
await checkTask(roleId, null, TASK_TYPE.COM_BATTLE_CREATE_TEAM, 1, true, {});
|
||||
} else if (roleId !== capId) { // 协助寻宝
|
||||
await checkTask(roleId, null, TASK_TYPE.COM_BATTLE_ASSIST_TEAM, 1, true, {});
|
||||
}
|
||||
await checkTask(roleId, null, TASK_TYPE.COM_BATTLE, 1, true, {});
|
||||
await checkTask(roleId, null, TASK_TYPE.COM_BATTLE_QUALITY, 1, true, { quality });
|
||||
}
|
||||
}
|
||||
|
||||
export async function checkTaskInPvpEnd(roleId: string, sid: string, isSuccess: boolean, heroScores: HeroScores[]) {
|
||||
await checkTask(roleId, sid, TASK_TYPE.PVP, 1, true, {});
|
||||
if(isSuccess) {
|
||||
await checkTask(roleId, sid, TASK_TYPE.PVP_WIN, 1, true, {});
|
||||
await checkTask(roleId, sid, TASK_TYPE.PVP_WIN_SERIES, 1, true, {});
|
||||
} else {
|
||||
await checkTask(roleId, sid, TASK_TYPE.PVP_WIN_SERIES, 0, false, {});
|
||||
}
|
||||
|
||||
await checkTask(roleId, sid, TASK_TYPE.PVP, 0, false, { heroScores });
|
||||
}
|
||||
Reference in New Issue
Block a user