修改playerCe为通用方法
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {Application, BackendSession, createTcpMailBox, ChannelService} from 'pinus';
|
||||
import { handleCost, addItems } from '../../../services/rewardService';
|
||||
import { calPlayerCeAndSave, getAllAttrStage } from '../../../pubUtils/playerCe';
|
||||
import { calPlayerCeAndSave, getAllAttrStage } from '../../../services/playerCeService';
|
||||
import { resResult } from '../../../pubUtils/util';
|
||||
import { STATUS } from '../../../consts/statusCode';
|
||||
import {HeroModel} from '../../../db/Hero';
|
||||
|
||||
22
game-server/app/services/playerCeService.ts
Normal file
22
game-server/app/services/playerCeService.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* 体力系统
|
||||
*/
|
||||
|
||||
import { pinus } from 'pinus';
|
||||
import { STATUS } from '../consts/statusCode';
|
||||
|
||||
import { resResult } from '../pubUtils/util';
|
||||
import { calPlayerCeAndSave as pubCalPlayerCeAndSave } from '../pubUtils/playerCe';
|
||||
import { HeroType } from '../db/Hero';
|
||||
const _ = require('underscore');
|
||||
|
||||
|
||||
//修改并下发战力
|
||||
export async function calPlayerCeAndSave(sid: string, roleId: string, heros: Array<HeroType>, type?: number, args?: Array<number>) {
|
||||
let {role, pushHeros} = await pubCalPlayerCeAndSave(roleId, heros, type, args);
|
||||
|
||||
//下发战力
|
||||
let uids = [{ uid: roleId, sid }];
|
||||
pinus.app.get('channelService').pushMessageByUids('onPlayerCeUpdate', resResult(STATUS.SUCCESS, { ce: role.ce, heros: pushHeros, topFiveCe: 0 }), uids);
|
||||
return heros;
|
||||
}
|
||||
Reference in New Issue
Block a user