活动:大富翁
This commit is contained in:
@@ -48,6 +48,23 @@ export async function getPlayerRefreshShopData(activityId: number, serverId: num
|
||||
return playerData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家商店数据(指定回合数,大富翁商店每回合刷新)
|
||||
*
|
||||
* @param {number} serverId 区Id
|
||||
* @param {number} activityId 活动Id
|
||||
* @param {string} roleId 角色Id
|
||||
*
|
||||
*/
|
||||
export async function getPlayerRefreshShopDataByRoundIndex(activityId: number, serverId: number, roleId: string, roundIndex: number) {
|
||||
let activityData: ActivityModelType = await ActivityModel.findActivity(activityId);
|
||||
let playerData = new RefreshShopData(activityData);
|
||||
playerData.roundIndex = roundIndex;
|
||||
let playerRecord: ActivityRefreshShopModelType = await ActivityRefreshShopModel.findData(activityId, roleId, playerData.roundIndex);
|
||||
playerData.setPlayerRecords(playerRecord);
|
||||
return playerData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家活动第几天
|
||||
*
|
||||
@@ -73,10 +90,11 @@ export async function newPlayerActivityDays(roleId: string) {
|
||||
* @param {number} activityId 活动Id
|
||||
* @param {string} roleId 角色Id
|
||||
* @param {string} productID 商品ID
|
||||
* @param {number} roundIndex 大富翁重置回合数
|
||||
*
|
||||
*/
|
||||
export async function makeRefreshPackageReward(roleId: string, roleName: string, sid: string, serverId: number, funcs: number[],
|
||||
activityId: number, productID: string) {
|
||||
export async function makeRefreshShopReward(roleId: string, roleName: string, sid: string, serverId: number, funcs: number[],
|
||||
activityId: number, productID: string, roundIndex: number) {
|
||||
let activityData: ActivityModelType = await ActivityModel.findActivity(activityId);
|
||||
if (!activityData) {
|
||||
return STATUS.ACTIVITY_MISSING;
|
||||
@@ -85,6 +103,9 @@ export async function makeRefreshPackageReward(roleId: string, roleName: string,
|
||||
return STATUS.ACTIVITY_TYPE_ERROR;
|
||||
}
|
||||
let playerData = new RefreshShopData(activityData);
|
||||
if (roundIndex) {
|
||||
playerData.roundIndex = roundIndex;
|
||||
}
|
||||
|
||||
let playerRecord: ActivityRefreshShopModelType = await ActivityRefreshShopModel.findData(activityData.activityId, roleId, playerData.roundIndex);
|
||||
playerData.setPlayerRecords(playerRecord);
|
||||
|
||||
Reference in New Issue
Block a user