mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 06:50:43 -05:00
ProfileFixerService Refactor (!391)
Refactor to remove legacy code that bloats the `ProfileFixerService` class. Most of which is old profile porting code, some being old profile fixes. Organizes code in the class so that public members are at the top (as they should be). Finally break out some code into their own methods so they're not in the primary method for the class `checkForAndFixPmcProfileIssues`. I have tested this with a developer profile, an EOD profile and a Standard profile. I've encountered no issues in my own testing. Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com> Reviewed-on: SPT/Server#391 Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com> Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
This commit is contained in:
parent
2fbcee22bd
commit
967dc15564
@ -180,16 +180,7 @@ export class GameController {
|
||||
this.splitBotWavesIntoSingleWaves();
|
||||
}
|
||||
|
||||
this.profileFixerService.removeLegacyScavCaseProductionCrafts(pmcProfile);
|
||||
|
||||
this.profileFixerService.addMissingHideoutAreasToProfile(fullProfile);
|
||||
|
||||
if (pmcProfile.Inventory) {
|
||||
// MUST occur prior to `profileFixerService.checkForAndFixPmcProfileIssues()`
|
||||
this.profileFixerService.fixIncorrectAidValue(fullProfile);
|
||||
|
||||
this.profileFixerService.migrateStatsToNewStructure(fullProfile);
|
||||
|
||||
this.sendPraporGiftsToNewProfiles(pmcProfile);
|
||||
|
||||
this.profileFixerService.checkForOrphanedModdedItems(sessionID, fullProfile);
|
||||
@ -197,15 +188,9 @@ export class GameController {
|
||||
|
||||
this.profileFixerService.checkForAndFixPmcProfileIssues(pmcProfile);
|
||||
|
||||
this.profileFixerService.addMissingSptVersionTagToProfile(fullProfile);
|
||||
|
||||
if (pmcProfile.Hideout) {
|
||||
this.profileFixerService.addMissingHideoutBonusesToProfile(pmcProfile);
|
||||
this.profileFixerService.addMissingUpgradesPropertyToHideout(pmcProfile);
|
||||
this.hideoutHelper.setHideoutImprovementsToCompleted(pmcProfile);
|
||||
this.hideoutHelper.unlockHideoutWallInProfile(pmcProfile);
|
||||
this.profileFixerService.addMissingIdsToBonuses(pmcProfile);
|
||||
this.profileFixerService.fixBitcoinProductionTime(pmcProfile);
|
||||
}
|
||||
|
||||
this.logProfileDetails(fullProfile);
|
||||
|
@ -186,7 +186,6 @@ export class ProfileController {
|
||||
};
|
||||
|
||||
this.profileFixerService.checkForAndFixPmcProfileIssues(profileDetails.characters.pmc);
|
||||
this.profileFixerService.addMissingHideoutBonusesToProfile(profileDetails.characters.pmc);
|
||||
|
||||
this.saveServer.addProfile(profileDetails);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user