方法引用错误修改
This commit is contained in:
@@ -7,8 +7,8 @@ import { ACTION_POIN } from '../consts/consts';
|
|||||||
import { ChannelService, pinus } from 'pinus';
|
import { ChannelService, pinus } from 'pinus';
|
||||||
import { STATUS } from '../consts/statusCode';
|
import { STATUS } from '../consts/statusCode';
|
||||||
import {resResult } from '../pubUtils/util';
|
import {resResult } from '../pubUtils/util';
|
||||||
import {updateHeroInfo} from '../db/Hero';
|
import {HeroModel} from '../db/Hero';
|
||||||
import {findByRoleId, updateRoleInfo} from '../db/Role';
|
import {RoleModel} from '../db/Role';
|
||||||
import { forEach } from 'pinus-robot/lib/common/util';
|
import { forEach } from 'pinus-robot/lib/common/util';
|
||||||
//战力计算TODO
|
//战力计算TODO
|
||||||
export function calPlayerCe(hero:any) {
|
export function calPlayerCe(hero:any) {
|
||||||
@@ -23,15 +23,15 @@ export async function calPlayerCeAndSave(sid: string, roleId: string, heros:Arra
|
|||||||
for (let hero of heros) {
|
for (let hero of heros) {
|
||||||
hero.ce = calPlayerCe(hero);
|
hero.ce = calPlayerCe(hero);
|
||||||
playerCe = playerCe + hero.ce;
|
playerCe = playerCe + hero.ce;
|
||||||
hero = await updateHeroInfo(roleId, hero.hid, hero);
|
hero = await HeroModel.updateHeroInfo(roleId, hero.hid, hero);
|
||||||
pushHeros.push({
|
pushHeros.push({
|
||||||
hid: hero.hid,
|
hid: hero.hid,
|
||||||
ce: hero.ce
|
ce: hero.ce
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
let role = await findByRoleId(roleId);
|
let role = await RoleModel.findByRoleId(roleId);
|
||||||
role.ce = playerCe;
|
role.ce = playerCe;
|
||||||
await updateRoleInfo(roleId, role);
|
await RoleModel.updateRoleInfo(roleId, role);
|
||||||
//下发战力
|
//下发战力
|
||||||
let uids = [{uid: roleId, sid}];
|
let uids = [{uid: roleId, sid}];
|
||||||
pinus.app.get('channelService').pushMessageByUids('onPlayerCeUpdate', resResult(STATUS.SUCCESS, {ce: playerCe, heros:pushHeros, topFiveCe:0}), uids);
|
pinus.app.get('channelService').pushMessageByUids('onPlayerCeUpdate', resResult(STATUS.SUCCESS, {ce: playerCe, heros:pushHeros, topFiveCe:0}), uids);
|
||||||
|
|||||||
Reference in New Issue
Block a user