diff --git a/game-server/app/services/actionPointService.ts b/game-server/app/services/actionPointService.ts index 22924add5..7c49adb7a 100644 --- a/game-server/app/services/actionPointService.ts +++ b/game-server/app/services/actionPointService.ts @@ -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 diff --git a/game-server/app/services/rewardService.ts b/game-server/app/services/rewardService.ts index 8363cf628..095d81177 100644 --- a/game-server/app/services/rewardService.ts +++ b/game-server/app/services/rewardService.ts @@ -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 }) => {