返回提交历史
Modified
src/services/configWatcherService.ts
+23
-2
XFEstudio/SpaceNinjaServer
feat: atramentum event end inbox message (#4067)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4067 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
1b41ca92
代码差异
1 个文件
+23
-2
@@ -24,6 +24,8 @@ import { getTunablesForClient } from "./tunablesService.ts";
24
24
import { Account } from "../models/loginModel.ts";
25
25
import { Inbox } from "../models/inboxModel.ts";
26
26
import { createMessage } from "./inboxService.ts";
27
import { buildVersionToInt } from "./loginService.ts";
28
import gameToBuildVersion from "../constants/gameToBuildVersion.ts";
27
29
28
30
chokidar.watch(configPath).on("change", () => {
29
31
if (shouldReloadConfig()) {
@@ -220,7 +222,8 @@ export const syncConfigWithDatabase = (): void => {
220
222
icon: "/Lotus/Interface/Icons/Npcs/Roathe.png",
221
223
// startDate & endDate would be present with the event dates but MongoDB would delete the message if we set an endDate in the past.
222
224
transmission: "/Lotus/Sounds/Dialog/Tau/RoatheEventOutroInbox/DRoatheEventOutroInbox0020Roathe",
223
QuestReq: "/Lotus/Types/Keys/TauPrequel/TauPrequelQuestKeyChain"
225
QuestReq: "/Lotus/Types/Keys/TauPrequel/TauPrequelQuestKeyChain",
226
minBuildVersion: buildVersionToInt(gameToBuildVersion["41.0.0"])
224
227
}
225
228
]);
226
229
}
@@ -231,7 +234,25 @@ export const syncConfigWithDatabase = (): void => {
231
234
}).then(() => {});
232
235
}
233
236
if (!config.worldState?.operationAtramentum) {
234
void Account.updateMany({}, { $unset: { receivedEventMessage_operationAtramentum: 1 } }).then(() => {});
237
void Account.find({ receivedEventMessage_operationAtramentum: { $exists: true } }, "_id").then(accounts => {
238
for (const account of accounts) {
239
void createMessage(account._id, [
240
{
241
sndr: "/Lotus/Language/Shadowgrapher/ZorbaName",
242
sub: "/Lotus/Language/Shadowgrapher/ShadowgrapherEventEndedInboxSubject",
243
msg: "/Lotus/Language/Shadowgrapher/ShadowgrapherEventEndedInboxBody",
244
icon: "/Lotus/Interface/Icons/Npcs/Syndicates/Zorba.png",
245
transmission: "/Lotus/Sounds/Dialog/Shadowgrapher/Vendor/DSGInbox0012AspirantZorba",
246
// startDate & endDate would be present with the event dates but MongoDB would delete the message if we set an endDate in the past.
247
QuestReq: "/Lotus/Types/Keys/PriestFrameQuest/PriestQuestKeyChain",
248
att: ["/Lotus/Types/Items/ShipDecos/Props/ShadowgrapherEaselShipDeco"],
249
CrossPlatform: true,
250
minBuildVersion: buildVersionToInt(gameToBuildVersion["42.0.0"])
251
}
252
]);
253
}
254
void Account.updateMany({}, { $unset: { receivedEventMessage_operationAtramentum: 1 } }).then(() => {});
255
});
235
256
void Inbox.deleteMany({
236
257
transmission: "/Lotus/Sounds/Dialog/Shadowgrapher/Vendor/DSGInbox0011AspirantZorba"
237
258
}).then(() => {});