军团:添加活跃值id改为枚举
This commit is contained in:
@@ -7,7 +7,7 @@ import { nowSeconds } from '../../../pubUtils/timeUtil';
|
|||||||
import { getArmyDonateBaseByLv, getArmyDonateBoxBaseById } from '../../../pubUtils/data';
|
import { getArmyDonateBaseByLv, getArmyDonateBoxBaseById } from '../../../pubUtils/data';
|
||||||
import { GuildModel } from '../../../db/Guild';
|
import { GuildModel } from '../../../db/Guild';
|
||||||
import { handleCost, addItems } from '../../../services/rewardService';
|
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 { getDonation } from '../../../services/donateService';
|
||||||
import { getUserGuildWithRefActive } from '../../../services/guildService';
|
import { getUserGuildWithRefActive } from '../../../services/guildService';
|
||||||
import { ARMY } from '../../../pubUtils/dicParam';
|
import { ARMY } from '../../../pubUtils/dicParam';
|
||||||
@@ -60,7 +60,7 @@ export class DonationHandler {
|
|||||||
//增加基金
|
//增加基金
|
||||||
const { fund } = await GuildModel.updateInfo(code, {}, { fund: rewardFund }, 'fund');
|
const { fund } = await GuildModel.updateInfo(code, {}, { fund: rewardFund }, 'fund');
|
||||||
this.app.rpc.chat.guildRemote.updateInfo.toServer(CHAT_SERVER, code, { 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 });
|
return resResult(STATUS.SUCCESS, { donateFund, reports, donateCnt, goods });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { BattleRecordModel } from '../../../db/BattleRecord';
|
|||||||
import { nowSeconds, getTodayZeroPoint } from '../../../pubUtils/timeUtil';
|
import { nowSeconds, getTodayZeroPoint } from '../../../pubUtils/timeUtil';
|
||||||
import { getBossInstanceInfo, bossResult, checkMemberExists, pushBossHpMessage, getBossInstanceWhenEnd, addBossInstance } from '../../../services/guildBossService';
|
import { getBossInstanceInfo, bossResult, checkMemberExists, pushBossHpMessage, getBossInstanceWhenEnd, addBossInstance } from '../../../services/guildBossService';
|
||||||
import { findWhere } from 'underscore'
|
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 { DATA_NAME } from '../../../consts/dataName';
|
||||||
import { UserGuildModel } from '../../../db/UserGuild';
|
import { UserGuildModel } from '../../../db/UserGuild';
|
||||||
import { GUILD_OPERATE } from '../../../consts';
|
import { GUILD_OPERATE } from '../../../consts';
|
||||||
@@ -174,7 +174,7 @@ export class GuildHandler {
|
|||||||
}, true);
|
}, true);
|
||||||
let bossInstance = await BossInstanceModel.findBossInstance(code);
|
let bossInstance = await BossInstanceModel.findBossInstance(code);
|
||||||
let result = await getBossInstanceWhenEnd(bossInstance, roleId, battleRecord.record.recordNum);
|
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);
|
return resResult(STATUS.SUCCESS, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -911,7 +911,7 @@ export class GuildHandler {
|
|||||||
const serverId = session.get('serverId');
|
const serverId = session.get('serverId');
|
||||||
const { code, active, id } = msg;
|
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;
|
if(result.status == 0) return result.resResult;
|
||||||
const { guild, userGuild } = result;
|
const { guild, userGuild } = result;
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { nowSeconds, getHourPoint, getCurHourPoint } from '../../../pubUtils/tim
|
|||||||
import { getUserGuild, getGuildTrainInfo, unlockTrain, resetTrain, getGuildTrainRewards} from '../../../services/guildTrainService';
|
import { getUserGuild, getGuildTrainInfo, unlockTrain, resetTrain, getGuildTrainRewards} from '../../../services/guildTrainService';
|
||||||
import { findIndex, findWhere, indexBy } from 'underscore'
|
import { findIndex, findWhere, indexBy } from 'underscore'
|
||||||
import { lockData } from '../../../services/redLockService';
|
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 { UserGuildModel } from '../../../db/UserGuild';
|
||||||
import { GuildModel } from '../../../db/Guild';
|
import { GuildModel } from '../../../db/Guild';
|
||||||
import { getArmyTrainJuDian, getTrainSoloReward, getTrainBaseByLv } from '../../../pubUtils/data';
|
import { getArmyTrainJuDian, getTrainSoloReward, getTrainBaseByLv } from '../../../pubUtils/data';
|
||||||
@@ -237,7 +237,7 @@ export class GuildTrainHandler {
|
|||||||
let { trainCount, trainRewards } = userGuild;
|
let { trainCount, trainRewards } = userGuild;
|
||||||
let result:any = getGuildTrainInfo(guildTrain, roleId, trainCount, trainRewards);
|
let result:any = getGuildTrainInfo(guildTrain, roleId, trainCount, trainRewards);
|
||||||
result.battleGoods = goods;
|
result.battleGoods = goods;
|
||||||
await addActive(roleId, serverId, 2, 1);
|
await addActive(roleId, serverId, GUILD_POINT_WAYS.TRAIN);
|
||||||
return resResult(STATUS.SUCCESS, result);
|
return resResult(STATUS.SUCCESS, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export async function getGuildWithRefActive(guildCode: string, serverId: number)
|
|||||||
* @param type 类型 activePoint内配的type
|
* @param type 类型 activePoint内配的type
|
||||||
* @param active debug直接增加的活跃
|
* @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);
|
let dicActiveWay = gameData.guildActiveWays.get(id);
|
||||||
if(id && !dicActiveWay) {
|
if(id && !dicActiveWay) {
|
||||||
|
|||||||
@@ -121,3 +121,11 @@ export enum GUILD_REC_TYPE {
|
|||||||
|
|
||||||
export const GUILD_REPORT_NUM = 40;
|
export const GUILD_REPORT_NUM = 40;
|
||||||
export const REFRESH_HOUR = 5;
|
export const REFRESH_HOUR = 5;
|
||||||
|
|
||||||
|
// 获得活跃值途径id
|
||||||
|
export enum GUILD_POINT_WAYS {
|
||||||
|
DONATE = 1, // 捐赠
|
||||||
|
TRAIN = 2, // 训练场
|
||||||
|
BOSS_WAR = 3, // 演武台
|
||||||
|
ACTIVITY = 4, // 军团活动
|
||||||
|
}
|
||||||
Executable → Regular
+5
-5
@@ -2,25 +2,25 @@
|
|||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"name": "捐献所",
|
"name": "捐献所",
|
||||||
"cout": 5,
|
"cout": 10,
|
||||||
"activePoint": "1&3|2&5|3&8"
|
"activePoint": "1&300|2&500|3&700"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"name": "练兵场",
|
"name": "练兵场",
|
||||||
"cout": 4,
|
"cout": 4,
|
||||||
"activePoint": "1&5"
|
"activePoint": "1&200"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"name": "演武台",
|
"name": "演武台",
|
||||||
"cout": 1,
|
"cout": 1,
|
||||||
"activePoint": "1&20"
|
"activePoint": "1&500"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 4,
|
"id": 4,
|
||||||
"name": "军团活动",
|
"name": "军团活动",
|
||||||
"cout": 2,
|
"cout": 2,
|
||||||
"activePoint": "1&30"
|
"activePoint": "1&300"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
Reference in New Issue
Block a user