Skip to content

Commit 7795c6d

Browse files
committed
Updates for SPT 3.11
1 parent ae8c97d commit 7795c6d

File tree

280 files changed

+2491
-1114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

280 files changed

+2491
-1114
lines changed

.github/ISSUE_TEMPLATE/GENERAL.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ body:
3030
label: SPT Version
3131
description: What version of SPT are you running?
3232
options:
33-
- 3.10
34-
- 3.9
35-
- 3.8
33+
- "3.11"
3634
validations:
3735
required: true
3836
- type: textarea

.github/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,18 @@ _\*Many of these options are configurable._
2323

2424
If you experience any problems, please [submit a detailed bug report](https://github.com/refringe/CustomRaidTimes/issues).
2525

26-
## To Build Locally:
26+
# To Build Locally:
2727

2828
This project has been built in [Visual Studio Code](https://code.visualstudio.com/) (VSC) using [Node.js](https://nodejs.org/). If you are unfamiliar with Node.js, I recommend using [NVM](https://github.com/nvm-sh/nvm) to manage installation and switching versions. If you do not wish to use NVM, you will need to install the version of Node.js listed within the `.nvmrc` file manually.
2929

30-
This project uses Biome to format code on save.
30+
This project uses [Biome](https://biomejs.dev/) to format code on save.
3131

3232
To build the project locally:
3333

3434
1. Clone the repository.
3535
2. Open the `mod.code-workspace` file in Visual Studio Code (VSC).
36-
3. Run `nvm use` in the terminal.
37-
4. Run `npm install` in the terminal.
38-
5. Run `npm run build` in the terminal.
36+
3. Install the [Biome](https://marketplace.visualstudio.com/items?itemName=biomejs.biome) VSC extension.
37+
4. Install the [JSON5](https://marketplace.visualstudio.com/items?itemName=mrmlnc.vscode-json5) VSC extension.
38+
5. Run `nvm use` in the terminal.
39+
6. Run `npm install` in the terminal.
40+
7. Run `npm run build` in the terminal.

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.11.1
1+
v22.12.0

package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "custom-raid-times",
3-
"version": "1.8.0",
3+
"version": "1.8.1",
44
"main": "src/CustomRaidTimes.js",
55
"license": "MIT",
66
"author": "Refringe",
7-
"sptVersion": "~3.10",
7+
"sptVersion": "~3.11",
88
"scripts": {
99
"setup": "npm i",
1010
"postinstall": "node ./postInstall.mjs",
@@ -19,12 +19,12 @@
1919
},
2020
"devDependencies": {
2121
"@biomejs/biome": "1.9.4",
22-
"@types/node": "22.10.10",
22+
"@types/node": "22.10.5",
2323
"archiver": "7.0.1",
24-
"fs-extra": "11.3.0",
24+
"fs-extra": "11.2.0",
2525
"ignore": "7.0.3",
2626
"tsyringe": "4.8.0",
27-
"typescript": "5.7.3",
27+
"typescript": "5.8.2",
2828
"winston": "3.17.0"
2929
}
3030
}

postInstall.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env node
22

33
/*
4-
* This script is used to remove the local tsyringe package when running inside the SPT-AKI project directory. This is
5-
* necessary because the local tsyringe package will override the SPT-AKI tsyringe package, which will cause dependency
4+
* This script is used to remove the local tsyringe package when running inside the SPT project directory. This is
5+
* necessary because the local tsyringe package will override the SPT tsyringe package, which will cause dependency
66
* injection to fail in a very confusing way, which will likely consume your afternoon and make you want to cry. :D
77
*/
88

src/CustomRaidTimes.ts

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { ILocationBase } from "@spt/models/eft/common/ILocationBase";
22
import { IGetRaidTimeRequest } from "@spt/models/eft/game/IGetRaidTimeRequest";
3-
import { IGetRaidTimeResponse } from "@spt/models/eft/game/IGetRaidTimeResponse";
43
import type { IPostDBLoadMod } from "@spt/models/external/IPostDBLoadMod";
54
import type { IPreSptLoadMod } from "@spt/models/external/IPreSptLoadMod";
5+
import { IRaidChanges } from "@spt/models/spt/location/IRaidChanges";
66
import type { ILogger } from "@spt/models/spt/utils/ILogger";
77
import { DatabaseService } from "@spt/services/DatabaseService";
88
import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService";
@@ -82,11 +82,8 @@ class CustomRaidTimes implements IPostDBLoadMod, IPreSptLoadMod {
8282
container.afterResolution(
8383
"RaidTimeAdjustmentService",
8484
(_t, result: RaidTimeAdjustmentService) => {
85-
result.getRaidAdjustments = (
86-
sessionId: string,
87-
request: IGetRaidTimeRequest,
88-
): IGetRaidTimeResponse => {
89-
return this.getRaidAdjustments(request);
85+
result.getRaidAdjustments = (sessionId: string, request: IGetRaidTimeRequest): IRaidChanges => {
86+
return this.getRaidAdjustments(sessionId, request);
9087
};
9188
},
9289
{ frequency: "Always" },
@@ -95,26 +92,33 @@ class CustomRaidTimes implements IPostDBLoadMod, IPreSptLoadMod {
9592
}
9693

9794
/**
98-
* Return the same response as the original method, even if you're a scav.
95+
* This method is used to override the default getRaidAdjustments method. This is only used if the `overrideScav`
96+
* setting in the configuration file is set to true. If this is not done, the user's custom times will be modified
97+
* from the times set in the configuration file possibly causing confusion.
98+
*
9999
* @override @spt/services/RaidTimeAdjustmentService.getRaidAdjustments
100100
*/
101-
private getRaidAdjustments(request: IGetRaidTimeRequest): IGetRaidTimeResponse {
101+
public getRaidAdjustments(sessionId: string, request: IGetRaidTimeRequest): IRaidChanges {
102102
const databaseService = this.container.resolve<DatabaseService>("DatabaseService");
103103

104104
const globals = databaseService.getGlobals();
105105
const mapBase: ILocationBase = databaseService.getLocation(request.Location.toLowerCase()).base;
106106
const baseEscapeTimeMinutes = mapBase.EscapeTimeLimit;
107107

108-
const result: IGetRaidTimeResponse = {
109-
RaidTimeMinutes: baseEscapeTimeMinutes,
110-
ExitChanges: [],
111-
NewSurviveTimeSeconds: undefined,
112-
OriginalSurvivalTimeSeconds: globals.config.exp.match_end.survived_seconds_requirement,
108+
// Prep result object to return
109+
const result: IRaidChanges = {
110+
newSurviveTimeSeconds: globals.config.exp.match_end.survived_seconds_requirement,
111+
originalSurvivalTimeSeconds: globals.config.exp.match_end.survived_seconds_requirement,
112+
dynamicLootPercent: 100,
113+
staticLootPercent: 100,
114+
simulatedRaidStartSeconds: 0,
115+
raidTimeMinutes: baseEscapeTimeMinutes,
116+
exitChanges: [],
113117
};
114118

115119
this.logger.log("CustomRaidTimes: The `getRaidAdjustments` override has been triggered.", "cyan");
116120

117-
return result;
121+
return result; // Return here regardless of side.
118122
}
119123

120124
/**

types/ProgramStatics.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { EntryType } from "./models/enums/EntryType";
2+
export declare class ProgramStatics {
3+
private static _ENTRY_TYPE;
4+
private static _DEBUG;
5+
private static _COMPILED;
6+
private static _MODS;
7+
private static _EXPECTED_NODE;
8+
private static _SPT_VERSION;
9+
private static _COMMIT;
10+
private static _BUILD_TIME;
11+
static initialize(): void;
12+
static get ENTRY_TYPE(): EntryType;
13+
static get DEBUG(): boolean;
14+
static get COMPILED(): boolean;
15+
static get MODS(): boolean;
16+
static get EXPECTED_NODE(): string;
17+
static get SPT_VERSION(): string;
18+
static get COMMIT(): string;
19+
static get BUILD_TIME(): number;
20+
}

types/callbacks/ClientLogCallbacks.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { ClientLogController } from "@spt/controllers/ClientLogController";
22
import { ModLoadOrder } from "@spt/loaders/ModLoadOrder";
33
import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData";
4+
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
5+
import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig";
6+
import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
47
import { IClientLogRequest } from "@spt/models/spt/logging/IClientLogRequest";
58
import { ConfigServer } from "@spt/servers/ConfigServer";
69
import { LocalisationService } from "@spt/services/LocalisationService";
@@ -12,6 +15,9 @@ export declare class ClientLogCallbacks {
1215
protected configServer: ConfigServer;
1316
protected localisationService: LocalisationService;
1417
protected modLoadOrder: ModLoadOrder;
18+
protected botConfig: IBotConfig;
19+
protected pmcConfig: IPmcConfig;
20+
protected insuranceConfig: IInsuranceConfig;
1521
constructor(httpResponse: HttpResponseUtil, clientLogController: ClientLogController, configServer: ConfigServer, localisationService: LocalisationService, modLoadOrder: ModLoadOrder);
1622
/**
1723
* Handle /singleplayer/log
@@ -25,4 +31,5 @@ export declare class ClientLogCallbacks {
2531
* Handle /singleplayer/enableBSGlogging
2632
*/
2733
bsgLogging(): string;
34+
private handleClientLog;
2835
}
Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { CustomizationController } from "@spt/controllers/CustomizationController";
2-
import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
3-
import { IPmcData } from "@spt/models/eft/common/IPmcData";
4-
import { ISuit } from "@spt/models/eft/common/tables/ITrader";
5-
import { IBuyClothingRequestData } from "@spt/models/eft/customization/IBuyClothingRequestData";
6-
import { IGetSuitsResponse } from "@spt/models/eft/customization/IGetSuitsResponse";
7-
import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClothingRequestData";
8-
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
9-
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
2+
import type { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData";
3+
import type { IPmcData } from "@spt/models/eft/common/IPmcData";
4+
import type { ICustomisationStorage } from "@spt/models/eft/common/tables/ICustomisationStorage";
5+
import type { ISuit } from "@spt/models/eft/common/tables/ITrader";
6+
import type { IBuyClothingRequestData } from "@spt/models/eft/customization/IBuyClothingRequestData";
7+
import type { ICustomizationSetRequest } from "@spt/models/eft/customization/ICustomizationSetRequest";
8+
import type { IHideoutCustomisation } from "@spt/models/eft/hideout/IHideoutCustomisation";
9+
import type { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
10+
import type { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
1011
import { SaveServer } from "@spt/servers/SaveServer";
1112
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
1213
export declare class CustomizationCallbacks {
@@ -18,18 +19,20 @@ export declare class CustomizationCallbacks {
1819
* Handle client/trading/customization/storage
1920
* @returns IGetSuitsResponse
2021
*/
21-
getSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetSuitsResponse>;
22+
getCustomisationUnlocks(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICustomisationStorage[]>;
2223
/**
2324
* Handle client/trading/customization
2425
* @returns ISuit[]
2526
*/
2627
getTraderSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISuit[]>;
27-
/**
28-
* Handle CustomizationWear event
29-
*/
30-
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
3128
/**
3229
* Handle CustomizationBuy event
3330
*/
34-
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;
31+
buyCustomisation(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;
32+
/** Handle client/hideout/customization/offer/list */
33+
getHideoutCustomisation(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutCustomisation>;
34+
/** Handle client/customization/storage */
35+
getStorage(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICustomisationStorage[]>;
36+
/** Handle CustomizationSet */
37+
setCustomisation(pmcData: IPmcData, request: ICustomizationSetRequest, sessionID: string): IItemEventRouterResponse;
3538
}

0 commit comments

Comments
 (0)