体力:修复体力更新
This commit is contained in:
@@ -100,7 +100,7 @@ export async function setAp(roleId: string, ip: string, lv: number, changeAp: nu
|
||||
|
||||
if (changeAp != 0) {
|
||||
let uids = [{ uid: roleId, sid }];
|
||||
pinus.app.get('channelService').pushMessageByUids('onApUpdate', resResult(STATUS.SUCCESS, { ...apJson }), uids);
|
||||
pinus.app.get('channelService').pushMessageByUids('onApUpdate', resResult(STATUS.SUCCESS, { apJson: { ...apJson, apBefore } }), uids);
|
||||
}
|
||||
|
||||
return apJson
|
||||
|
||||
@@ -234,12 +234,12 @@ export async function addItems(roleId: string, roleName: string, sid: string, go
|
||||
|
||||
// 3. 货币推送
|
||||
if(gold.length > 0 || coin.length > 0 || ap > 0) {
|
||||
let { ap: addAp } = await setAp(roleId, null, role.lv, ap, sid, reason);
|
||||
await setAp(roleId, null, role.lv, ap, sid, reason);
|
||||
let incCoin = coin.reduce((pre, cur) => pre + cur, 0);
|
||||
let incGold = gold.reduce((pre, cur) => pre + cur.count, 0);
|
||||
role = await RoleModel.increaseGoldAndCoin(roleId, gold, incCoin);
|
||||
pinus.app.get('channelService').pushMessageByUids('onPlayerDataChange', resResult(STATUS.SUCCESS, {
|
||||
gold: role.gold, coin: role.coin, ap: addAp
|
||||
gold: role.gold, coin: role.coin
|
||||
}), uids);
|
||||
if(gold.length > 0) {
|
||||
gold.forEach(({ count }) => {
|
||||
|
||||
Reference in New Issue
Block a user