From 5e1da93a69b80cb35411d6020ea4a79daa119163 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 3 Feb 2024 14:39:37 +0000 Subject: [PATCH] Allow seasonal events to trigger after profile creation --- project/src/controllers/ProfileController.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/project/src/controllers/ProfileController.ts b/project/src/controllers/ProfileController.ts index 9f0cefc0..717c6a31 100644 --- a/project/src/controllers/ProfileController.ts +++ b/project/src/controllers/ProfileController.ts @@ -12,7 +12,6 @@ import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEve import { IMiniProfile } from "@spt-aki/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; import { IAkiProfile, Inraid, Vitality } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ICompletedAchievementsResponse } from "@spt-aki/models/eft/profile/ICompletedAchievementsResponse"; import { IGetOtherProfileRequest } from "@spt-aki/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt-aki/models/eft/profile/IGetOtherProfileResponse"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; @@ -21,7 +20,6 @@ import { IProfileCreateRequestData } from "@spt-aki/models/eft/profile/IProfileC import { ISearchFriendRequestData } from "@spt-aki/models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "@spt-aki/models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; -import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { QuestStatus } from "@spt-aki/models/enums/QuestStatus"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -31,6 +29,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; +import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -46,6 +45,7 @@ export class ProfileController @inject("ItemHelper") protected itemHelper: ItemHelper, @inject("ProfileFixerService") protected profileFixerService: ProfileFixerService, @inject("LocalisationService") protected localisationService: LocalisationService, + @inject("SeasonalEventService") protected seasonalEventService: SeasonalEventService, @inject("MailSendService") protected mailSendService: MailSendService, @inject("PlayerScavGenerator") protected playerScavGenerator: PlayerScavGenerator, @inject("EventOutputHolder") protected eventOutputHolder: EventOutputHolder, @@ -226,6 +226,12 @@ export class ProfileController this.saveServer.getProfile(sessionID).info.wipe = false; this.saveServer.saveProfile(sessionID); + // Requires to enable seasonal changes after creating fresh profile + if (this.seasonalEventService.isAutomaticEventDetectionEnabled()) + { + this.seasonalEventService.enableSeasonalEvents(sessionID); + } + return pmcData._id; }