mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
Added ability to control storage time of insurance returns to insurance.json
config
This commit is contained in:
parent
30db370423
commit
d519907566
@ -6,6 +6,7 @@
|
||||
"blacklistedEquipment": ["SpecialSlot1", "SpecialSlot2", "SpecialSlot3"],
|
||||
"slotIdsToAlwaysRemove": ["cartridges", "patron_in_weapon"],
|
||||
"returnTimeOverrideSeconds": 0,
|
||||
"storageTimeOverrideSeconds": 0,
|
||||
"runIntervalSeconds": 600,
|
||||
"minAttachmentRoublePriceToBeTaken": 2000,
|
||||
"chanceNoAttachmentsTakenPercent": 10,
|
||||
|
@ -8,8 +8,10 @@ export interface IInsuranceConfig extends IBaseConfig {
|
||||
blacklistedEquipment: string[];
|
||||
/** Some slots should always be removed, e.g. 'cartridges' */
|
||||
slotIdsToAlwaysRemove: string[];
|
||||
/** Override to control how quickly insurance is processed/returned in second */
|
||||
/** Override to control how quickly insurance is processed/returned in seconds */
|
||||
returnTimeOverrideSeconds: number;
|
||||
/** Override to control how long insurance returns stay in mail before expiring - in seconds */
|
||||
storageTimeOverrideSeconds: number;
|
||||
/** How often server should process insurance in seconds */
|
||||
runIntervalSeconds: number;
|
||||
// Lowest rouble price for an attachment to be allowed to be taken
|
||||
|
@ -114,7 +114,7 @@ export class InsuranceService {
|
||||
this.saveServer.getProfile(sessionID).insurance.push({
|
||||
scheduledTime: this.getInsuranceReturnTimestamp(pmcData, traderBase),
|
||||
traderId: traderId,
|
||||
maxStorageTime: this.timeUtil.getHoursAsSeconds(traderBase.insurance.max_storage_time),
|
||||
maxStorageTime: this.getMaxInsuranceStorageTime(traderBase),
|
||||
systemData: systemData,
|
||||
messageType: MessageType.INSURANCE_RETURN,
|
||||
messageTemplateId: this.randomUtil.getArrayValue(dialogueTemplates.insuranceFound),
|
||||
@ -191,6 +191,15 @@ export class InsuranceService {
|
||||
}
|
||||
}
|
||||
|
||||
protected getMaxInsuranceStorageTime(traderBase: ITraderBase): number {
|
||||
if (this.insuranceConfig.storageTimeOverrideSeconds > 0) {
|
||||
// Override exists, use instead of traders value
|
||||
return this.insuranceConfig.storageTimeOverrideSeconds;
|
||||
}
|
||||
|
||||
return this.timeUtil.getHoursAsSeconds(traderBase.insurance.max_storage_time);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store lost gear post-raid inside profile, ready for later code to pick it up and mail it
|
||||
* @param equipmentPkg Gear to store - generated by getGearLostInRaid()
|
||||
|
Loading…
x
Reference in New Issue
Block a user