XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

feat: unlock all captura scenes (#650)

44b78ecf
Sainan <sainan@calamity.inc>
提交于

代码差异

7 个文件 +49 -9
Modified config.json.example +1 -0
@@ -21,6 +21,7 @@
21 21 "unlockAllShipDecorations": true,
22 22 "unlockAllFlavourItems": true,
23 23 "unlockAllSkins": true,
24 "unlockAllCapturaScenes": true,
24 25 "universalPolarityEverywhere": true,
25 26 "spoofMasteryRank": -1
26 27 }
Modified package-lock.json +4 -4
@@ -12,7 +12,7 @@
12 12 "copyfiles": "^2.4.1",
13 13 "express": "^5",
14 14 "mongoose": "^8.9.2",
15 "warframe-public-export-plus": "^0.5.15",
15 "warframe-public-export-plus": "^0.5.16",
16 16 "warframe-riven-info": "^0.1.2",
17 17 "winston": "^3.17.0",
18 18 "winston-daily-rotate-file": "^5.0.0"
@@ -3877,9 +3877,9 @@
3877 3877 }
3878 3878 },
3879 3879 "node_modules/warframe-public-export-plus": {
3880 "version": "0.5.15",
3881 "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.15.tgz",
3882 "integrity": "sha512-xsMgj1+lB2VPDCLuU88YsbwQiGQT5cNgjgNTk1iKx2ZpX31fu19tflTWrTHEJbSnqxuh/8h2LP5ZpBZV0a9fCg=="
3880 "version": "0.5.16",
3881 "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.16.tgz",
3882 "integrity": "sha512-4Mgng3ojWfF0mffZDKQLwrKx6qHty7o35F5+nCDmSal1TzjeEclJCSgoMgdAO0e+Ug/lTP7FSiIXcU4SDk3gsw=="
3883 3883 },
3884 3884 "node_modules/warframe-riven-info": {
3885 3885 "version": "0.1.2",
Modified package.json +1 -1
@@ -16,7 +16,7 @@
16 16 "copyfiles": "^2.4.1",
17 17 "express": "^5",
18 18 "mongoose": "^8.9.2",
19 "warframe-public-export-plus": "^0.5.15",
19 "warframe-public-export-plus": "^0.5.16",
20 20 "warframe-riven-info": "^0.1.2",
21 21 "winston": "^3.17.0",
22 22 "winston-daily-rotate-file": "^5.0.0"
Modified src/controllers/api/inventoryController.ts +37 -4
@@ -7,9 +7,16 @@ import allDialogue from "@/static/fixed_responses/allDialogue.json";
7 7 import { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes";
8 8 import { IShipInventory, equipmentKeys } from "@/src/types/inventoryTypes/inventoryTypes";
9 9 import { IPolarity, ArtifactPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
10 import { ExportCustoms, ExportFlavour, ExportKeys, ExportRegions, ExportResources } from "warframe-public-export-plus";
11
12 const inventoryController: RequestHandler = async (request, response) => {
10 import {
11 ExportCustoms,
12 ExportFlavour,
13 ExportKeys,
14 ExportRegions,
15 ExportResources,
16 ExportVirtuals
17 } from "warframe-public-export-plus";
18
19 export const inventoryController: RequestHandler = async (request, response) => {
13 20 let account;
14 21 try {
15 22 account = await getAccountForRequest(request);
@@ -152,6 +159,17 @@ const inventoryController: RequestHandler = async (request, response) => {
152 159 }
153 160 }
154 161
162 if (config.unlockAllCapturaScenes) {
163 for (const uniqueName of Object.keys(ExportResources)) {
164 if (resourceInheritsFrom(uniqueName, "/Lotus/Types/Items/MiscItems/PhotoboothTile")) {
165 inventoryResponse.MiscItems.push({
166 ItemType: uniqueName,
167 ItemCount: 1
168 });
169 }
170 }
171 }
172
155 173 if (typeof config.spoofMasteryRank === "number" && config.spoofMasteryRank >= 0) {
156 174 inventoryResponse.PlayerLevel = config.spoofMasteryRank;
157 175 if (!("xpBasedLevelCapDisabled" in request.query)) {
@@ -206,4 +224,19 @@ const getExpRequiredForMr = (rank: number): number => {
206 224 return 2_250_000 + 147_500 * (rank - 30);
207 225 };
208 226
209 export { inventoryController };
227 const resourceInheritsFrom = (resourceName: string, targetName: string): boolean => {
228 let parentName = resourceGetParent(resourceName);
229 for (; parentName != undefined; parentName = resourceGetParent(parentName)) {
230 if (parentName == targetName) {
231 return true;
232 }
233 }
234 return false;
235 };
236
237 const resourceGetParent = (resourceName: string): string | undefined => {
238 if (resourceName in ExportResources) {
239 return ExportResources[resourceName].parentName;
240 }
241 return ExportVirtuals[resourceName]?.parentName;
242 };
Modified src/services/configService.ts +1 -0
@@ -46,6 +46,7 @@ interface IConfig {
46 46 unlockAllShipDecorations?: boolean;
47 47 unlockAllFlavourItems?: boolean;
48 48 unlockAllSkins?: boolean;
49 unlockAllCapturaScenes?: boolean;
49 50 universalPolarityEverywhere?: boolean;
50 51 spoofMasteryRank?: number;
51 52 }
Modified static/webui/index.html +4 -0
@@ -253,6 +253,10 @@
253 253 <input class="form-check-input" type="checkbox" id="unlockAllSkins" />
254 254 <label class="form-check-label" for="unlockAllSkins">Unlock All Skins</label>
255 255 </div>
256 <div class="form-check">
257 <input class="form-check-input" type="checkbox" id="unlockAllCapturaScenes" />
258 <label class="form-check-label" for="unlockAllCapturaScenes">Unlock All Captura Scenes</label>
259 </div>
256 260 <div class="form-check">
257 261 <input class="form-check-input" type="checkbox" id="universalPolarityEverywhere" />
258 262 <label class="form-check-label" for="universalPolarityEverywhere">
Modified static/webui/script.js +1 -0
@@ -804,6 +804,7 @@ const uiConfigs = [
804 804 "unlockAllShipDecorations",
805 805 "unlockAllFlavourItems",
806 806 "unlockAllSkins",
807 "unlockAllCapturaScenes",
807 808 "universalPolarityEverywhere",
808 809 "spoofMasteryRank"
809 810 ];