活动:添加新任务类型

This commit is contained in:
qiaoxin
2021-06-04 18:35:29 +08:00
parent 2bf3122463
commit fe73748cd7
9 changed files with 116 additions and 25 deletions
@@ -24,8 +24,23 @@ export async function treasureHuntActivity(serverId: number, roleId: string) {
if (!activityData) {
return null;
}
let playerData = await getPlayerTreasureHuntData(activityData.activityId, serverId, roleId, huntRoundIndex, huntBeginTime, huntEndTime);
return playerData
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 playerTreasureFirstPageecord: ActivityTreasureHuntFirstPageModelType = await ActivityTreasureHuntFirstPageModel.findData(serverId, activityData.activityId, roleId, huntRoundIndex);
playerData.firstPage.setPlayerFirstPageRecord(playerTreasureFirstPageecord);
let playerShopRecord: ActivityTreasureHuntShopModelType = await ActivityTreasureHuntShopModel.findTreasureData(activityData.activityId, roleId, huntRoundIndex, playerData.todayIndex);
playerData.shop.setPlayerShopRecords(playerShopRecord);
let playerTaskRecord: ActivityTreasureHuntTaskModelType[] = await ActivityTreasureHuntTaskModel.findDataByRoundIndex(serverId, activityData.activityId, roleId, huntRoundIndex);
playerData.tasks.setPlayerTaskRecords(playerTaskRecord);
let playerTreasureShopRecord: ActivityTreasureHuntTreasureShopModelType = await ActivityTreasureHuntTreasureShopModel.findData(activityData.activityId, roleId, huntRoundIndex);
playerData.treasureShop.setPlayerTreasureShopRecords(playerTreasureShopRecord);
return playerData;
}
/**