✨ feat(限时排行榜): 修复限时排行榜奖励发放
This commit is contained in:
@@ -94,7 +94,7 @@ export class TimeLimitRankHandler {
|
||||
let serverTime = await getServerCreateTime(serverId);
|
||||
let playerData = new TimeLimitRankData(activityData, 0, serverTime);
|
||||
if(!playerData.needSnapshot) return resResult(STATUS.WRONG_PARMS);
|
||||
await takeSnapshot(playerData, activityData.groupId);
|
||||
await takeSnapshot(playerData, serverId);
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,10 @@ import { setApiIsClose } from '../../../services/chatService';
|
||||
import { setPvpSeasonNum, setPvpSettleSeasonNum } from '../../../services/timeTaskService';
|
||||
import { setKvToMemory } from '../../../services/pushService';
|
||||
import { setHiddenData } from '../../../services/memoryCache/hiddenData';
|
||||
import { DEBUG_MAGIC_WORD, MAIL_TYPE } from '../../../consts';
|
||||
import { ActivityTimeLimitRankModel } from '../../../db/ActivityTimeLimitRank';
|
||||
import { RoleModel } from '../../../db/Role';
|
||||
import { sendMailToManyPlayerByContent } from '../../../services/mailService';
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
@@ -168,4 +172,29 @@ export class RoleRemote {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async repairTimeLimitRank(magicWord: string, activityId: number, serverIds: number[], ridRoleIds: string[]) {
|
||||
try {
|
||||
if(magicWord != DEBUG_MAGIC_WORD) return;
|
||||
|
||||
for(let serverId of serverIds) {
|
||||
let allRanks = await ActivityTimeLimitRankModel.getRank(serverId, activityId);
|
||||
let roles = await RoleModel.findAllRoleForTimeLimitRank(serverId, 16);
|
||||
let roleIds: string[] = [];
|
||||
|
||||
for(let { roleId } of roles) {
|
||||
let index = allRanks.findIndex(cur => cur.roleId == roleId);
|
||||
if(index == -1 && ridRoleIds.indexOf(roleId) == -1) roleIds.push(roleId);
|
||||
}
|
||||
await sendMailToManyPlayerByContent(MAIL_TYPE.TIME_LIMIT_RANK, roleIds, {
|
||||
params: ['战力', '200+'],
|
||||
goods: [{ id: 71002, count: 40 }, { id: 31002, count: 500 }]
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user