数数:埋点

This commit is contained in:
luying
2021-12-14 18:04:00 +08:00
parent b6501ee4a2
commit dd7cf449d6
23 changed files with 357 additions and 72 deletions
@@ -122,13 +122,14 @@ export class ExpeditionBattleHandler {
const { expeditionCode, expeditionId, battleId, heroes: seqIds = [] } = msg;
let roleId = session.get('roleId');
let roleName = session.get('roleName');
let ip = session.get('ip');
let warInfo = gameData.war.get(battleId);
if (!warInfo) {
return resResult(STATUS.BATTLE_MISS_INFO);
}
let role = await RoleModel.findByRoleId(roleId, 'lv');
let apJson = await getAp(roleId, role.lv);
let apJson = await getAp(roleId, ip, role.lv);
let { ap } = apJson;
if (ap < warInfo.cost) {
return resResult(STATUS.BATTLE_ACTION_POINT_LACK);
@@ -185,7 +186,7 @@ export class ExpeditionBattleHandler {
let roleName = session.get('roleName');
const serverId = session.get('serverId');
let sid = session.get('sid');
let ip = session.get('ip');
let warInfo = gameData.war.get(battleId);
if (!warInfo) {
@@ -207,7 +208,7 @@ export class ExpeditionBattleHandler {
}
let role = await RoleModel.findByRoleId(roleId, 'lv');
let apJson = await setAp(roleId, role.lv, isSuccess?-1 * warInfo.cost: 0, sid); // 扣除体力
let apJson = await setAp(roleId, ip, role.lv, isSuccess?-1 * warInfo.cost: 0, sid, ITEM_CHANGE_REASON.EXPEDITION_BATTLE_END); // 扣除体力
if (!apJson) {
return resResult(STATUS.BATTLE_ACTION_POINT_LACK);
}