活动:任务接口添加serverId接口
This commit is contained in:
@@ -16,16 +16,16 @@ import { gameData, getGoodById } from '../pubUtils/data';
|
||||
import { getSeconds, getZeroPointD } from '../pubUtils/timeUtil';
|
||||
import { RoleStatus } from '../db/ComBattleTeam';
|
||||
|
||||
export async function checkTaskWithRoles(roleId: string, sid: string, funcs: number[], taskType: number, roles: RoleType[]) {
|
||||
export async function checkTaskWithRoles(serverId: number, roleId: string, sid: string, funcs: number[], taskType: number, roles: RoleType[]) {
|
||||
for (let role of roles) {
|
||||
if (role) {
|
||||
await checkTaskWithRole(role.roleId, role.roleId == roleId ? sid : null, role.roleId == roleId ? funcs : null, taskType, role);
|
||||
await checkTaskWithRole(serverId, role.roleId, role.roleId == roleId ? sid : null, role.roleId == roleId ? funcs : null, taskType, role);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function checkTaskWithRole(roleId: string, sid: string, funcs: number[], taskType: number, role: RoleType) {
|
||||
let pushMessage = await taskUtil.checkTaskWithRole(roleId, taskType, role, funcs);
|
||||
export async function checkTaskWithRole(serverId: number, roleId: string, sid: string, funcs: number[], taskType: number, role: RoleType) {
|
||||
let pushMessage = await taskUtil.checkTaskWithRole(serverId, roleId, taskType, role, funcs);
|
||||
pushTaskUpdate(roleId, sid, funcs, pushMessage);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ export async function pushTaskUpdate(roleId: string, sid: string, funcs: number[
|
||||
/**
|
||||
* battle.normalBattleHandler.battleEnd 中会触发的任务,因为有点多提出来了
|
||||
*/
|
||||
export async function checkTaskInBattleEnd(roleId: string, sid: string, funcs: number[], battleId: number, heroes: number[], star: number) {
|
||||
export async function checkTaskInBattleEnd(serverId: number, roleId: string, sid: string, funcs: number[], battleId: number, heroes: number[], star: number) {
|
||||
|
||||
await checkTaskWithWar(roleId, sid, funcs, TASK_TYPE.BATTLE_WITH_HERO, battleId, heroes, 1, star);
|
||||
await checkTaskWithWar(roleId, sid, funcs, TASK_TYPE.BATTLE_MAIN, battleId, heroes, 1, star);
|
||||
@@ -88,7 +88,7 @@ export async function checkTaskInBattleEnd(roleId: string, sid: string, funcs: n
|
||||
await checkTaskWithWar(roleId, sid, funcs, TASK_TYPE.BATTLE_VESTIGE, battleId, heroes, 1, star);
|
||||
await checkTaskWithWar(roleId, sid, funcs, TASK_TYPE.BATTLE_EXPEDITION, battleId, heroes, 1, star);
|
||||
//成长任务
|
||||
await taskUtil.accomplishTask(roleId, TASK_TYPE.BATTLE_MAIN, 1, { warId: battleId })
|
||||
await taskUtil.accomplishTask(serverId, roleId, TASK_TYPE.BATTLE_MAIN, 1, { warId: battleId })
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user