返回提交历史
Modified
src/controllers/api/genericUpdateController.ts
+3
-5
Modified
src/services/inventoryService.ts
+26
-4
Renamed
src/types/genericUpdateTypes.ts
+0
-0
XFEstudio/SpaceNinjaServer
feat: send inbox messages for TennoLive 2021 hub broadcasts (#4001)
Closes #4000 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4001 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
af705abb
代码差异
3 个文件
+29
-9
@@ -2,15 +2,13 @@ import { getAccountIdForRequest } from "../../services/loginService.ts";
2
2
import { updateGeneric } from "../../services/inventoryService.ts";
3
3
import type { RequestHandler } from "express";
4
4
import { getJSONfromString } from "../../helpers/stringHelpers.ts";
5
import type { IGenericUpdate } from "../../types/genericUpdate.ts";
5
import type { IGenericUpdate } from "../../types/genericUpdateTypes.ts";
6
6
7
7
// This endpoint used to be /api/genericUpdate.php, but sometime around the Jade Shadows update, it was changed to /api/updateNodeIntros.php.
8
8
// SpaceNinjaServer supports both endpoints right now.
9
9
10
const genericUpdateController: RequestHandler = async (request, response) => {
10
export const genericUpdateController: RequestHandler = async (request, response) => {
11
11
const accountId = await getAccountIdForRequest(request);
12
12
const update = getJSONfromString<IGenericUpdate>(String(request.body));
13
response.json(await updateGeneric(update, accountId));
13
response.json(await updateGeneric(accountId, update));
14
14
};
15
16
export { genericUpdateController };
@@ -31,7 +31,7 @@ import type {
31
31
ICollectibleEntry
32
32
} from "../types/inventoryTypes/inventoryTypes.ts";
33
33
import { InventorySlot, equipmentKeys } from "../types/inventoryTypes/inventoryTypes.ts";
34
import type { IGenericUpdate, IUpdateNodeIntrosResponse } from "../types/genericUpdate.ts";
34
import type { IGenericUpdate, IUpdateNodeIntrosResponse } from "../types/genericUpdateTypes.ts";
35
35
import type { IKeyChainRequest, IMissionInventoryUpdateRequest } from "../types/requestTypes.ts";
36
36
import { logger } from "../utils/logger.ts";
37
37
import {
@@ -1820,8 +1820,8 @@ export const addStanding = (
1820
1820
1821
1821
// TODO: AffiliationMods support (Nightwave).
1822
1822
export const updateGeneric = async (
1823
data: IGenericUpdate,
1824
accountId: string | Types.ObjectId
1823
accountId: string | Types.ObjectId,
1824
data: IGenericUpdate
1825
1825
): Promise<IUpdateNodeIntrosResponse> => {
1826
1826
const inventory = await getInventory(
1827
1827
accountId,
@@ -1841,7 +1841,29 @@ export const updateGeneric = async (
1841
1841
inventory.NodeIntrosCompleted.push(node);
1842
1842
logger.debug(`completed popup/dialogue/cutscene for ${node}`);
1843
1843
1844
if (node == "TC2025") {
1844
if (node == "TL21Start") {
1845
await createMessage(accountId, [
1846
{
1847
sndr: "/Lotus/Language/Menu/Mailbox_WarframeSender",
1848
msg: "",
1849
sub: "/Lotus/Language/Alerts/LotusGiftDesc",
1850
icon: "/Lotus/Interface/Icons/Npcs/Lotus_d.png",
1851
highPriority: true,
1852
att: ["/Lotus/Upgrades/Skins/Weapons/Staff/TnRibbonStaffSkin"]
1853
}
1854
]);
1855
} else if (node == "TL21End") {
1856
await createMessage(accountId, [
1857
{
1858
sndr: "/Lotus/Language/Menu/Mailbox_WarframeSender",
1859
msg: "",
1860
sub: "/Lotus/Language/Alerts/LotusGiftDesc",
1861
icon: "/Lotus/Interface/Icons/Npcs/Lotus_d.png",
1862
highPriority: true,
1863
att: ["/Lotus/Types/StoreItems/Packages/TannukaiBundle"]
1864
}
1865
]);
1866
} else if (node == "TC2025") {
1845
1867
inventoryChanges.ShipDecorations = [
1846
1868
{
1847
1869
ItemType: "/Lotus/Types/Items/ShipDecos/TauGrineerLancerBobbleHead",
此文件没有可显示的逐行差异。