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

XFESpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/XFESpaceNinjaServer

feat: noDailyStandingLimits cheat (#791)

1a8e0f33
Sainan <sainan@calamity.inc>
提交于

代码差异

5 个文件 +24 -16
Modified config.json.example +1 -0
@@ -28,5 +28,6 @@
28 28 "unlockDoubleCapacityPotatoesEverywhere": true,
29 29 "unlockExilusEverywhere": true,
30 30 "unlockArcanesEverywhere": true,
31 "noDailyStandingLimits": true,
31 32 "spoofMasteryRank": -1
32 33 }
Modified src/controllers/api/inventoryController.ts +10 -14
@@ -15,6 +15,7 @@ import {
15 15 ExportVirtuals
16 16 } from "warframe-public-export-plus";
17 17 import { handleSubsumeCompletion } from "./infestedFoundryController";
18 import { allDailyAffiliationKeys } from "@/src/services/inventoryService";
18 19
19 20 export const inventoryController: RequestHandler = async (request, response) => {
20 21 const account = await getAccountForRequest(request);
@@ -32,20 +33,9 @@ export const inventoryController: RequestHandler = async (request, response) =>
32 33 account.LastLoginDay = today;
33 34 await account.save();
34 35
35 inventory.DailyAffiliation = 16000 + inventory.PlayerLevel * 500;
36 inventory.DailyAffiliationPvp = 16000 + inventory.PlayerLevel * 500;
37 inventory.DailyAffiliationLibrary = 16000 + inventory.PlayerLevel * 500;
38 inventory.DailyAffiliationCetus = 16000 + inventory.PlayerLevel * 500;
39 inventory.DailyAffiliationQuills = 16000 + inventory.PlayerLevel * 500;
40 inventory.DailyAffiliationSolaris = 16000 + inventory.PlayerLevel * 500;
41 inventory.DailyAffiliationVentkids = 16000 + inventory.PlayerLevel * 500;
42 inventory.DailyAffiliationVox = 16000 + inventory.PlayerLevel * 500;
43 inventory.DailyAffiliationEntrati = 16000 + inventory.PlayerLevel * 500;
44 inventory.DailyAffiliationNecraloid = 16000 + inventory.PlayerLevel * 500;
45 inventory.DailyAffiliationZariman = 16000 + inventory.PlayerLevel * 500;
46 inventory.DailyAffiliationKahl = 16000 + inventory.PlayerLevel * 500;
47 inventory.DailyAffiliationCavia = 16000 + inventory.PlayerLevel * 500;
48 inventory.DailyAffiliationHex = 16000 + inventory.PlayerLevel * 500;
36 for (const key of allDailyAffiliationKeys) {
37 inventory[key] = 16000 + inventory.PlayerLevel * 500;
38 }
49 39 inventory.DailyFocus = 250000 + inventory.PlayerLevel * 5000;
50 40 await inventory.save();
51 41 }
@@ -244,6 +234,12 @@ export const inventoryController: RequestHandler = async (request, response) =>
244 234 }
245 235 }
246 236
237 if (config.noDailyStandingLimits) {
238 for (const key of allDailyAffiliationKeys) {
239 inventoryResponse[key] = 999_999;
240 }
241 }
242
247 243 // Fix for #380
248 244 inventoryResponse.NextRefill = { $date: { $numberLong: "9999999999999" } };
249 245
Modified src/services/configService.ts +1 -0
@@ -54,6 +54,7 @@ interface IConfig {
54 54 unlockDoubleCapacityPotatoesEverywhere?: boolean;
55 55 unlockExilusEverywhere?: boolean;
56 56 unlockArcanesEverywhere?: boolean;
57 noDailyStandingLimits?: boolean;
57 58 spoofMasteryRank?: number;
58 59 }
59 60
Modified src/services/inventoryService.ts +6 -2
@@ -514,8 +514,12 @@ const standingLimitBinToInventoryKey: Record<
514 514 STANDING_LIMIT_BIN_HEX: "DailyAffiliationHex"
515 515 };
516 516
517 export const allDailyAffiliationKeys: (keyof IDailyAffiliations)[] = Object.entries(standingLimitBinToInventoryKey).map(
518 arr => arr[1]
519 );
520
517 521 export const getStandingLimit = (inventory: IDailyAffiliations, bin: TStandingLimitBin): number => {
518 if (bin == "STANDING_LIMIT_BIN_NONE") {
522 if (bin == "STANDING_LIMIT_BIN_NONE" || config.noDailyStandingLimits) {
519 523 return Number.MAX_SAFE_INTEGER;
520 524 }
521 525 return inventory[standingLimitBinToInventoryKey[bin]];
@@ -526,7 +530,7 @@ export const updateStandingLimit = (
526 530 bin: TStandingLimitBin,
527 531 subtrahend: number
528 532 ): void => {
529 if (bin != "STANDING_LIMIT_BIN_NONE") {
533 if (bin != "STANDING_LIMIT_BIN_NONE" && !config.noDailyStandingLimits) {
530 534 inventory[standingLimitBinToInventoryKey[bin]] -= subtrahend;
531 535 }
532 536 };
Modified static/webui/index.html +6 -0
@@ -298,6 +298,12 @@
298 298 Arcane Adapters Everywhere
299 299 </label>
300 300 </div>
301 <div class="form-check">
302 <input class="form-check-input" type="checkbox" id="noDailyStandingLimits" />
303 <label class="form-check-label" for="noDailyStandingLimits">
304 No Daily Standing Limits
305 </label>
306 </div>
301 307 <div class="form-group mt-2">
302 308 <label class="form-label" for="spoofMasteryRank">
303 309 Spoofed Mastery Rank (-1 to disable)