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

feat: lock worldState time via config (#1361)

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

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

代码差异

4 个文件 +11 -8
Modified README.md +1 -0
@@ -12,3 +12,4 @@ To get an idea of what functionality you can expect to be missing [have a look t
12 12
13 13 - `logger.level` can be `fatal`, `error`, `warn`, `info`, `http`, `debug`, or `trace`.
14 14 - `myIrcAddresses` can be used to point to an IRC server. If not provided, defaults to `[ myAddress ]`.
15 - `worldState.lockTime` will lock the time provided in worldState if nonzero, e.g. `1743202800` for night in POE.
Modified config.json.example +3 -2
@@ -38,10 +38,11 @@
38 38 "noDojoResearchTime": false,
39 39 "fastClanAscension": false,
40 40 "spoofMasteryRank": -1,
41 "events": {
41 "worldState": {
42 42 "creditBoost": false,
43 43 "affinityBoost": false,
44 44 "resourceBoost": false,
45 "starDays": true
45 "starDays": true,
46 "lockTime": 0
46 47 }
47 48 }
Modified src/controllers/dynamic/worldStateController.ts +5 -5
@@ -24,7 +24,7 @@ export const worldStateController: RequestHandler = (req, res) => {
24 24 typeof req.query.buildLabel == "string"
25 25 ? req.query.buildLabel.split(" ").join("+")
26 26 : buildConfig.buildLabel,
27 Time: Math.round(Date.now() / 1000),
27 Time: config.worldState?.lockTime || Math.round(Date.now() / 1000),
28 28 Goals: [],
29 29 GlobalUpgrades: [],
30 30 LiteSorties: [],
@@ -68,7 +68,7 @@ export const worldStateController: RequestHandler = (req, res) => {
68 68 ...staticWorldState
69 69 };
70 70
71 if (config.events?.starDays) {
71 if (config.worldState?.starDays) {
72 72 worldState.Goals.push({
73 73 _id: { $oid: "67a4dcce2a198564d62e1647" },
74 74 Activation: { $date: { $numberLong: "1738868400000" } },
@@ -117,7 +117,7 @@ export const worldStateController: RequestHandler = (req, res) => {
117 117 Nodes: []
118 118 };
119 119
120 if (config.events?.creditBoost) {
120 if (config.worldState?.creditBoost) {
121 121 worldState.GlobalUpgrades.push({
122 122 _id: { $oid: "5b23106f283a555109666672" },
123 123 Activation: { $date: { $numberLong: "1740164400000" } },
@@ -129,7 +129,7 @@ export const worldStateController: RequestHandler = (req, res) => {
129 129 LocalizeDescTag: ""
130 130 });
131 131 }
132 if (config.events?.affinityBoost) {
132 if (config.worldState?.affinityBoost) {
133 133 worldState.GlobalUpgrades.push({
134 134 _id: { $oid: "5b23106f283a555109666673" },
135 135 Activation: { $date: { $numberLong: "1740164400000" } },
@@ -141,7 +141,7 @@ export const worldStateController: RequestHandler = (req, res) => {
141 141 LocalizeDescTag: ""
142 142 });
143 143 }
144 if (config.events?.resourceBoost) {
144 if (config.worldState?.resourceBoost) {
145 145 worldState.GlobalUpgrades.push({
146 146 _id: { $oid: "5b23106f283a555109666674" },
147 147 Activation: { $date: { $numberLong: "1740164400000" } },
Modified src/services/configService.ts +2 -1
@@ -64,11 +64,12 @@ interface IConfig {
64 64 noDojoResearchTime?: boolean;
65 65 fastClanAscension?: boolean;
66 66 spoofMasteryRank?: number;
67 events?: {
67 worldState?: {
68 68 creditBoost?: boolean;
69 69 affinityBoost?: boolean;
70 70 resourceBoost?: boolean;
71 71 starDays?: boolean;
72 lockTime?: number;
72 73 };
73 74 }
74 75