军团:添加邀请红点和演武台功能
This commit is contained in:
@@ -22,7 +22,7 @@ import { nowSeconds, getZeroPoint } from '../pubUtils/timeUtil';
|
||||
import { getGachaList, getVisitedHeroList } from './activity/gachaService';
|
||||
import { getSchoolList } from './roleService';
|
||||
import { addRoleToGuildChannel } from './chatChannelService';
|
||||
import { getMyGuildInfo, getGuildWithRefActive, getUserGuildWithRefActive, getWishPool } from './guildService';
|
||||
import { getMyGuildInfo, getGuildWithRefActive, getUserGuildWithRefActive, getWishPool, getInvitationList } from './guildService';
|
||||
import { getAuction } from './auctionService';
|
||||
import { getGuildTrainInstance, getTrainBoxRewardsResult } from './guildTrainService';
|
||||
import { BossInstanceModel } from '../db/BossInstance';
|
||||
@@ -107,7 +107,8 @@ async function getModuleData(type: string, data: { role: RoleType, session: Fron
|
||||
case 'school':
|
||||
return await getSchoolList(roleId);
|
||||
case 'guild':
|
||||
return await guildResult;
|
||||
let invitation = await getInvitationList(roleId, '');
|
||||
return { ...guildResult, invitation };
|
||||
case 'auction':
|
||||
return hasGuild ? await getAuction(guildCode, session) : null;
|
||||
case 'train':
|
||||
|
||||
@@ -54,7 +54,7 @@ export function getRaceActivityObj() {
|
||||
* 定时任务,获得前一天的活跃玩家中位数武将战力
|
||||
*/
|
||||
export async function setMedianCe() {
|
||||
let servers = await ServerlistModel.getAllServerList();
|
||||
let servers = await ServerlistModel.findByEnv(pinus.app.get('env'));
|
||||
|
||||
for (let server of servers) {
|
||||
let medianRole = await RoleModel.getMedianRole(server.id);
|
||||
|
||||
@@ -38,10 +38,10 @@ export async function getBossInstanceInfoByData(bossInstance: BossInstanceType,
|
||||
let bossInfo = null;
|
||||
|
||||
if(bossInstance) {
|
||||
let { warId, ranks, bossHp, bossLv, encourageCnt } = bossInstance;
|
||||
let { warId, ranks, bossHp, bossTotalHp, bossLv, encourageCnt } = bossInstance;
|
||||
let dicBossBase = gameData.bossBaseByBossLv.get(bossLv);
|
||||
let rankInfo = getRanks(ranks, userGuild.roleId);
|
||||
bossInfo = { warId, ...rankInfo, bossHp, bossLv, encourageCnt, encourageMax: dicBossBase.encourageSum };
|
||||
bossInfo = { warId, ...rankInfo, bossHp, bossTotalHp, bossLv, encourageCnt, encourageMax: dicBossBase.encourageSum };
|
||||
}
|
||||
return { status, bossInfo, ...refObj }
|
||||
}
|
||||
|
||||
@@ -344,4 +344,15 @@ export function setUserGuildSession(session:FrontendOrBackendSession, myUserGuil
|
||||
session.push('guildCode', () => {});
|
||||
session.push('guildAuth', () => {});
|
||||
}
|
||||
}
|
||||
|
||||
export async function getInvitationList(roleId: string, lastApplyCode = '') {
|
||||
const result = await UserGuildApplyModel.findInviteByRole(roleId, lastApplyCode);
|
||||
const list = result.map(cur => {
|
||||
let guild = <GuildType>cur.guild;
|
||||
let leader = <RoleType>guild.leader;
|
||||
delete cur.guild;
|
||||
return { applyCode: cur.applyCode, ...guild, leader: leader.roleName };
|
||||
});
|
||||
return list;
|
||||
}
|
||||
Reference in New Issue
Block a user