活动:寻宝骑兵活动添加推送任务
This commit is contained in:
@@ -45,6 +45,33 @@ export async function treasureHuntActivity(serverId: number, roleId: string) {
|
||||
return playerData;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取活动数据
|
||||
*
|
||||
* @param {number} serverId 区Id
|
||||
* @param {number} type 活动类型 ACTIVITY_TYPE
|
||||
* @param {string} roleId 角色Id
|
||||
*
|
||||
*/
|
||||
|
||||
export async function treasureHuntTaskActivity(serverId: number, roleId: string) {
|
||||
let { huntActivityId, huntBeginTime, huntEndTime, huntRoundIndex, activityData } = await getTreasureHuntData(serverId);
|
||||
if (!activityData) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let playerData = new TreasureHuntData(activityData);
|
||||
playerData.beginTime = moment(huntBeginTime).valueOf();
|
||||
playerData.endTime = moment(huntEndTime).valueOf();
|
||||
playerData.todayIndex = deltaDays(moment(huntBeginTime).startOf('d').toDate(), new Date) + 1;;
|
||||
playerData.roundIndex = huntRoundIndex;
|
||||
|
||||
let playerTaskRecord: ActivityTreasureHuntTaskModelType[] = await ActivityTreasureHuntTaskModel.findDataByRoundIndex(serverId, activityData.activityId, roleId, huntRoundIndex);
|
||||
playerData.tasks.setPlayerTaskRecords(playerTaskRecord);
|
||||
return playerData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家活动数据
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user