Extract coder into function from updateProfileBaseState + log nickname on game start

This commit is contained in:
Dev 2023-07-15 11:03:54 +01:00
parent ee3766aad3
commit 7a1140c229
2 changed files with 10 additions and 5 deletions

View File

@ -97,7 +97,7 @@ export class GameController
const fullProfile = this.profileHelper.getFullProfile(sessionID);
const pmcProfile = fullProfile.characters.pmc;
this.logger.debug(`Started game with sessionId: ${sessionID}`);
this.logger.debug(`Started game with sessionId: ${sessionID} ${pmcProfile.Info?.Nickname}`);
if (pmcProfile.Health)
{

View File

@ -126,10 +126,7 @@ export class InRaidHelper
public updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData
{
// remove old skill fatigue
for (const skill of saveProgressRequest.profile.Skills.Common)
{
skill.PointsEarnedDuringSession = 0.0;
}
this.resetSkillPointsEarnedDuringRaid(saveProgressRequest.profile);
// set profile data
profileData.Info.Level = saveProgressRequest.profile.Info.Level;
@ -161,6 +158,14 @@ export class InRaidHelper
return profileData;
}
protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void
{
for (const skill of profile.Skills.Common)
{
skill.PointsEarnedDuringSession = 0.0;
}
}
/**
* Take body part effects from client profile and apply to server profile
* @param saveProgressRequest post-raid request