Persist achievement data from client into server profile on raid end
This commit is contained in:
parent
eeaa593ea4
commit
c5bb09cce5
@ -229,6 +229,8 @@ export class InRaidHelper
|
|||||||
// Scav client data has standing values of 0 for all traders, DO NOT RUN ON SCAV RAIDS
|
// Scav client data has standing values of 0 for all traders, DO NOT RUN ON SCAV RAIDS
|
||||||
this.applyTraderStandingAdjustments(pmcData.TradersInfo, saveProgressRequest.profile.TradersInfo);
|
this.applyTraderStandingAdjustments(pmcData.TradersInfo, saveProgressRequest.profile.TradersInfo);
|
||||||
|
|
||||||
|
this.updateProfileAchievements(pmcData, saveProgressRequest.profile.Achievements);
|
||||||
|
|
||||||
this.profileFixerService.checkForAndFixPmcProfileIssues(pmcData);
|
this.profileFixerService.checkForAndFixPmcProfileIssues(pmcData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -466,6 +468,24 @@ export class InRaidHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transfer client achievements into profile
|
||||||
|
* @param profile Player pmc profile
|
||||||
|
* @param clientAchievements Achievements from client
|
||||||
|
*/
|
||||||
|
protected updateProfileAchievements(profile: IPmcData, clientAchievements: Record<string, number>): void
|
||||||
|
{
|
||||||
|
if (!profile.Achievements)
|
||||||
|
{
|
||||||
|
profile.Achievements = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const achievementId in clientAchievements)
|
||||||
|
{
|
||||||
|
profile.Achievements[achievementId] = clientAchievements[achievementId];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the SPT inraid location Profile property to 'none'
|
* Set the SPT inraid location Profile property to 'none'
|
||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user