Reset money transfer limit of player when they have reached/passed the nextResetTime
value
This commit is contained in:
parent
1ba795cf66
commit
c1526a4ad3
@ -1,6 +1,11 @@
|
|||||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||||
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||||
import { IHideoutImprovement, Productive, TraderInfo } from "@spt/models/eft/common/tables/IBotBase";
|
import {
|
||||||
|
IHideoutImprovement,
|
||||||
|
IMoneyTransferLimits,
|
||||||
|
Productive,
|
||||||
|
TraderInfo,
|
||||||
|
} from "@spt/models/eft/common/tables/IBotBase";
|
||||||
import { ProfileChange, TraderData } from "@spt/models/eft/itemEvent/IItemEventRouterBase";
|
import { ProfileChange, TraderData } from "@spt/models/eft/itemEvent/IItemEventRouterBase";
|
||||||
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||||
import { TimeUtil } from "@spt/utils/TimeUtil";
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
@ -79,12 +84,20 @@ export class EventOutputHolder {
|
|||||||
profileChanges.improvements = this.cloner.clone(this.getImprovementsFromProfileAndFlagComplete(pmcData));
|
profileChanges.improvements = this.cloner.clone(this.getImprovementsFromProfileAndFlagComplete(pmcData));
|
||||||
profileChanges.traderRelations = this.constructTraderRelations(pmcData.TradersInfo);
|
profileChanges.traderRelations = this.constructTraderRelations(pmcData.TradersInfo);
|
||||||
|
|
||||||
|
this.resetMoneyTransferLimit(pmcData.moneyTransferLimitData);
|
||||||
profileChanges.moneyTransferLimitData = pmcData.moneyTransferLimitData;
|
profileChanges.moneyTransferLimitData = pmcData.moneyTransferLimitData;
|
||||||
|
|
||||||
// Fixes container craft from water collector not resetting after collection + removed completed normal crafts
|
// Fixes container craft from water collector not resetting after collection + removed completed normal crafts
|
||||||
this.cleanUpCompleteCraftsInProfile(pmcData.Hideout.Production);
|
this.cleanUpCompleteCraftsInProfile(pmcData.Hideout.Production);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected resetMoneyTransferLimit(limit: IMoneyTransferLimits) {
|
||||||
|
if (limit.nextResetTime < this.timeUtil.getTimestamp()) {
|
||||||
|
limit.nextResetTime = this.timeUtil.getTimeStampFromNowDays(1);
|
||||||
|
limit.remainingLimit = limit.totalLimit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert the internal trader data object into an object we can send to the client
|
* Convert the internal trader data object into an object we can send to the client
|
||||||
* @param traderData server data for traders
|
* @param traderData server data for traders
|
||||||
|
Loading…
x
Reference in New Issue
Block a user