✨ feat(comBattle): 寻宝邀请的推送范围由世界改为军团

This commit is contained in:
liangtongchuan
2023-03-14 11:56:28 +08:00
parent b3c5aa9236
commit 37af7c570a
5 changed files with 17 additions and 15 deletions
+4 -6
View File
@@ -419,12 +419,10 @@ export async function delPrivateMsg(roleId: string, targetRoleId: string) {
* @description 发送组队一键邀请消息
* @param {string} teamCode 队伍唯一标识
*/
export async function pushTeamInviteMsg(roleId: string, roleName: string, serverId: number, teamCode: string, blueprtId: number, blueprtLv: number, ceLimit: number) {
let msgDataWorld = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.WORLD, `${serverId}`, MSG_TYPE.RICH_TEXT, MSG_SOURCE.TEAM_INVITE, JSON.stringify({ roleName, teamCode, blueprtId }), null, null);
await pushGroupMsgToAll(msgDataWorld, (data: {lv: number, topLineupCe: number}) => {
return data.topLineupCe >= ceLimit && !comBtlLvInvalid(data.lv, [blueprtLv]);
});
return { msgDataWorld };
export async function pushTeamInviteMsg(roleId: string, roleName: string, guildCode: string, teamCode: string, blueprtId: number, blueprtLv: number, ceLimit: number) {
let msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.GUILD, guildCode, MSG_TYPE.RICH_TEXT, MSG_SOURCE.TEAM_INVITE, JSON.stringify({ roleName, teamCode, blueprtId }), null, null);
await pushGroupMsgToRoom(msgData);
return { msgData };
}
/**
+3 -3
View File
@@ -158,7 +158,7 @@ export async function getModuleData(type: string, data: { role: RoleType, sessio
case 'tower': // 镇念塔
return await getTowerEntryData(role);
case 'comBattle': // 寻宝
return await getComBattleEntryData(role);
return await getComBattleEntryData(role, guildCode);
case 'dungeon': // 秘境
return await getDungeonData(role);
case 'pvp': // pvp
@@ -312,13 +312,13 @@ async function getGuildEntryData(role: RoleType, sid: string, session: FrontendO
return { hasGuild: false }
}
async function getComBattleEntryData(role: RoleType) {
async function getComBattleEntryData(role: RoleType, guildCode: string) {
let { roleId, lv, topLineupCe } = role;
const assistCnt = await getAllAssistCnt(roleId);
const blueprts = await Item.findByRoleAndType(roleId, CONSUME_TYPE.BLUEPRT);
let { minLv, maxLv } = getComBtlLvByPlayerLv(lv);
let refreshTime = nowSeconds() - INFO_WINDOW.TEAM_INFORMATION_TIME;
const invitations = await ComBattleTeamModel.findInvitations(roleId, minLv, maxLv, topLineupCe, refreshTime, 1);
const invitations = await ComBattleTeamModel.findInvitations(roleId, guildCode, minLv, maxLv, topLineupCe, refreshTime, 1);
let capExtraCnt = await getCapExtraCnt(roleId);
return { assistCnt, blueprts, hasInvitation: invitations.length > 0, invitationTime: invitations.length > 0?invitations[0].inviteTime: 0, capExtraCnt }
}