Skip to main content
The Deno 2 Release Candidate is here
Learn more
class ProfileFixerService
import { ProfileFixerService } from "https://deno.land/x/sptaki@1.2.0/services/ProfileFixerService.d.ts";

Constructors

new
ProfileFixerService(
logger: ILogger,
watermark: Watermark,
hideoutHelper: HideoutHelper,
inventoryHelper: InventoryHelper,
traderHelper: TraderHelper,
profileHelper: ProfileHelper,
itemHelper: ItemHelper,
localisationService: LocalisationService,
timeUtil: TimeUtil,
jsonUtil: JsonUtil,
hashUtil: HashUtil,
databaseServer: DatabaseServer,
configServer: ConfigServer,
)

Properties

protected
configServer: ConfigServer
protected
coreConfig: ICoreConfig
protected
databaseServer: DatabaseServer
protected
hashUtil: HashUtil
protected
hideoutHelper: HideoutHelper
protected
inventoryHelper: InventoryHelper
protected
itemHelper: ItemHelper
protected
jsonUtil: JsonUtil
protected
localisationService: LocalisationService
protected
logger: ILogger
protected
profileHelper: ProfileHelper
protected
ragfairConfig: IRagfairConfig
protected
timeUtil: TimeUtil
protected
traderHelper: TraderHelper
protected
watermark: Watermark

Methods

protected
addEmptyObjectsToHideoutAreaSlots(
areaType: HideoutAreas,
emptyItemCount: number,
pmcProfile: IPmcData,
): void

add in objects equal to the number of slots

protected
addHideoutAreaStashes(pmcProfile: IPmcData): void
protected
addMissingBonusesProperty(pmcProfile: IPmcData): void
protected
addMissingHideoutWallAreas(pmcProfile: IPmcData): void
protected
addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void
protected
addMissingWallImprovements(pmcProfile: IPmcData): void

Some profiles have hideout maxed and therefore no improvements

protected
addObjectsToArray(count: number, slots: HideoutSlot[]): HideoutSlot[]
protected
addUnlockedInfoObjectIfMissing(pmcProfile: IPmcData): void
protected
ensureGunStandLevelsMatch(pmcProfile: IPmcData): void
protected
fixNullTraderNextResupply(pmcProfile: IPmcData): void

If someone has run a mod from pre-3.8.0, it results in an invalid nextResupply value Resolve this by setting the nextResupply to 0 if it's null

protected
fixNullTraderSalesSums(pmcProfile: IPmcData): void
protected
getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus
protected
migrateImprovements(pmcProfile: IPmcData): void

At some point the property name was changed,migrate data across to new name

protected
removeDanglingTaskConditionCounters(pmcProfile: IPmcData): void

Repeatable quests leave behind TaskConditionCounter objects that make the profile bloat with time, remove them

protected
removeOrphanedQuests(pmcProfile: IPmcData): void

After removing mods that add quests, the quest panel will break without removing these

A new property was added to slot items "locationIndex", if this is missing, the hideout slot item must be removed

Hideout slots need to be in a specific order, locationIndex in ascending order

protected
shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record<string, ITemplateItem>): boolean
protected
shouldRemoveWeaponEquipmentBuild(
buildType: string,
itemsDb: Record<string, ITemplateItem>,
): boolean
protected
updateProfileQuestDataValues(profile: IPmcData): void

Adjust profile quest status and statusTimers object values quest.status is numeric e.g. 2 quest.statusTimers keys are numeric as strings e.g. "2"

Add tag to profile to indicate when it was made

Iterate over associated profile template and check all hideout areas exist, add if not

Iterate over players hideout areas and find what's build, look for missing bonuses those areas give and add them if missing

addMissingIdsToBonuses(pmcProfile: IPmcData): void

26126 (7th August) requires bonuses to have an ID, these were not included in the default profile presets

Add Improvements object to hideout if missing - added in eft 13.0.21469

Find issues in the pmc profile data that may cause issues and fix them

Find issues in the scav profile data that may cause issues

checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void

Checks profile inventiory for items that do not exist inside the items db

3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found

fixIncorrectAidValue(fullProfile: IAkiProfile): void

3.7.0 moved AIDs to be numeric, old profiles need to be migrated We store the old AID value in new field sessionId

Attempt to fix common item issues that corrupt profiles

Bsg nested stats into a sub object called 'eft'

TODO - make this non-public - currently used by RepeatableQuestController Remove unused condition counters

These used to be used for storing scav case rewards, rewards are now generated on pickup