✨ feat(gvg): 添加推送
This commit is contained in:
@@ -23,6 +23,8 @@ export const CHANNEL_PREFIX = {
|
||||
GUILD_AUCTION: 'g_auction', // 军团拍卖
|
||||
WORLD_AUCTION: 'w_auction', // 军团拍卖
|
||||
GROUP_SHOP: 'groupShop', // 团购页面
|
||||
GVG_AREAS: 'gvgAreas', // 大地图界面
|
||||
GVG_AREA_BY_TEAM: 'gvgTeam', // 选中玩家队伍后加入频道
|
||||
}
|
||||
|
||||
export const getChannelType = function(prefix: string) {
|
||||
@@ -181,4 +183,8 @@ export const PUSH_ROUTE = {
|
||||
LEAGUE_ITEM_UPDATE: 'onLeagueItemUpdate',
|
||||
GVG_TASK_UPDATE: 'onGVGTaskUpdate', // GVG任务更新
|
||||
GVG_TEAM_ATTACKED: 'onTeamAttacked', // 当队伍受到攻击
|
||||
GVG_AREA_SPINE_CHANGE: 'onAreaSpinesChange', // 可见区域内spine的变动,每隔5秒会下发
|
||||
GVG_AREA_POINT_CHANGE: 'onMyAreaPointChange', // 积分点上的驻守人变更
|
||||
GVG_PLAYER_AREA_ADD: 'onPlayerAddToArea', // 积分点上的驻守人变更
|
||||
GVG_PLAYER_LEAVE_AREA: 'onPlayerLeaveArea', // 积分点上的驻守人变更
|
||||
}
|
||||
@@ -261,6 +261,8 @@ export enum REDIS_KEY {
|
||||
LEAGUE_INFO ="leagueInfo", // 联军信息
|
||||
GVG_BATTLE_RANK ="gvgBattleUsr", // 激战期个人排行榜
|
||||
GVG_BATTLE_LEAGUE_RANK = "gvgBattleLeague", // 激战期联军排行榜
|
||||
GVG_HISTORY_AREA ='gvgHisArea', // gvg激战期玩家加入的区域
|
||||
GVG_HISTORY_AREA_TEAM ='gvgHisAreaTeam', // gvg激战期玩家加入的区域
|
||||
}
|
||||
|
||||
// 各排行榜对应hash的key
|
||||
|
||||
@@ -119,6 +119,9 @@ export default class GVGTeam extends BaseModel {
|
||||
@prop({ required: false })
|
||||
batchCode: string; // 批量编号
|
||||
|
||||
originPointId: number;
|
||||
curTeamBreak: boolean;
|
||||
|
||||
// 创建队伍
|
||||
public static async saveTeam(roleId: string, index: number, updateParam: SaveTeamUpdateParam, initParam: InitTeamParam) {
|
||||
const doc = new GVGTeamModel();
|
||||
@@ -256,12 +259,13 @@ export default class GVGTeam extends BaseModel {
|
||||
public static async battleEndAttack(teamCode: string, hpInc: number, playerScoreInc: number, rebirthAreaId: number) {
|
||||
let team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $inc: { durability: hpInc, score: playerScoreInc } }, { new: true }).lean();
|
||||
if(team.durability <= 0) {
|
||||
let originPointId = team.pointId;
|
||||
team = await GVGTeamModel.teamBreak(teamCode, team.isRobot, team.maxDurability, rebirthAreaId);
|
||||
team.originPointId = originPointId;
|
||||
}
|
||||
return team;
|
||||
}
|
||||
|
||||
originPointId: number;
|
||||
// 结算防守方
|
||||
public static async battleEndDefense(teamCode: string, hpInc: number, playerScoreInc: number, rebirthAreaId: number) {
|
||||
let team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { defenseTime: nowSeconds() + GVG.GVG_DEFAULT_DEFENSE_CD, lockTime: 0, lockTeamCode: '' }, $inc: { durability: hpInc, score: playerScoreInc } }, { new: true }).lean();
|
||||
@@ -273,7 +277,6 @@ export default class GVGTeam extends BaseModel {
|
||||
return team;
|
||||
}
|
||||
|
||||
curTeamBreak: boolean;
|
||||
// 队伍进入修整器
|
||||
public static async teamBreak(teamCode: string, isRobot: boolean, maxDurability: number, areaId: number) {
|
||||
if(!isRobot) {
|
||||
@@ -313,7 +316,14 @@ export default class GVGTeam extends BaseModel {
|
||||
}));
|
||||
}
|
||||
let teams: GVGTeamType[] = await GVGTeamModel.find({ batchCode }).lean();
|
||||
return teams
|
||||
return teams.map(team => {
|
||||
let originTeam = brokenTeams.find(origin => origin.teamCode == team.teamCode);
|
||||
if(originTeam) {
|
||||
team.originPointId = originTeam.originPointId;
|
||||
team.curTeamBreak = originTeam.curTeamBreak;
|
||||
}
|
||||
return team
|
||||
})
|
||||
}
|
||||
|
||||
// 加积分
|
||||
|
||||
@@ -55,7 +55,7 @@ export default class GVGUserItem extends BaseModel {
|
||||
}
|
||||
|
||||
public static async checkItemCnt(configId: number, leagueCode: string, roleId: string, id: number, count: number) {
|
||||
return await GVGUserItemModel.exists({ configId, leagueCode, roleId, id, count: { $gte: count } });
|
||||
return await GVGUserItemModel.exists({ configId, leagueCode, roleId, id, count: { $gte: count }, expireTime: { $gte: nowSeconds() } });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"value": 1000,
|
||||
"reward": "40005&1000",
|
||||
"leagueReward": "12&100",
|
||||
"ripeTime": 600,
|
||||
"ripeTime": 14400,
|
||||
"getWays": "&",
|
||||
"info_1": "&"
|
||||
},
|
||||
@@ -29,7 +29,7 @@
|
||||
"value": 1500,
|
||||
"reward": "40005&1400",
|
||||
"leagueReward": "12&150",
|
||||
"ripeTime": 900,
|
||||
"ripeTime": 18000,
|
||||
"getWays": "&",
|
||||
"info_1": "&"
|
||||
},
|
||||
@@ -46,7 +46,7 @@
|
||||
"value": 2000,
|
||||
"reward": "40005&1800",
|
||||
"leagueReward": "12&150",
|
||||
"ripeTime": 1200,
|
||||
"ripeTime": 21600,
|
||||
"getWays": "&",
|
||||
"info_1": "&"
|
||||
},
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
"lv": 1,
|
||||
"type": 1,
|
||||
"image_id": "&",
|
||||
"limit": "6名武将3星",
|
||||
"limit": "6名武将2星",
|
||||
"limitType": 1,
|
||||
"limitParams": "6&3",
|
||||
"limitParams": "6&2",
|
||||
"value": "1&0",
|
||||
"sum": 100,
|
||||
"size": "&"
|
||||
@@ -44,9 +44,9 @@
|
||||
"lv": 4,
|
||||
"type": 1,
|
||||
"image_id": "&",
|
||||
"limit": "6名武将4星",
|
||||
"limit": "6名武将5星",
|
||||
"limitType": 1,
|
||||
"limitParams": "6&4",
|
||||
"limitParams": "6&5",
|
||||
"value": "1&15",
|
||||
"sum": 100,
|
||||
"size": "&"
|
||||
@@ -57,9 +57,9 @@
|
||||
"lv": 5,
|
||||
"type": 1,
|
||||
"image_id": "&",
|
||||
"limit": "6名武将5星",
|
||||
"limit": "6名武将6星",
|
||||
"limitType": 1,
|
||||
"limitParams": "6&5",
|
||||
"limitParams": "6&6",
|
||||
"value": "1&20",
|
||||
"sum": 100,
|
||||
"size": "&"
|
||||
@@ -70,9 +70,9 @@
|
||||
"lv": 6,
|
||||
"type": 1,
|
||||
"image_id": "&",
|
||||
"limit": "6名武将5星",
|
||||
"limit": "6名武将7星",
|
||||
"limitType": 1,
|
||||
"limitParams": "6&5",
|
||||
"limitParams": "6&7",
|
||||
"value": "1&25",
|
||||
"sum": 100,
|
||||
"size": "&"
|
||||
@@ -83,9 +83,9 @@
|
||||
"lv": 7,
|
||||
"type": 1,
|
||||
"image_id": "&",
|
||||
"limit": "6名武将6星",
|
||||
"limit": "6名武将8星",
|
||||
"limitType": 1,
|
||||
"limitParams": "6&6",
|
||||
"limitParams": "6&8",
|
||||
"value": "1&30",
|
||||
"sum": 100,
|
||||
"size": "&"
|
||||
@@ -96,9 +96,9 @@
|
||||
"lv": 8,
|
||||
"type": 1,
|
||||
"image_id": "&",
|
||||
"limit": "6名武将6星",
|
||||
"limit": "12名武将8星",
|
||||
"limitType": 1,
|
||||
"limitParams": "6&6",
|
||||
"limitParams": "12&8",
|
||||
"value": "1&35",
|
||||
"sum": 100,
|
||||
"size": "&"
|
||||
@@ -109,9 +109,9 @@
|
||||
"lv": 9,
|
||||
"type": 1,
|
||||
"image_id": "&",
|
||||
"limit": "6名武将7星",
|
||||
"limit": "12名武将9星",
|
||||
"limitType": 1,
|
||||
"limitParams": "6&7",
|
||||
"limitParams": "12&9",
|
||||
"value": "1&40",
|
||||
"sum": 100,
|
||||
"size": "&"
|
||||
@@ -122,9 +122,9 @@
|
||||
"lv": 10,
|
||||
"type": 1,
|
||||
"image_id": "&",
|
||||
"limit": "6名武将8星",
|
||||
"limit": "12名武将10星",
|
||||
"limitType": 1,
|
||||
"limitParams": "6&8",
|
||||
"limitParams": "12&10",
|
||||
"value": "1&50",
|
||||
"sum": 100,
|
||||
"size": "&"
|
||||
@@ -135,11 +135,11 @@
|
||||
"lv": 1,
|
||||
"type": 2,
|
||||
"image_id": "&",
|
||||
"limit": "6件装备1星",
|
||||
"limit": "4件装备1星",
|
||||
"limitType": 2,
|
||||
"limitParams": "6&1",
|
||||
"limitParams": "4&1",
|
||||
"value": "1&100&5|2&120&3|3&150&2",
|
||||
"sum": 400,
|
||||
"sum": 300,
|
||||
"size": "5&8"
|
||||
},
|
||||
{
|
||||
@@ -148,11 +148,11 @@
|
||||
"lv": 2,
|
||||
"type": 2,
|
||||
"image_id": "&",
|
||||
"limit": "6件装备1星",
|
||||
"limit": "8件装备1星",
|
||||
"limitType": 2,
|
||||
"limitParams": "6&1",
|
||||
"limitParams": "8&1",
|
||||
"value": "1&100&3|2&120&5|3&150&2",
|
||||
"sum": 400,
|
||||
"sum": 300,
|
||||
"size": "5&8"
|
||||
},
|
||||
{
|
||||
@@ -161,11 +161,11 @@
|
||||
"lv": 3,
|
||||
"type": 2,
|
||||
"image_id": "&",
|
||||
"limit": "6件装备2星",
|
||||
"limit": "12件装备2星",
|
||||
"limitType": 2,
|
||||
"limitParams": "6&2",
|
||||
"limitParams": "12&2",
|
||||
"value": "1&100&2|2&120&3|3&150&5",
|
||||
"sum": 400,
|
||||
"sum": 300,
|
||||
"size": "5&8"
|
||||
},
|
||||
{
|
||||
@@ -174,11 +174,11 @@
|
||||
"lv": 4,
|
||||
"type": 2,
|
||||
"image_id": "&",
|
||||
"limit": "6件装备2星",
|
||||
"limit": "12件装备3星",
|
||||
"limitType": 2,
|
||||
"limitParams": "6&2",
|
||||
"limitParams": "12&3",
|
||||
"value": "1&100&5|2&120&3|3&150&5",
|
||||
"sum": 400,
|
||||
"sum": 300,
|
||||
"size": "5&9"
|
||||
},
|
||||
{
|
||||
@@ -187,11 +187,11 @@
|
||||
"lv": 5,
|
||||
"type": 2,
|
||||
"image_id": "&",
|
||||
"limit": "6件装备3星",
|
||||
"limit": "24件装备3星",
|
||||
"limitType": 2,
|
||||
"limitParams": "6&3",
|
||||
"limitParams": "24&3",
|
||||
"value": "1&100&3|2&120&5|3&150&5",
|
||||
"sum": 400,
|
||||
"sum": 300,
|
||||
"size": "5&9"
|
||||
},
|
||||
{
|
||||
@@ -200,11 +200,11 @@
|
||||
"lv": 6,
|
||||
"type": 2,
|
||||
"image_id": "&",
|
||||
"limit": "6件装备4星",
|
||||
"limit": "24件装备4星",
|
||||
"limitType": 2,
|
||||
"limitParams": "6&4",
|
||||
"limitParams": "24&4",
|
||||
"value": "2&120&5|3&150&5|4&180&3",
|
||||
"sum": 400,
|
||||
"sum": 300,
|
||||
"size": "5&9"
|
||||
},
|
||||
{
|
||||
@@ -213,11 +213,11 @@
|
||||
"lv": 7,
|
||||
"type": 2,
|
||||
"image_id": "&",
|
||||
"limit": "6件装备5星",
|
||||
"limit": "24件装备5星",
|
||||
"limitType": 2,
|
||||
"limitParams": "6&5",
|
||||
"limitParams": "24&5",
|
||||
"value": "2&120&3|3&150&5|4&180&5",
|
||||
"sum": 400,
|
||||
"sum": 300,
|
||||
"size": "5&9"
|
||||
},
|
||||
{
|
||||
@@ -226,11 +226,11 @@
|
||||
"lv": 8,
|
||||
"type": 2,
|
||||
"image_id": "&",
|
||||
"limit": "6件装备6星",
|
||||
"limit": "48件装备5星",
|
||||
"limitType": 2,
|
||||
"limitParams": "6&6",
|
||||
"limitParams": "48&5",
|
||||
"value": "2&120&5|3&150&5|4&180&5",
|
||||
"sum": 400,
|
||||
"sum": 300,
|
||||
"size": "6&9"
|
||||
},
|
||||
{
|
||||
@@ -239,11 +239,11 @@
|
||||
"lv": 9,
|
||||
"type": 2,
|
||||
"image_id": "&",
|
||||
"limit": "6件装备7星",
|
||||
"limit": "48件装备6星",
|
||||
"limitType": 2,
|
||||
"limitParams": "6&7",
|
||||
"limitParams": "48&6",
|
||||
"value": "2&120&3|3&150&7|4&180&5",
|
||||
"sum": 400,
|
||||
"sum": 300,
|
||||
"size": "6&9"
|
||||
},
|
||||
{
|
||||
@@ -252,11 +252,11 @@
|
||||
"lv": 10,
|
||||
"type": 2,
|
||||
"image_id": "&",
|
||||
"limit": "6件装备8星",
|
||||
"limit": "48件装备7星",
|
||||
"limitType": 2,
|
||||
"limitParams": "6&8",
|
||||
"limitParams": "48&7",
|
||||
"value": "2&120&3|3&150&5|4&180&7",
|
||||
"sum": 400,
|
||||
"sum": 300,
|
||||
"size": "6&9"
|
||||
},
|
||||
{
|
||||
@@ -269,7 +269,7 @@
|
||||
"limitType": 3,
|
||||
"limitParams": 1000000,
|
||||
"value": "3&100",
|
||||
"sum": 500,
|
||||
"sum": 200,
|
||||
"size": "&"
|
||||
},
|
||||
{
|
||||
@@ -282,7 +282,7 @@
|
||||
"limitType": 3,
|
||||
"limitParams": 1500000,
|
||||
"value": "3&150",
|
||||
"sum": 500,
|
||||
"sum": 200,
|
||||
"size": "&"
|
||||
},
|
||||
{
|
||||
@@ -295,7 +295,7 @@
|
||||
"limitType": 3,
|
||||
"limitParams": 2000000,
|
||||
"value": "3&200",
|
||||
"sum": 500,
|
||||
"sum": 200,
|
||||
"size": "&"
|
||||
},
|
||||
{
|
||||
@@ -308,7 +308,7 @@
|
||||
"limitType": 3,
|
||||
"limitParams": 2500000,
|
||||
"value": "3&250",
|
||||
"sum": 500,
|
||||
"sum": 200,
|
||||
"size": "&"
|
||||
},
|
||||
{
|
||||
@@ -321,7 +321,7 @@
|
||||
"limitType": 3,
|
||||
"limitParams": 3000000,
|
||||
"value": "3&300",
|
||||
"sum": 500,
|
||||
"sum": 200,
|
||||
"size": "&"
|
||||
},
|
||||
{
|
||||
@@ -330,11 +330,11 @@
|
||||
"lv": 6,
|
||||
"type": 3,
|
||||
"image_id": "&",
|
||||
"limit": "最强6人战力达3500000",
|
||||
"limit": "最强6人战力达4000000",
|
||||
"limitType": 3,
|
||||
"limitParams": 3500000,
|
||||
"limitParams": 4000000,
|
||||
"value": "3&350",
|
||||
"sum": 500,
|
||||
"sum": 200,
|
||||
"size": "&"
|
||||
},
|
||||
{
|
||||
@@ -343,11 +343,11 @@
|
||||
"lv": 7,
|
||||
"type": 3,
|
||||
"image_id": "&",
|
||||
"limit": "最强6人战力达4000000",
|
||||
"limit": "最强6人战力达5000000",
|
||||
"limitType": 3,
|
||||
"limitParams": 4000000,
|
||||
"limitParams": 5000000,
|
||||
"value": "3&400",
|
||||
"sum": 500,
|
||||
"sum": 200,
|
||||
"size": "&"
|
||||
},
|
||||
{
|
||||
@@ -356,11 +356,11 @@
|
||||
"lv": 8,
|
||||
"type": 3,
|
||||
"image_id": "&",
|
||||
"limit": "最强6人战力达4500000",
|
||||
"limit": "最强6人战力达6000000",
|
||||
"limitType": 3,
|
||||
"limitParams": 4500000,
|
||||
"limitParams": 6000000,
|
||||
"value": "3&450",
|
||||
"sum": 500,
|
||||
"sum": 200,
|
||||
"size": "&"
|
||||
},
|
||||
{
|
||||
@@ -369,11 +369,11 @@
|
||||
"lv": 9,
|
||||
"type": 3,
|
||||
"image_id": "&",
|
||||
"limit": "最强6人战力达5000000",
|
||||
"limit": "最强6人战力达7000000",
|
||||
"limitType": 3,
|
||||
"limitParams": 5000000,
|
||||
"limitParams": 7000000,
|
||||
"value": "3&500",
|
||||
"sum": 500,
|
||||
"sum": 200,
|
||||
"size": "&"
|
||||
},
|
||||
{
|
||||
@@ -382,11 +382,11 @@
|
||||
"lv": 10,
|
||||
"type": 3,
|
||||
"image_id": "&",
|
||||
"limit": "最强6人战力达6000000",
|
||||
"limit": "最强6人战力达9000000",
|
||||
"limitType": 3,
|
||||
"limitParams": 6000000,
|
||||
"limitParams": 9000000,
|
||||
"value": "3&600",
|
||||
"sum": 500,
|
||||
"sum": 200,
|
||||
"size": "&"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user