0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 02:30:43 -05:00

Update to EFT.23122 and increment version to 3.5.7 (!95)

Co-authored-by: Dev <dev@noreply.dev.sp-tarkov.com>
Reviewed-on: SPT-AKI/Server#95
This commit is contained in:
chomp 2023-05-19 16:47:24 +00:00
parent 65ba6c1080
commit 65bcee7500
16 changed files with 60460 additions and 62746 deletions

View File

@ -1,7 +1,7 @@
{
"akiVersion": "3.5.6",
"akiVersion": "3.5.7",
"projectName": "SPT-AKI",
"compatibleTarkovVersion": "0.13.0.23043",
"compatibleTarkovVersion": "0.13.0.23122",
"serverName": "SPT Server",
"profileSaveIntervalSeconds": 15
}

File diff suppressed because it is too large Load Diff

View File

@ -136,7 +136,8 @@
"path": "",
"rcid": ""
},
"RequiredPlayerLevel": 0,
"RequiredPlayerLevelMin": 0,
"RequiredPlayerLevelMax": 100,
"Rules": "AvoidOwnPmc",
"SafeLocation": false,
"ScavMaxPlayersInGroup": 4,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -54,21 +54,23 @@ export class InsuranceController
{
const time = this.timeUtil.getTimestamp();
// Process each profile in turn
for (const sessionID in this.saveServer.getProfiles())
{
const insurance = this.saveServer.getProfile(sessionID).insurance;
let i = insurance.length;
let insuredItemCount = insurance.length;
// Skip profile with no insurance items
if (i === 0)
if (insuredItemCount === 0)
{
continue;
}
while (i-- > 0)
// Use count as array index
while (insuredItemCount-- > 0)
{
const insured = insurance[i];
const traderReturnChance = this.insuranceConfig.returnChancePercent[insured.traderId];
const insured = insurance[insuredItemCount];
// Return time not reached, skip
if (time < insured.scheduledTime)
@ -76,16 +78,13 @@ export class InsuranceController
continue;
}
// Gather up items that can fail
const slotIdsThatCanFail = this.insuranceConfig.slotIdsWithChanceOfNotReturning;
const toDelete = [];
// Items to be removed from inventory
const toDelete: string[] = [];
// Loop over insurance items
// Loop over insurance items, find items to delete from player inventory
for (const insuredItem of insured.items)
{
// Roll from 0 to 9999, then divide it by 100: 9999 = 99.99%
const returnChance = this.randomUtil.getInt(0, 9999) / 100;
if ((slotIdsThatCanFail.includes(insuredItem.slotId)) && returnChance >= traderReturnChance && !toDelete.includes(insuredItem._id))
if (this.itemShouldBeLost(insuredItem, insured.traderId, toDelete))
{
// Skip if not an item
const itemDetails = this.itemHelper.getItem(insuredItem._tpl);
@ -100,7 +99,7 @@ export class InsuranceController
continue;
}
// Remove item and its sub-items to prevent orphaned items
// Remove item and its sub-items to prevent orphans
toDelete.push(...this.itemHelper.findAndReturnChildrenByItems(insured.items, insuredItem._id));
}
}
@ -123,13 +122,30 @@ export class InsuranceController
this.dialogueHelper.addDialogueMessage(insured.traderId, insured.messageContent, sessionID, insured.items);
// Remove insurance package from profile now we've processed it
insurance.splice(i, 1);
insurance.splice(insuredItemCount, 1);
}
this.saveServer.getProfile(sessionID).insurance = insurance;
}
}
/**
* Should the passed in item be removed from player inventory
* @param insuredItem Insurued item to roll to lose
* @param traderId Trader the item was insured by
* @param itemsBeingDeleted All items to remove from player
* @returns True if item should be removed
*/
protected itemShouldBeLost(insuredItem: Item, traderId: string, itemsBeingDeleted: string[]): boolean
{
// Roll from 0 to 9999, then divide it by 100: 9999 = 99.99%
const returnChance = this.randomUtil.getInt(0, 9999) / 100;
const traderReturnChance = this.insuranceConfig.returnChancePercent[traderId];
const slotIdsThatCanFail = this.insuranceConfig.slotIdsWithChanceOfNotReturning;
return (slotIdsThatCanFail.includes(insuredItem.slotId)) && returnChance >= traderReturnChance && !itemsBeingDeleted.includes(insuredItem._id);
}
/**
* Add insurance to an item
* @param pmcData Player profile

View File

@ -275,28 +275,24 @@ export class ScavCaseRewardGenerator
*/
protected getScavCaseRewardCountsAndPrices(scavCaseDetails: IHideoutScavCase): ScavCaseRewardCountsAndPrices
{
return {
common: {
minCount: scavCaseDetails.EndProducts["Common"].min,
maxCount: scavCaseDetails.EndProducts["Common"].max,
minPriceRub: this.scavCaseConfig.rewardItemValueRangeRub["common"].min,
maxPriceRub: this.scavCaseConfig.rewardItemValueRangeRub["common"].max
},
rare: {
minCount: scavCaseDetails.EndProducts["Rare"].min,
maxCount: scavCaseDetails.EndProducts["Rare"].max,
minPriceRub: this.scavCaseConfig.rewardItemValueRangeRub["rare"].min,
maxPriceRub: this.scavCaseConfig.rewardItemValueRangeRub["rare"].max
},
superrare: {
minCount: scavCaseDetails.EndProducts["Superrare"].min,
maxCount: scavCaseDetails.EndProducts["Superrare"].max,
minPriceRub: this.scavCaseConfig.rewardItemValueRangeRub["superrare"].min,
maxPriceRub: this.scavCaseConfig.rewardItemValueRangeRub["superrare"].max
}
const rewardTypes: (keyof ScavCaseRewardCountsAndPrices)[] = ["common", "rare", "superrare"];
const result: Partial<ScavCaseRewardCountsAndPrices> = {};
// Create reward min/max counts for each type
for (const rewardType of rewardTypes)
{
result[rewardType] =
{
minCount: scavCaseDetails.EndProducts[rewardType].min,
maxCount: scavCaseDetails.EndProducts[rewardType].max,
minPriceRub: this.scavCaseConfig.rewardItemValueRangeRub[rewardType].min,
maxPriceRub: this.scavCaseConfig.rewardItemValueRangeRub[rewardType].max
};
}
return result as ScavCaseRewardCountsAndPrices;
}
/**
* Randomises the size of ammo and money stacks
* @param itemToCalculate ammo or money item

View File

@ -98,18 +98,16 @@ export class BotDifficultyHelper
*/
public convertBotDifficultyDropdownToBotDifficulty(dropDownDifficulty: string): string
{
if (dropDownDifficulty.toLowerCase() === "medium")
switch (dropDownDifficulty.toLowerCase())
{
case "medium":
return "normal";
}
if (dropDownDifficulty.toLowerCase() === "random")
{
case "random":
return this.chooseRandomDifficulty();
}
default:
return dropDownDifficulty.toLowerCase();
}
}
/**
* Choose a random difficulty from - easy/normal/hard/impossible

View File

@ -241,6 +241,13 @@ class ItemHelper
return [false, undefined];
}
public isItemInDb(tpl: string): boolean
{
const itemDetails = this.getItem(tpl);
return itemDetails[0];
}
/**
* get normalized value (0-1) based on item condition
* @param item

View File

@ -51,7 +51,9 @@ export interface ILocationBase
OldSpawn: boolean
OpenZones: string
Preview: Preview
RequiredPlayerLevel: number
RequiredPlayerLevelMin: number
RequiredPlayerLevelMax: number
MinPlayerLvlAccessKeys: number
PmcMaxPlayersInGroup: number
ScavMaxPlayersInGroup: number
Rules: string