diff --git a/game-server/app/services/task/taskObj.ts b/game-server/app/services/task/taskObj.ts index ce7cfd291..623601d26 100644 --- a/game-server/app/services/task/taskObj.ts +++ b/game-server/app/services/task/taskObj.ts @@ -50,7 +50,7 @@ export class CheckTask { this.tasks.push(task); } - public async saveAndPush(sid: string) { + public async saveAndPush(sid?: string) { for(let task of this.tasks) { await task.check(); } @@ -100,7 +100,7 @@ export class CheckTask { } // 推送 - public async pushMessage(sid: string) { + public async pushMessage(sid?: string) { let roleId = this.roleId; if (!sid) { let onlineUser = await getRoleOnlineInfo(roleId); diff --git a/game-server/app/services/task/taskService.ts b/game-server/app/services/task/taskService.ts index 4246bcd8a..b862e6ab7 100644 --- a/game-server/app/services/task/taskService.ts +++ b/game-server/app/services/task/taskService.ts @@ -147,7 +147,7 @@ export async function checkTaskInBattleSweep(serverId: number, roleId: string, s export async function checkTaskInComBattleStart(roleStatus: RoleStatus[], capId: string, blueprtId: number) { - // console.log('********', JSON.stringify(roleStatus), capId, quality) + console.log('********', JSON.stringify(roleStatus), capId, blueprtId) for (let { roleId, isRobot } of roleStatus) { if (!isRobot) { let role = await RoleModel.findByRoleId(roleId); @@ -160,6 +160,7 @@ export async function checkTaskInComBattleStart(roleStatus: RoleStatus[], capId: } task.setParam(TASK_TYPE.COM_BATTLE, {}); task.setParam(TASK_TYPE.COM_BATTLE_LV, { gid: blueprtId }); + await task.saveAndPush(); } } }