任务:埋点48/71
This commit is contained in:
@@ -2,11 +2,12 @@ import * as taskUtil from '../pubUtils/taskUtil';
|
||||
import { RoleType } from '../db/Role';
|
||||
import { pinus } from 'pinus';
|
||||
import { resResult } from '../pubUtils/util';
|
||||
import { STATUS } from '../consts';
|
||||
import { STATUS, TASK_TYPE } from '../consts';
|
||||
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';
|
||||
|
||||
export async function checkTaskWithRoles(roleId: string, sid: string, taskType: number, roles: RoleType[]) {
|
||||
for(let role of roles) {
|
||||
@@ -34,6 +35,11 @@ export async function checkTaskWithArgs(roleId: string, sid: string, taskType: n
|
||||
pushTaskUpdate(roleId, sid, pushMessage);
|
||||
}
|
||||
|
||||
export async function checkTaskWithWar(roleId: string, sid: string, taskType: number, warId: number, heroes: number[], count: number, star: number) {
|
||||
let pushMessage = await taskUtil.checkTaskWithWar(roleId, taskType, warId, heroes, count, star);
|
||||
pushTaskUpdate(roleId, sid, pushMessage);
|
||||
}
|
||||
|
||||
export async function checkTask(roleId: string, sid: string, taskType: number, count: number, isInc: boolean, param: TaskParam) {
|
||||
let pushMessage = await taskUtil.checkTask(roleId, taskType, count, isInc, param);
|
||||
pushTaskUpdate(roleId, sid, pushMessage);
|
||||
@@ -48,4 +54,20 @@ export async function pushTaskUpdate(roleId: string, sid: string, pushMessage: {
|
||||
let uids = [{uid: roleId, sid}];
|
||||
pinus.app.get('channelService').pushMessageByUids('onTaskUpdate', resResult(STATUS.SUCCESS, pushMessage), uids);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* battle.normalBattleHandler.battleEnd 中会触发的任务,因为有点多提出来了
|
||||
*/
|
||||
export async function checkTaskInBattleEnd(roleId: string, sid: string, battleId: number, heroes: number[], star: number) {
|
||||
|
||||
await checkTaskWithWar(roleId, sid, TASK_TYPE.BATTLE_WITH_HERO, battleId, heroes, 1, star);
|
||||
await checkTaskWithWar(roleId, sid, TASK_TYPE.BATTLE_MAIN, battleId, heroes, 1, star);
|
||||
await checkTaskWithWar(roleId, sid, TASK_TYPE.BATTLE_DAILY_STAR, battleId, heroes, 1, star);
|
||||
await checkTaskWithWar(roleId, sid, TASK_TYPE.BATTLE_DAILY, battleId, heroes, 1, star);
|
||||
await checkTaskWithWar(roleId, sid, TASK_TYPE.BATTLE_DUNGEON, battleId, heroes, 1, star);
|
||||
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);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user