数数:埋点
This commit is contained in:
@@ -561,6 +561,7 @@ export class ComBattleHandler {
|
||||
let roleId = session.get('roleId');
|
||||
let roleName = session.get('roleName');
|
||||
let sid = session.get('sid');
|
||||
let ip = session.get('ip');
|
||||
|
||||
let { teamCode } = msg;
|
||||
let team = await ComBattleTeamModel.getTeamByCode(teamCode);
|
||||
@@ -578,7 +579,7 @@ export class ComBattleHandler {
|
||||
if (!warInfo) return resResult(STATUS.BATTLE_MISS_INFO);
|
||||
|
||||
let role = await RoleModel.findByRoleId(roleId, 'lv');
|
||||
let apJson = await setAp(roleId, role.lv, -1 * warInfo.cost, sid); // 扣除体力
|
||||
let apJson = await setAp(roleId, ip, role.lv, -1 * warInfo.cost, sid, ITEM_CHANGE_REASON.COM_BATTLE_END); // 扣除体力
|
||||
if(!apJson) {
|
||||
return resResult(STATUS.BATTLE_ACTION_POINT_LACK);
|
||||
}
|
||||
@@ -592,7 +593,7 @@ export class ComBattleHandler {
|
||||
// }
|
||||
|
||||
await ComBattleTeamModel.updateRewardSt(teamCode, roleId, true);
|
||||
const goods = await addItems(roleId, roleName, sid, roleSt.fixReward, ITEM_CHANGE_REASON.COM_BATTLE_REWARD);
|
||||
const goods = await addItems(roleId, roleName, sid, roleSt.fixReward, ITEM_CHANGE_REASON.COM_BATTLE_END);
|
||||
let actordata = await roleLevelup(KING_EXP_RATIO_TYPE.BATTLE, roleId, warInfo.kingExp, session);// 主公升级经验
|
||||
// 任务
|
||||
await checkTaskWithGoods(roleId, sid, TASK_TYPE.COM_BATTLE_DROP, goods);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Application, BackendSession, HandlerService, } from 'pinus';
|
||||
import { BattleRecordModel } from '../../../db/BattleRecord';
|
||||
import { BattleSweepRecordModel } from '../../../db/BattleSweepRecord';
|
||||
import { genCode } from '../../../pubUtils/util';
|
||||
import { genCode, getReasonByWarType } from '../../../pubUtils/util';
|
||||
import { WAR_TYPE, EVENT_STATUS, FUNC_OPT_TYPE, MSG_SOURCE, REDIS_KEY, TASK_TYPE, KING_EXP_RATIO_TYPE } from '../../../consts';
|
||||
import { checkDaily, checkDailyAndIncrease } from '../../../services/dailyBattleService';
|
||||
import { checkTowerWar, towerBattleEnd } from '../../../services/battleService';
|
||||
@@ -39,12 +39,13 @@ export class NormalBattleHandler {
|
||||
const { 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);
|
||||
@@ -128,7 +129,7 @@ export class NormalBattleHandler {
|
||||
let roleId = session.get('roleId');
|
||||
let roleName = session.get('roleName');
|
||||
let sid = session.get('sid');
|
||||
|
||||
let ip = session.get('ip');
|
||||
let serverId = session.get('serverId');
|
||||
|
||||
let skipReward = false;//是否跳过奖励结算
|
||||
@@ -156,7 +157,7 @@ export class NormalBattleHandler {
|
||||
}
|
||||
|
||||
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, getReasonByWarType(warInfo.warType)); // 扣除体力
|
||||
if (!apJson) {
|
||||
return resResult(STATUS.BATTLE_ACTION_POINT_LACK);
|
||||
}
|
||||
@@ -281,6 +282,7 @@ export class NormalBattleHandler {
|
||||
let roleName = session.get('roleName');
|
||||
let sid = session.get('sid');
|
||||
let serverId = session.get('serverId');
|
||||
let ip = session.get('ip');
|
||||
|
||||
let warInfo = gameData.war.get(battleId);
|
||||
if (!warInfo) {
|
||||
@@ -295,7 +297,7 @@ export class NormalBattleHandler {
|
||||
|
||||
// 扣体力
|
||||
let role = await RoleModel.findByRoleId(roleId, 'lv');
|
||||
let apJson = await setAp(roleId, role.lv, -1 * warInfo.cost * count, sid); // 扣除体力
|
||||
let apJson = await setAp(roleId, ip, role.lv, -1 * warInfo.cost * count, sid, getReasonByWarType(warInfo.warType)); // 扣除体力
|
||||
if (!apJson) {
|
||||
return resResult(STATUS.BATTLE_ACTION_POINT_LACK);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user