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

chore: move int cheats into account section (#2916)

Re #2361 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2916 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>

4f8b0732
AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
提交于

代码差异

10 个文件 +47 -46
Modified config-vanilla.json +0 -3
@@ -14,9 +14,6 @@
14 14 "unlockAllSkins": false,
15 15 "fullyStockedVendors": false,
16 16 "skipClanKeyCrafting": false,
17 "spoofMasteryRank": -1,
18 "relicRewardItemCountMultiplier": 1,
19 "nightwaveStandingMultiplier": 1,
20 17 "unfaithfulBugFixes": {
21 18 "ignore1999LastRegionPlayed": false,
22 19 "fixXtraCheeseTimer": false,
Modified src/controllers/api/inventoryController.ts +3 -3
@@ -348,12 +348,12 @@ export const getInventoryResponse = async (
348 348 }
349 349 }
350 350
351 if (typeof config.spoofMasteryRank === "number" && config.spoofMasteryRank >= 0) {
352 inventoryResponse.PlayerLevel = config.spoofMasteryRank;
351 if (inventory.spoofMasteryRank && inventory.spoofMasteryRank >= 0) {
352 inventoryResponse.PlayerLevel = inventory.spoofMasteryRank;
353 353 if (!xpBasedLevelCapDisabled) {
354 354 // This client has not been patched to accept any mastery rank, need to fake the XP.
355 355 inventoryResponse.XPInfo = [];
356 let numFrames = getExpRequiredForMr(Math.min(config.spoofMasteryRank, 5030)) / 6000;
356 let numFrames = getExpRequiredForMr(Math.min(inventory.spoofMasteryRank, 5030)) / 6000;
357 357 while (numFrames-- > 0) {
358 358 inventoryResponse.XPInfo.push({
359 359 ItemType: "/Lotus/Powersuits/Mag/Mag",
Modified src/controllers/api/updateChallengeProgressController.ts +1 -1
@@ -14,7 +14,7 @@ export const updateChallengeProgressController: RequestHandler = async (req, res
14 14
15 15 const inventory = await getInventory(
16 16 account._id.toString(),
17 "ChallengesFixVersion ChallengeProgress SeasonChallengeHistory Affiliations CalendarProgress"
17 "ChallengesFixVersion ChallengeProgress SeasonChallengeHistory Affiliations CalendarProgress nightwaveStandingMultiplier"
18 18 );
19 19 let affiliationMods: IAffiliationMods[] = [];
20 20 if (challenges.ChallengeProgress) {
Modified src/helpers/relicHelper.ts +2 -3
@@ -8,7 +8,6 @@ import { logger } from "../utils/logger.ts";
8 8 import { addMiscItems, combineInventoryChanges } from "../services/inventoryService.ts";
9 9 import { handleStoreItemAcquisition } from "../services/purchaseService.ts";
10 10 import type { IInventoryChanges } from "../types/purchaseTypes.ts";
11 import { config } from "../services/configService.ts";
12 11
13 12 export const crackRelic = async (
14 13 inventory: TInventoryDatabaseDocument,
@@ -29,10 +28,10 @@ export const crackRelic = async (
29 28 ExportRewards[relic.rewardManifest][0] as { type: string; itemCount: number; rarity: TRarity }[], // rarity is nullable in PE+ typings, but always present for relics
30 29 weights
31 30 )!;
32 if (config.relicRewardItemCountMultiplier !== undefined && (config.relicRewardItemCountMultiplier ?? 1) != 1) {
31 if (inventory.relicRewardItemCountMultiplier && inventory.relicRewardItemCountMultiplier != 1) {
33 32 reward = {
34 33 ...reward,
35 itemCount: reward.itemCount * config.relicRewardItemCountMultiplier
34 itemCount: reward.itemCount * inventory.relicRewardItemCountMultiplier
36 35 };
37 36 }
38 37 logger.debug(`relic rolled`, reward);
Modified src/models/inventoryModels/inventoryModel.ts +3 -0
@@ -1469,6 +1469,9 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
1469 1469 nemesisHintProgressMultiplierGrineer: Number,
1470 1470 nemesisHintProgressMultiplierCorpus: Number,
1471 1471 nemesisExtraWeapon: Number,
1472 spoofMasteryRank: { type: Number, default: -1 },
1473 relicRewardItemCountMultiplier: { type: Number, default: 1 },
1474 nightwaveStandingMultiplier: { type: Number, default: 1 },
1472 1475
1473 1476 SubscribedToEmails: { type: Number, default: 0 },
1474 1477 SubscribedToEmailsPersonalized: { type: Number, default: 0 },
Modified src/services/configService.ts +4 -4
@@ -24,9 +24,6 @@ export interface IConfig {
24 24 unlockAllSkins?: boolean;
25 25 fullyStockedVendors?: boolean;
26 26 skipClanKeyCrafting?: boolean;
27 spoofMasteryRank?: number;
28 relicRewardItemCountMultiplier?: number;
29 nightwaveStandingMultiplier?: number;
30 27 unfaithfulBugFixes?: {
31 28 ignore1999LastRegionPlayed?: boolean;
32 29 fixXtraCheeseTimer?: boolean;
@@ -149,7 +146,10 @@ export const configRemovedOptionsKeys = [
149 146 "fastClanAscension",
150 147 "unlockAllFlavourItems",
151 148 "unlockAllShipDecorations",
152 "unlockAllDecoRecipes"
149 "unlockAllDecoRecipes",
150 "spoofMasteryRank",
151 "relicRewardItemCountMultiplier",
152 "nightwaveStandingMultiplier"
153 153 ];
154 154
155 155 export const configPath = path.join(repoDir, args.configPath ?? "config.json");
Modified src/services/friendService.ts +2 -3
@@ -1,6 +1,5 @@
1 1 import type { IFriendInfo } from "../types/friendTypes.ts";
2 2 import { getInventory } from "./inventoryService.ts";
3 import { config } from "./configService.ts";
4 3 import { Account } from "../models/loginModel.ts";
5 4 import type { Types } from "mongoose";
6 5 import { Friendship } from "../models/friendModel.ts";
@@ -13,8 +12,8 @@ export const addAccountDataToFriendInfo = async (info: IFriendInfo): Promise<voi
13 12 };
14 13
15 14 export const addInventoryDataToFriendInfo = async (info: IFriendInfo): Promise<void> => {
16 const inventory = await getInventory(fromOid(info._id), "PlayerLevel ActiveAvatarImageType");
17 info.PlayerLevel = config.spoofMasteryRank == -1 ? inventory.PlayerLevel : config.spoofMasteryRank;
15 const inventory = await getInventory(fromOid(info._id), "PlayerLevel ActiveAvatarImageType spoofMasteryRank");
16 info.PlayerLevel = inventory.spoofMasteryRank == -1 ? inventory.PlayerLevel : inventory.spoofMasteryRank;
18 17 info.ActiveAvatarImageType = inventory.ActiveAvatarImageType;
19 18 };
20 19
Modified src/services/inventoryService.ts +1 -1
@@ -2131,7 +2131,7 @@ export const addChallenges = async (
2131 2131 ];
2132 2132 }
2133 2133
2134 const standingToAdd = meta.standing! * (config.nightwaveStandingMultiplier ?? 1);
2134 const standingToAdd = meta.standing! * (inventory.nightwaveStandingMultiplier ?? 1);
2135 2135 affiliation.Standing += standingToAdd;
2136 2136 if (affiliationMods.length == 0) {
2137 2137 affiliationMods.push({ Tag: nightwaveSyndicateTag });
Modified src/types/inventoryTypes/inventoryTypes.ts +3 -0
@@ -61,6 +61,9 @@ export interface IAccountCheats {
61 61 nemesisHintProgressMultiplierGrineer?: number;
62 62 nemesisHintProgressMultiplierCorpus?: number;
63 63 nemesisExtraWeapon?: number;
64 spoofMasteryRank?: number;
65 relicRewardItemCountMultiplier?: number;
66 nightwaveStandingMultiplier?: number;
64 67 }
65 68
66 69 export interface IInventoryDatabase
Modified static/webui/index.html +28 -28
@@ -1071,6 +1071,20 @@
1071 1071 <input class="form-check-input" type="checkbox" id="finishInvasionsInOneMission" />
1072 1072 <label class="form-check-label" for="finishInvasionsInOneMission" data-loc="cheats_finishInvasionsInOneMission"></label>
1073 1073 </div>
1074 <form class="form-group mt-2" onsubmit="doChangeSupportedSyndicate(); return false;">
1075 <label class="form-label" for="changeSyndicate" data-loc="cheats_changeSupportedSyndicate"></label>
1076 <div class="input-group">
1077 <select class="form-control" id="changeSyndicate"></select>
1078 <button class="btn btn-secondary" type="submit" data-loc="cheats_changeButton"></button>
1079 </div>
1080 </form>
1081 <form class="form-group mt-2">
1082 <label class="form-label" for="spoofMasteryRank" data-loc="cheats_spoofMasteryRank"></label>
1083 <div class="input-group">
1084 <input class="form-control" id="spoofMasteryRank" type="number" min="-1" max="65535" data-default="-1" />
1085 <button class="btn btn-secondary" type="button" data-loc="cheats_save"></button>
1086 </div>
1087 </form>
1074 1088 <form class="form-group mt-2">
1075 1089 <label class="form-label" for="nemesisHenchmenKillsMultiplierGrineer" data-loc="cheats_nemesisHenchmenKillsMultiplierGrineer"></label>
1076 1090 <div class="input-group">
@@ -1113,6 +1127,20 @@
1113 1127 <button class="btn btn-secondary" type="button" data-loc="cheats_save"></button>
1114 1128 </div>
1115 1129 </form>
1130 <form class="form-group mt-2">
1131 <label class="form-label" for="relicRewardItemCountMultiplier" data-loc="cheats_relicRewardItemCountMultiplier"></label>
1132 <div class="input-group">
1133 <input class="form-control" id="relicRewardItemCountMultiplier" type="number" min="1" max="1000000" data-default="1" />
1134 <button class="btn btn-secondary" type="button" data-loc="cheats_save"></button>
1135 </div>
1136 </form>
1137 <form class="form-group mt-2">
1138 <label class="form-label" for="nightwaveStandingMultiplier" data-loc="cheats_nightwaveStandingMultiplier"></label>
1139 <div class="input-group">
1140 <input class="form-control" id="nightwaveStandingMultiplier" type="number" min="1" max="1000000" data-default="1" />
1141 <button class="btn btn-secondary" type="button" data-loc="cheats_save"></button>
1142 </div>
1143 </form>
1116 1144 <div class="mt-2 mb-2 d-flex flex-wrap gap-2">
1117 1145 <button class="btn btn-primary" onclick="debounce(doUnlockAllShipFeatures);" data-loc="cheats_unlockAllShipFeatures"></button>
1118 1146 <button class="btn btn-primary" onclick="debounce(unlockAllMissions);" data-loc="cheats_unlockAllMissions"></button>
@@ -1127,13 +1155,6 @@
1127 1155 <button class="btn btn-primary" onclick="debounce(unlockAllProfitTakerStages);" data-loc="cheats_unlockAllProfitTakerStages"></button>
1128 1156 <button class="btn btn-primary" onclick="debounce(unlockAllSimarisResearchEntries);" data-loc="cheats_unlockAllSimarisResearchEntries"></button>
1129 1157 </div>
1130 <form class="mt-2" onsubmit="doChangeSupportedSyndicate(); return false;">
1131 <label class="form-label" for="changeSyndicate" data-loc="cheats_changeSupportedSyndicate"></label>
1132 <div class="input-group">
1133 <select class="form-control" id="changeSyndicate"></select>
1134 <button class="btn btn-secondary" type="submit" data-loc="cheats_changeButton"></button>
1135 </div>
1136 </form>
1137 1158 </div>
1138 1159 </div>
1139 1160 </div>
@@ -1161,27 +1182,6 @@
1161 1182 <input class="form-check-input" type="checkbox" id="skipClanKeyCrafting" />
1162 1183 <label class="form-check-label" for="skipClanKeyCrafting" data-loc="cheats_skipClanKeyCrafting"></label>
1163 1184 </div>
1164 <form class="form-group mt-2" onsubmit="doSaveConfigInt('spoofMasteryRank'); return false;">
1165 <label class="form-label" for="spoofMasteryRank" data-loc="cheats_spoofMasteryRank"></label>
1166 <div class="input-group">
1167 <input class="form-control" id="spoofMasteryRank" type="number" min="-1" max="65535" data-default="-1" />
1168 <button class="btn btn-secondary" type="submit" data-loc="cheats_save"></button>
1169 </div>
1170 </form>
1171 <form class="form-group mt-2" onsubmit="doSaveConfigInt('relicRewardItemCountMultiplier'); return false;">
1172 <label class="form-label" for="relicRewardItemCountMultiplier" data-loc="cheats_relicRewardItemCountMultiplier"></label>
1173 <div class="input-group">
1174 <input class="form-control" id="relicRewardItemCountMultiplier" type="number" min="1" max="1000000" data-default="1" />
1175 <button class="btn btn-secondary" type="submit" data-loc="cheats_save"></button>
1176 </div>
1177 </form>
1178 <form class="form-group mt-2" onsubmit="doSaveConfigInt('nightwaveStandingMultiplier'); return false;">
1179 <label class="form-label" for="nightwaveStandingMultiplier" data-loc="cheats_nightwaveStandingMultiplier"></label>
1180 <div class="input-group">
1181 <input class="form-control" id="nightwaveStandingMultiplier" type="number" min="1" max="1000000" data-default="1" />
1182 <button class="btn btn-secondary" type="submit" data-loc="cheats_save"></button>
1183 </div>
1184 </form>
1185 1185 </div>
1186 1186 </div>
1187 1187 </div>