返回提交历史
Modified
config-vanilla.json
+1
-0
Modified
src/controllers/api/inboxController.ts
+4
-1
Modified
src/controllers/custom/getItemListsController.ts
+10
-0
Modified
src/services/configService.ts
+1
-0
Modified
src/services/configWatcherService.ts
+7
-0
Modified
src/services/worldStateService.ts
+3
-1
Modified
static/webui/index.html
+10
-0
Modified
static/webui/script.js
+8
-1
Modified
static/webui/translations/de.js
+1
-0
Modified
static/webui/translations/en.js
+1
-0
Modified
static/webui/translations/es.js
+1
-0
Modified
static/webui/translations/fr.js
+1
-0
Modified
static/webui/translations/ru.js
+1
-0
Modified
static/webui/translations/uk.js
+1
-0
Modified
static/webui/translations/zh.js
+1
-0
XFEstudio/XFESpaceNinjaServer
feat: Baro Relay Override (#3444)
Closes #3239 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3444 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>
b61c6d8d
代码差异
15 个文件
+51
-3
@@ -41,6 +41,7 @@
41
41
"baroTennoConRelay": false,
42
42
"baroAlwaysAvailable": false,
43
43
"baroFullyStocked": false,
44
"baroRelayOverride": 0,
44
45
"evilBaroStage": 0,
45
46
"varziaFullyStocked": false,
46
47
"vanguardVaultRelics": false,
@@ -158,6 +158,9 @@ const createNewEventMessages = async (account: TAccountDocument): Promise<void>
158
158
159
159
// Baro
160
160
const baroIndex = Math.trunc((Date.now() - 910800000) / (unixTimesInMs.day * 14));
161
const baroRelayOverride = config.worldState?.baroRelayOverride;
162
const baroNodeIndex = baroRelayOverride && baroRelayOverride > 0 ? baroRelayOverride - 1 : baroIndex % 4;
163
const baroNode = ["EarthHUB", "MercuryHUB", "SaturnHUB", "PlutoHUB"][baroNodeIndex];
161
164
const baroStart = baroIndex * (unixTimesInMs.day * 14) + 910800000;
162
165
const prevBaroEnd = (baroIndex - 1) * (unixTimesInMs.day * 14) + 910800000;
163
166
const baroEnd = baroStart + unixTimesInMs.day * 14;
@@ -195,7 +198,7 @@ const createNewEventMessages = async (account: TAccountDocument): Promise<void>
195
198
arg: [
196
199
{
197
200
Key: "NODE_NAME",
198
Tag: ["EarthHUB", "MercuryHUB", "SaturnHUB", "PlutoHUB"][baroIndex % 4]
201
Tag: baroNode
199
202
}
200
203
],
201
204
date: new Date(baroActualStart)
@@ -16,6 +16,7 @@ import {
16
16
ExportMissionTypes,
17
17
ExportRailjackWeapons,
18
18
ExportRecipes,
19
ExportRegions,
19
20
ExportRelics,
20
21
ExportResources,
21
22
ExportSentinels,
@@ -72,6 +73,7 @@ interface ItemLists {
72
73
ShipDecorations: ListedItem[];
73
74
WeaponSkins: ListedItem[];
74
75
MissionTypes: ListedItem[];
76
Nodes: ListedItem[];
75
77
//circuitGameModes: ListedItem[];
76
78
blueprintAndItem: string;
77
79
}
@@ -117,6 +119,7 @@ const getItemListsController: RequestHandler = (req, response) => {
117
119
ShipDecorations: [],
118
120
WeaponSkins: [],
119
121
MissionTypes: [],
122
Nodes: [],
120
123
/*circuitGameModes: [
121
124
{
122
125
uniqueName: "Survival",
@@ -546,6 +549,13 @@ const getItemListsController: RequestHandler = (req, response) => {
546
549
});
547
550
}
548
551
552
for (const [uniqueName, node] of Object.entries(ExportRegions)) {
553
res.Nodes.push({
554
uniqueName,
555
name: getString(node.name || uniqueName, lang)
556
});
557
}
558
549
559
response.json(res);
550
560
};
551
561
@@ -51,6 +51,7 @@ export interface IConfig {
51
51
baroTennoConRelay?: boolean;
52
52
baroAlwaysAvailable?: boolean;
53
53
baroFullyStocked?: boolean;
54
baroRelayOverride?: number;
54
55
evilBaroStage?: number;
55
56
varziaFullyStocked?: boolean;
56
57
vanguardVaultRelics?: boolean;
@@ -124,6 +124,13 @@ export const validateConfig = (): void => {
124
124
config.worldState.nightwaveEpisode = 1;
125
125
modified = true;
126
126
}
127
if (
128
config.worldState?.baroRelayOverride &&
129
(config.worldState.baroRelayOverride > 4 || config.worldState.baroRelayOverride < 0)
130
) {
131
config.worldState.baroRelayOverride = 0;
132
modified = true;
133
}
127
134
if (modified) {
128
135
logger.info(`Updating config file to fix some issues with it.`);
129
136
void saveConfig();
@@ -3753,7 +3753,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3753
3753
const baroStart = baroIndex * (unixTimesInMs.day * 14) + 910800000;
3754
3754
const baroActualStart = baroStart + unixTimesInMs.day * (config.worldState?.baroAlwaysAvailable ? 0 : 12);
3755
3755
const baroEnd = baroStart + unixTimesInMs.day * 14;
3756
const baroNode = ["EarthHUB", "MercuryHUB", "SaturnHUB", "PlutoHUB"][baroIndex % 4];
3756
const baroRelayOverride = config.worldState?.baroRelayOverride;
3757
const baroNodeIndex = baroRelayOverride && baroRelayOverride > 0 ? baroRelayOverride - 1 : baroIndex % 4;
3758
const baroNode = ["EarthHUB", "MercuryHUB", "SaturnHUB", "PlutoHUB"][baroNodeIndex];
3757
3759
const evilBaroStage =
3758
3760
buildLabel && version_compare(buildLabel, gameToBuildVersion["40.0.0"]) < 0
3759
3761
? 0
@@ -1341,6 +1341,16 @@
1341
1341
</div>
1342
1342
</div>
1343
1343
</div>
1344
<div class="form-group mt-2">
1345
<label class="form-label" for="worldState.baroRelayOverride" data-loc="worldState_baroRelayOverride"></label>
1346
<select class="form-control" id="worldState.baroRelayOverride" data-default="0">
1347
<option value="0" data-loc="disabled"></option>
1348
<option value="1" data-loc-itemMap="EarthHUB" data-loc-replace="1"></option>
1349
<option value="2" data-loc-itemMap="MercuryHUB" data-loc-replace="2"></option>
1350
<option value="3" data-loc-itemMap="SaturnHUB" data-loc-replace="3"></option>
1351
<option value="4" data-loc-itemMap="PlutoHUB" data-loc-replace="4"></option>
1352
</select>
1353
</div>
1344
1354
<div class="form-group mt-2">
1345
1355
<label class="form-label" for="worldState.evilBaroStage" data-loc="worldState_evilBaroStage"></label>
1346
1356
<select class="form-control" id="worldState.evilBaroStage" data-default="0">
@@ -255,6 +255,13 @@ function updateLocElements() {
255
255
$(".inventory-update-note").text(
256
256
loc(window.have_game_ws ? "general_inventoryUpdateNoteGameWs" : "general_inventoryUpdateNote")
257
257
);
258
window.itemListPromise.then(itemMap => {
259
document.querySelectorAll("[data-loc-itemMap]").forEach(elm => {
260
const key = elm.getAttribute("data-loc-itemMap");
261
const item = itemMap[key];
262
elm.innerHTML = item && item.name ? item.name : key;
263
});
264
});
258
265
}
259
266
260
267
function setActiveLanguage(lang) {
@@ -821,7 +828,7 @@ function fetchItemList() {
821
828
}
822
829
itemMap[item.uniqueName] = { ...item, type };
823
830
});
824
} else if (type == "MissionTypes") {
831
} else if (["MissionTypes", "Nodes"].includes(type)) {
825
832
items.forEach(item => {
826
833
itemMap[item.uniqueName] = { ...item, type };
827
834
});
@@ -335,6 +335,7 @@ dict = {
335
335
worldState_thermiaFracturesProgressOverride: `Thermische Risse-Fortschritt`,
336
336
worldState_qtccAlerts: `Quest zum Kampf gegen Krebs-Alarmierungen`,
337
337
worldState_evilBaroStage: `Böser Baro`,
338
worldState_baroRelayOverride: `[UNTRANSLATED] Baro Relay Override`,
338
339
worldState_from_year: `Von |VAL|`,
339
340
worldState_pre_year: `Vor |VAL|`,
340
341
worldState_week: `Woche |VAL|`,
@@ -334,6 +334,7 @@ dict = {
334
334
worldState_thermiaFracturesProgressOverride: `Thermia Fractures Progress`,
335
335
worldState_qtccAlerts: `Quest to Conquer Cancer Alerts`,
336
336
worldState_evilBaroStage: `Evil Baro`,
337
worldState_baroRelayOverride: `Baro Relay Override`,
337
338
worldState_from_year: `From |VAL|`,
338
339
worldState_pre_year: `Pre-|VAL|`,
339
340
worldState_week: `Week |VAL|`,
@@ -335,6 +335,7 @@ dict = {
335
335
worldState_thermiaFracturesProgressOverride: `Progreso de Fracturas Thermia`,
336
336
worldState_qtccAlerts: `[UNTRANSLATED] Quest to Conquer Cancer Alerts`,
337
337
worldState_evilBaroStage: `[UNTRANSLATED] Evil Baro`,
338
worldState_baroRelayOverride: `[UNTRANSLATED] Baro Relay Override`,
338
339
worldState_from_year: `De |VAL|`,
339
340
worldState_pre_year: `Antes de |VAL|`,
340
341
worldState_week: `Semana |VAL|`,
@@ -335,6 +335,7 @@ dict = {
335
335
worldState_thermiaFracturesProgressOverride: `Progrès des Fractures Thermia`,
336
336
worldState_qtccAlerts: `Alertes Quête pour Vaincre le Cancer`,
337
337
worldState_evilBaroStage: `Baro Maléfique`,
338
worldState_baroRelayOverride: `[UNTRANSLATED] Baro Relay Override`,
338
339
worldState_from_year: `De |VAL|`,
339
340
worldState_pre_year: `Pre-|VAL|`,
340
341
worldState_week: `Semaine |VAL|`,