diff --git a/game-server/app/servers/battle/handler/donateHandler.ts b/game-server/app/servers/battle/handler/donateHandler.ts index c22105d6c..144533290 100644 --- a/game-server/app/servers/battle/handler/donateHandler.ts +++ b/game-server/app/servers/battle/handler/donateHandler.ts @@ -7,7 +7,7 @@ import { nowSeconds } from '../../../pubUtils/timeUtil'; import { getArmyDonateBaseByLv, getArmyDonateBoxBaseById } from '../../../pubUtils/data'; import { GuildModel } from '../../../db/Guild'; import { handleCost, addItems } from '../../../services/rewardService'; -import { CHAT_SERVER } from '../../../consts'; +import { CHAT_SERVER, GUILD_POINT_WAYS } from '../../../consts'; import { getDonation } from '../../../services/donateService'; import { getUserGuildWithRefActive } from '../../../services/guildService'; import { ARMY } from '../../../pubUtils/dicParam'; @@ -60,7 +60,7 @@ export class DonationHandler { //增加基金 const { fund } = await GuildModel.updateInfo(code, {}, { fund: rewardFund }, 'fund'); this.app.rpc.chat.guildRemote.updateInfo.toServer(CHAT_SERVER, code, { fund }); - await addActive(roleId, serverId, 1, id); + await addActive(roleId, serverId, GUILD_POINT_WAYS.DONATE, id); return resResult(STATUS.SUCCESS, { donateFund, reports, donateCnt, goods }); } diff --git a/game-server/app/servers/battle/handler/guildBossHandler.ts b/game-server/app/servers/battle/handler/guildBossHandler.ts index 11b693efa..f4e7a7191 100644 --- a/game-server/app/servers/battle/handler/guildBossHandler.ts +++ b/game-server/app/servers/battle/handler/guildBossHandler.ts @@ -6,7 +6,7 @@ import { BattleRecordModel } from '../../../db/BattleRecord'; import { nowSeconds, getTodayZeroPoint } from '../../../pubUtils/timeUtil'; import { getBossInstanceInfo, bossResult, checkMemberExists, pushBossHpMessage, getBossInstanceWhenEnd, addBossInstance } from '../../../services/guildBossService'; import { findWhere } from 'underscore' -import { GUILD_STRUCTURE } from '../../../consts/constModules/guildConst'; +import { GUILD_STRUCTURE, GUILD_POINT_WAYS } from '../../../consts/constModules/guildConst'; import { DATA_NAME } from '../../../consts/dataName'; import { UserGuildModel } from '../../../db/UserGuild'; import { GUILD_OPERATE } from '../../../consts'; @@ -174,7 +174,7 @@ export class GuildHandler { }, true); let bossInstance = await BossInstanceModel.findBossInstance(code); let result = await getBossInstanceWhenEnd(bossInstance, roleId, battleRecord.record.recordNum); - await addActive(roleId, serverId, 3, 1); + await addActive(roleId, serverId, GUILD_POINT_WAYS.BOSS_WAR); return resResult(STATUS.SUCCESS, result); } diff --git a/game-server/app/servers/battle/handler/guildHandler.ts b/game-server/app/servers/battle/handler/guildHandler.ts index 7bfb140a6..6ac1ff610 100644 --- a/game-server/app/servers/battle/handler/guildHandler.ts +++ b/game-server/app/servers/battle/handler/guildHandler.ts @@ -911,7 +911,7 @@ export class GuildHandler { const serverId = session.get('serverId'); const { code, active, id } = msg; - const result = await addActive(roleId, serverId, id, 1); + const result = await addActive(roleId, serverId, id); if(result.status == 0) return result.resResult; const { guild, userGuild } = result; diff --git a/game-server/app/servers/battle/handler/guildTrainHandler.ts b/game-server/app/servers/battle/handler/guildTrainHandler.ts index 082029d1f..8e9d4b0b7 100644 --- a/game-server/app/servers/battle/handler/guildTrainHandler.ts +++ b/game-server/app/servers/battle/handler/guildTrainHandler.ts @@ -7,7 +7,7 @@ import { nowSeconds, getHourPoint, getCurHourPoint } from '../../../pubUtils/tim import { getUserGuild, getGuildTrainInfo, unlockTrain, resetTrain, getGuildTrainRewards} from '../../../services/guildTrainService'; import { findIndex, findWhere, indexBy } from 'underscore' import { lockData } from '../../../services/redLockService'; -import { REFRESH_HOUR, GUILD_REPORT_NUM } from '../../../consts/constModules/guildConst'; +import { REFRESH_HOUR, GUILD_REPORT_NUM, GUILD_POINT_WAYS } from '../../../consts/constModules/guildConst'; import { UserGuildModel } from '../../../db/UserGuild'; import { GuildModel } from '../../../db/Guild'; import { getArmyTrainJuDian, getTrainSoloReward, getTrainBaseByLv } from '../../../pubUtils/data'; @@ -237,7 +237,7 @@ export class GuildTrainHandler { let { trainCount, trainRewards } = userGuild; let result:any = getGuildTrainInfo(guildTrain, roleId, trainCount, trainRewards); result.battleGoods = goods; - await addActive(roleId, serverId, 2, 1); + await addActive(roleId, serverId, GUILD_POINT_WAYS.TRAIN); return resResult(STATUS.SUCCESS, result); } diff --git a/game-server/app/services/guildService.ts b/game-server/app/services/guildService.ts index d811100a4..f8be22d43 100644 --- a/game-server/app/services/guildService.ts +++ b/game-server/app/services/guildService.ts @@ -122,7 +122,7 @@ export async function getGuildWithRefActive(guildCode: string, serverId: number) * @param type 类型 activePoint内配的type * @param active debug直接增加的活跃 */ -export async function addActive(roleId: string, serverId: number, id: number, type: number, active?: number) { +export async function addActive(roleId: string, serverId: number, id: number, type: number = 1, active?: number) { let dicActiveWay = gameData.guildActiveWays.get(id); if(id && !dicActiveWay) { diff --git a/shared/consts/constModules/guildConst.ts b/shared/consts/constModules/guildConst.ts index 71118ecd1..824730039 100644 --- a/shared/consts/constModules/guildConst.ts +++ b/shared/consts/constModules/guildConst.ts @@ -121,3 +121,11 @@ export enum GUILD_REC_TYPE { export const GUILD_REPORT_NUM = 40; export const REFRESH_HOUR = 5; + +// 获得活跃值途径id +export enum GUILD_POINT_WAYS { + DONATE = 1, // 捐赠 + TRAIN = 2, // 训练场 + BOSS_WAR = 3, // 演武台 + ACTIVITY = 4, // 军团活动 +} \ No newline at end of file diff --git a/shared/resource/jsons/dic_army_activePointWays.json b/shared/resource/jsons/dic_army_activePointWays.json old mode 100755 new mode 100644 index 99e2ec626..0492208d3 --- a/shared/resource/jsons/dic_army_activePointWays.json +++ b/shared/resource/jsons/dic_army_activePointWays.json @@ -2,25 +2,25 @@ { "id": 1, "name": "捐献所", - "cout": 5, - "activePoint": "1&3|2&5|3&8" + "cout": 10, + "activePoint": "1&300|2&500|3&700" }, { "id": 2, "name": "练兵场", "cout": 4, - "activePoint": "1&5" + "activePoint": "1&200" }, { "id": 3, "name": "演武台", "cout": 1, - "activePoint": "1&20" + "activePoint": "1&500" }, { "id": 4, "name": "军团活动", "cout": 2, - "activePoint": "1&30" + "activePoint": "1&300" } ] \ No newline at end of file