Cleanup of setHideoutAreasAndCraftsTo40Secs
to more central location
This commit is contained in:
parent
48e6f3052d
commit
1a9dc1ea2b
@ -1,7 +1,7 @@
|
|||||||
import { inject, injectable } from "tsyringe";
|
import { inject, injectable } from "tsyringe";
|
||||||
|
|
||||||
import { GameController } from "@spt-aki/controllers/GameController";
|
|
||||||
import { ProfileController } from "@spt-aki/controllers/ProfileController";
|
import { ProfileController } from "@spt-aki/controllers/ProfileController";
|
||||||
|
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||||
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||||
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||||
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
|
||||||
@ -20,7 +20,6 @@ import { ISearchFriendResponse } from "@spt-aki/models/eft/profile/ISearchFriend
|
|||||||
import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData";
|
import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData";
|
||||||
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
|
||||||
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
|
||||||
|
|
||||||
/** Handle profile related client events */
|
/** Handle profile related client events */
|
||||||
@injectable()
|
@injectable()
|
||||||
@ -30,8 +29,7 @@ export class ProfileCallbacks
|
|||||||
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
|
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
|
||||||
@inject("TimeUtil") protected timeUtil: TimeUtil,
|
@inject("TimeUtil") protected timeUtil: TimeUtil,
|
||||||
@inject("ProfileController") protected profileController: ProfileController,
|
@inject("ProfileController") protected profileController: ProfileController,
|
||||||
@inject("GameController") protected gameController: GameController,
|
@inject("ProfileHelper") protected profileHelper: ProfileHelper,
|
||||||
@inject("ProfileHelper") protected profileHelper: ProfileHelper
|
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -45,7 +43,6 @@ export class ProfileCallbacks
|
|||||||
): IGetBodyResponseData<ICreateProfileResponse>
|
): IGetBodyResponseData<ICreateProfileResponse>
|
||||||
{
|
{
|
||||||
const id = this.profileController.createProfile(info, sessionID);
|
const id = this.profileController.createProfile(info, sessionID);
|
||||||
this.gameController.setHideoutAreasAndCraftsTo40Secs(this.profileHelper.getFullProfile(id));
|
|
||||||
return this.httpResponse.getBody({ uid: id });
|
return this.httpResponse.getBody({ uid: id });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@ import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeReques
|
|||||||
import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse";
|
import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse";
|
||||||
import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails";
|
import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails";
|
||||||
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
|
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
import { AccountTypes } from "@spt-aki/models/enums/AccountTypes";
|
|
||||||
import { BonusType } from "@spt-aki/models/enums/BonusType";
|
import { BonusType } from "@spt-aki/models/enums/BonusType";
|
||||||
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
|
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
|
||||||
import { SkillTypes } from "@spt-aki/models/enums/SkillTypes";
|
import { SkillTypes } from "@spt-aki/models/enums/SkillTypes";
|
||||||
@ -158,8 +157,8 @@ export class GameController
|
|||||||
{
|
{
|
||||||
this.updateProfileHealthValues(pmcProfile);
|
this.updateProfileHealthValues(pmcProfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setHideoutAreasAndCraftsTo40Secs(fullProfile);
|
this.profileFixerService.setHideoutAreasAndCraftsTo40Secs(fullProfile);
|
||||||
|
|
||||||
if (this.locationConfig.fixEmptyBotWavesSettings.enabled)
|
if (this.locationConfig.fixEmptyBotWavesSettings.enabled)
|
||||||
{
|
{
|
||||||
@ -353,45 +352,6 @@ export class GameController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public setHideoutAreasAndCraftsTo40Secs(fullProfile: IAkiProfile): void
|
|
||||||
{
|
|
||||||
if (!fullProfile.info.edition.toLowerCase().startsWith(AccountTypes.SPT_DEVELOPER))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const hideoutProd of this.databaseServer.getTables().hideout.production)
|
|
||||||
{
|
|
||||||
if (hideoutProd.productionTime > 40)
|
|
||||||
{
|
|
||||||
hideoutProd.productionTime = 40;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.logger.warning("DEVELOPER: SETTING ALL HIDEOUT PRODUCTIONS TO 40 SECONDS");
|
|
||||||
|
|
||||||
for (const hideoutArea of this.databaseServer.getTables().hideout.areas)
|
|
||||||
{
|
|
||||||
for (const stageKey in hideoutArea.stages)
|
|
||||||
{
|
|
||||||
const stage = hideoutArea.stages[stageKey];
|
|
||||||
if (stage.constructionTime > 40)
|
|
||||||
{
|
|
||||||
stage.constructionTime = 40;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.logger.warning("DEVELOPER: SETTING ALL HIDEOUT AREAS TO 40 SECOND UPGRADES");
|
|
||||||
|
|
||||||
for (const scavCaseCraft of this.databaseServer.getTables().hideout.scavcase)
|
|
||||||
{
|
|
||||||
if (scavCaseCraft.ProductionTime > 40)
|
|
||||||
{
|
|
||||||
scavCaseCraft.ProductionTime = 40;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.logger.warning("DEVELOPER: SETTING ALL SCAV CASES TO 40 SECONDS");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */
|
/** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */
|
||||||
protected adjustMapBotLimits(): void
|
protected adjustMapBotLimits(): void
|
||||||
{
|
{
|
||||||
|
@ -232,6 +232,9 @@ export class ProfileController
|
|||||||
this.seasonalEventService.enableSeasonalEvents(sessionID);
|
this.seasonalEventService.enableSeasonalEvents(sessionID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fullProfile = this.profileHelper.getFullProfile(account.id);
|
||||||
|
this.profileFixerService.setHideoutAreasAndCraftsTo40Secs(fullProfile);
|
||||||
|
|
||||||
return pmcData._id;
|
return pmcData._id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import { IHideoutImprovement } from "@spt-aki/models/eft/common/tables/IBotBase"
|
|||||||
import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
|
import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
|
||||||
import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea";
|
import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea";
|
||||||
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
|
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
|
import { AccountTypes } from "@spt-aki/models/enums/AccountTypes";
|
||||||
import { BonusType } from "@spt-aki/models/enums/BonusType";
|
import { BonusType } from "@spt-aki/models/enums/BonusType";
|
||||||
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
|
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
|
||||||
import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas";
|
import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas";
|
||||||
@ -1386,4 +1387,43 @@ export class ProfileFixerService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public setHideoutAreasAndCraftsTo40Secs(fullProfile: IAkiProfile): void
|
||||||
|
{
|
||||||
|
if (!fullProfile.info.edition.toLowerCase().startsWith(AccountTypes.SPT_DEVELOPER))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const hideoutProd of this.databaseServer.getTables().hideout.production)
|
||||||
|
{
|
||||||
|
if (hideoutProd.productionTime > 40)
|
||||||
|
{
|
||||||
|
hideoutProd.productionTime = 40;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.logger.warning("DEVELOPER: SETTING ALL HIDEOUT PRODUCTIONS TO 40 SECONDS");
|
||||||
|
|
||||||
|
for (const hideoutArea of this.databaseServer.getTables().hideout.areas)
|
||||||
|
{
|
||||||
|
for (const stageKey in hideoutArea.stages)
|
||||||
|
{
|
||||||
|
const stage = hideoutArea.stages[stageKey];
|
||||||
|
if (stage.constructionTime > 40)
|
||||||
|
{
|
||||||
|
stage.constructionTime = 40;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.logger.warning("DEVELOPER: SETTING ALL HIDEOUT AREAS TO 40 SECOND UPGRADES");
|
||||||
|
|
||||||
|
for (const scavCaseCraft of this.databaseServer.getTables().hideout.scavcase)
|
||||||
|
{
|
||||||
|
if (scavCaseCraft.ProductionTime > 40)
|
||||||
|
{
|
||||||
|
scavCaseCraft.ProductionTime = 40;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.logger.warning("DEVELOPER: SETTING ALL SCAV CASES TO 40 SECONDS");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user