活动:寻宝骑兵活动固定关卡id
This commit is contained in:
@@ -15,6 +15,7 @@ import { RoleModel } from '../../db/Role';
|
||||
import { getActivitiesByType, getActivityById } from './activityService';
|
||||
import { getRoleCreateTime, getServerCreateTime } from '../redisService';
|
||||
import { handleCost } from '../role/rewardService';
|
||||
import { ActivityTreasureHuntChallengeModel } from '../../db/ActivityTreasureHuntChallenge';
|
||||
|
||||
/**
|
||||
* 获取活动数据
|
||||
@@ -170,6 +171,9 @@ export async function getPlayerTreasureHuntChallengeData(activityId: number, ser
|
||||
playerData.todayIndex = deltaDays(moment(huntBeginTime).startOf('d').toDate(), new Date) + 1;;
|
||||
playerData.roundIndex = huntRoundIndex;
|
||||
|
||||
let playerRecord = await ActivityTreasureHuntChallengeModel.findData(serverId, activityId, roleId, huntRoundIndex);
|
||||
playerData.challenge.setChallengeRecord(playerRecord)
|
||||
|
||||
return playerData;
|
||||
}
|
||||
|
||||
@@ -373,5 +377,9 @@ export async function treasureHuntChallengeConsume(serverId: number, roleId: str
|
||||
let consume = stringToConsumeParam(consumeStr)
|
||||
let resourceResult = await handleCost(roleId, sid, consume, ITEM_CHANGE_REASON.TREASURE_HUNT_CHALLENGE);
|
||||
if (!resourceResult) return false;
|
||||
|
||||
let warId = playerData.challenge.randomGK();
|
||||
await ActivityTreasureHuntChallengeModel.setWarId(serverId, huntActivityId, roleId, huntRoundIndex, warId);
|
||||
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user