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: tutorialGivesStanceMods qol config (#4385)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4385 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

906abfd8
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

3 个文件 +15 -7
Modified config-vanilla.json +1 -0
@@ -128,6 +128,7 @@
128 128 "breedingGrounds": false
129 129 },
130 130 "serversideQualityOfLife": {
131 "tutorialGivesStanceMods": null,
131 132 "twentythreeHourMasteryRankCooldown": true,
132 133 "doubleDailySynthesisEndoReward": true,
133 134 "tylRegorDropsTwoEquinoxParts": true
Modified src/services/configService.ts +9 -6
@@ -4,6 +4,7 @@ import { repoDir } from "../helpers/pathHelper.ts";
4 4 import { args } from "../helpers/commandLineArguments.ts";
5 5 import type { Request } from "express";
6 6 import { version_compare } from "../helpers/inventoryHelpers.ts";
7 import configDefaults from "../../config-vanilla.json" with { type: "json" };
7 8
8 9 export type TRegionId = "ASIA" | "OCEANIA" | "EUROPE" | "RUSSIA" | "NORTH_AMERICA" | "SOUTH_AMERICA";
9 10
@@ -23,6 +24,7 @@ export interface IWebuiConfig {
23 24 export type TLogLevel = "error" | "warn" | "info" | "http" | "debug" | "trace";
24 25
25 26 type TQolConfigKey =
27 | "tutorialGivesStanceMods"
26 28 | "twentythreeHourMasteryRankCooldown"
27 29 | "doubleDailySynthesisEndoReward"
28 30 | "tylRegorDropsTwoEquinoxParts";
@@ -328,11 +330,12 @@ export const shouldDoServerQol = (
328 330 clientBuildLabel: string,
329 331 introducedInBuildLabel: string
330 332 ): boolean => {
331 if (config.serversideQualityOfLife) {
332 if (config.serversideQualityOfLife[key] === null) {
333 return version_compare(clientBuildLabel, introducedInBuildLabel) >= 0;
334 }
335 return config.serversideQualityOfLife[key];
333 let value = config.serversideQualityOfLife?.[key];
334 if (value === undefined) {
335 value = configDefaults.serversideQualityOfLife[key];
336 }
337 if (value === null) {
338 return version_compare(clientBuildLabel, introducedInBuildLabel) >= 0;
336 339 }
337 return true;
340 return value;
338 341 };
Modified src/services/inventoryService.ts +5 -1
@@ -324,7 +324,11 @@ export const addStartingGear = async (
324 324 const inventoryChanges: IInventoryChanges = {};
325 325 addEquipment(inventory, "LongGuns", LongGuns[0].ItemType, { IsNew: false }, inventoryChanges);
326 326 addEquipment(inventory, "Pistols", Pistols[0].ItemType, { IsNew: false }, inventoryChanges);
327 combineInventoryChanges(inventoryChanges, await addItem(inventory, Melee[0].ItemType)); // defaultUpgrades need to respected because as of U38.5, Skana & Bo come with stances by default.
327 if (shouldDoServerQol("tutorialGivesStanceMods", buildLabel, gameToBuildVersion["38.5.0"])) {
328 combineInventoryChanges(inventoryChanges, await addItem(inventory, Melee[0].ItemType)); // This respects defaultUpgrades
329 } else {
330 addEquipment(inventory, "Melee", Melee[0].ItemType, { IsNew: false }, inventoryChanges);
331 }
328 332 await addPowerSuit(inventory, Suits[0].ItemType, { IsNew: false }, buildLabel, inventoryChanges);
329 333 addEquipment(
330 334 inventory,