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

fix: avoid possibly using logger before it's inited (#4214)

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

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

代码差异

2 个文件 +4 -3
Modified src/index.ts +2 -0
@@ -11,6 +11,7 @@ import { updateWorldStateCollections } from "./services/worldStateService.ts";
11 11 import { repoDir } from "./helpers/pathHelper.ts";
12 12 import { MongoMemoryServer } from "mongodb-memory-server-core";
13 13 import { args } from "./helpers/commandLineArguments.ts";
14 import { selfTestServersideVendors } from "./services/serversideVendorsService.ts";
14 15
15 16 try {
16 17 loadConfig();
@@ -120,6 +121,7 @@ if (args.dev) {
120 121 logger.info(
121 122 "Developer mode is enabled. Note that this project is where it is now due to code contributions; please pay it forward with pull requests."
122 123 );
124 selfTestServersideVendors();
123 125 }
124 126
125 127 void updateWorldStateCollections();
Modified src/services/serversideVendorsService.ts +2 -3
@@ -1,5 +1,4 @@
1 1 import { unixTimesInMs } from "../constants/timeConstants.ts";
2 import { args } from "../helpers/commandLineArguments.ts";
3 2 import { catBreadHash } from "../helpers/stringHelpers.ts";
4 3 import { mixSeeds, SRng } from "./rngService.ts";
5 4 import type { IItemManifest, IVendorInfo, IVendorManifest } from "../types/vendorTypes.ts";
@@ -489,7 +488,7 @@ const getLegacyNightwaveManifestType = (buildLabel: string): string | undefined
489 488 return season >= 0 && season < manifests.length ? manifests[season] : undefined;
490 489 };
491 490
492 if (args.dev) {
491 export const selfTestServersideVendors = (): void => {
493 492 if (
494 493 getCycleDuration(ExportVendors["/Lotus/Types/Game/VendorManifests/Hubs/TeshinHardModeVendorManifest"]) !=
495 494 unixTimesInMs.week
@@ -565,4 +564,4 @@ if (args.dev) {
565 564 if (loid.length != 3) {
566 565 logger.warn(`self test failed for /Lotus/Types/Game/VendorManifests/EntratiLabs/EntratiLabsCommisionsManifest`);
567 566 }
568 }
567 };