红点:修复pvp推送
This commit is contained in:
@@ -57,7 +57,9 @@ export async function pushData(role: RoleType, session: FrontendOrBackendSession
|
|||||||
for(let type of modules) {
|
for(let type of modules) {
|
||||||
if(notIncludeModule.indexOf(type) == -1) {
|
if(notIncludeModule.indexOf(type) == -1) {
|
||||||
let data = await getModuleData(type, { role, session }, guildData);
|
let data = await getModuleData(type, { role, session }, guildData);
|
||||||
pushEntryData(type, roleId, sid, data);
|
if(data) {
|
||||||
|
pushEntryData(type, roleId, sid, data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pushEntryEnd(roleId, sid);
|
pushEntryEnd(roleId, sid);
|
||||||
@@ -171,18 +173,14 @@ async function getTowerEntryData(role: RoleType) {
|
|||||||
* @param roleId
|
* @param roleId
|
||||||
*/
|
*/
|
||||||
async function getPvpEntryData(roleId: string) {
|
async function getPvpEntryData(roleId: string) {
|
||||||
let pvpSeasonResult = await PvpSeasonResultModel.getPvpSeasonResult(roleId);
|
|
||||||
if(!pvpSeasonResult) return false;
|
|
||||||
|
|
||||||
let { oldSeasonData, show} = pvpSeasonResult;
|
|
||||||
// 旧赛季结算的时候,会在pvpSeasonResult表中存上一赛季的时间,并更新show字段
|
|
||||||
let hasSeasonReward = oldSeasonData.seasonEndTime <= nowSeconds() && show;
|
|
||||||
let pvpDefense = await PvpDefenseModel.findByRoleIdIncludeAll(roleId);
|
let pvpDefense = await PvpDefenseModel.findByRoleIdIncludeAll(roleId);
|
||||||
if(pvpDefense) {
|
if(pvpDefense) {
|
||||||
let { pvpDefense, } = await findPvpDefAllByRoleId(roleId);
|
let { pvpDefense, } = await findPvpDefAllByRoleId(roleId);
|
||||||
let { challengeCnt, receivedBox, score } = pvpDefense;
|
let { challengeCnt, receivedBox, score, hisScore } = pvpDefense;
|
||||||
|
|
||||||
return { hasSeasonReward, challengeCnt, score, receivedBox }
|
return { challengeCnt, score, hisScore, receivedBox }
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user