奇遇推送优化,不需要每次传app直接使用pinus.app
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { HeroModel } from './../db/Hero';
|
||||
import { HangUpRecordModel } from './../db/HangUpRecord';
|
||||
import { ChannelService } from 'pinus';
|
||||
import { ChannelService, pinus } from 'pinus';
|
||||
import { HANG_UP_CONSTS, TOWER_TASK_CONST, REDIS_KEY } from './../consts';
|
||||
import { BattleRecordModel } from './../db/BattleRecord';
|
||||
import { TowerRecordModel } from './../db/TowerRecord';
|
||||
@@ -46,7 +46,7 @@ export async function checkTowerWar(roleId: string, battleId: number, heroes: Ar
|
||||
}};
|
||||
}
|
||||
|
||||
export async function towerBattleEnd(channelService: ChannelService, sid: string, roleId: string, serverId: number, battleCode: string, battleId: number, succeed: boolean, heroes: Array<number>) {
|
||||
export async function towerBattleEnd(sid: string, roleId: string, serverId: number, battleCode: string, battleId: number, succeed: boolean, heroes: Array<number>) {
|
||||
if (succeed) {
|
||||
let battleRec = await BattleRecordModel.getBattleRecordByCode(battleCode);
|
||||
if (battleRec.battleId != battleId) {
|
||||
@@ -88,7 +88,7 @@ export async function towerBattleEnd(channelService: ChannelService, sid: string
|
||||
if (reward) towerReward = reward;
|
||||
if (towerLv == HANG_UP_CONSTS.ENABLE_LV) {
|
||||
await startHangUp(roleId, roleName);
|
||||
channelService.pushMessageByUids('hangUpEnable', {code: 200, data: {enable: true}}, [{uid: roleId, sid}]);
|
||||
pinus.app.get('channelService').pushMessageByUids('hangUpEnable', {code: 200, data: {enable: true}}, [{uid: roleId, sid}]);
|
||||
}
|
||||
}
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user