XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

chore: use toOid2 & toMongoDate2 more in worldStateService (#4094)

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

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

代码差异

3 个文件 +114 -140
Modified src/services/missionInventoryUpdateService.ts +3 -3
@@ -1348,11 +1348,11 @@ export const addMissionRewards = async (
1348 1348 if (!alert) {
1349 1349 logger.warn(`mission completed unknown alert`, { alertId: rewardInfo.alertId });
1350 1350 } else {
1351 if (inventory.CompletedAlerts.includes(alert._id.$oid)) {
1352 logger.debug(`alert ${alert._id.$oid} already completed, skipping alert reward`);
1351 if (inventory.CompletedAlerts.includes(rewardInfo.alertId)) {
1352 logger.debug(`alert ${rewardInfo.alertId} already completed, skipping alert reward`);
1353 1353 } else {
1354 1354 if (!inventory.alertsRepeatable) {
1355 inventory.CompletedAlerts.push(alert._id.$oid);
1355 inventory.CompletedAlerts.push(rewardInfo.alertId);
1356 1356 }
1357 1357 if (alert.MissionInfo.missionReward) {
1358 1358 if (alert.Tag && ["12MinWarEvent", "JadeShadows"].includes(alert.Tag) && isSteelPath) {
Modified src/services/worldStateService.ts +97 -123
@@ -1760,7 +1760,7 @@ const getAllVarziaManifests = (buildLabel: string | undefined): IPrimeVaultTrade
1760 1760 return [...dualPacks, ...vanguardRelics, ...singlePacks, ...items, ...bobbleHeads, ...relics];
1761 1761 };
1762 1762
1763 const createInvasion = (day: number, idx: number): IInvasion => {
1763 const createInvasion = (day: number, idx: number, buildLabel: string | undefined): IInvasion => {
1764 1764 const id = day * 3 + idx;
1765 1765 const defender = (["FC_GRINEER", "FC_CORPUS", day % 2 ? "FC_GRINEER" : "FC_CORPUS"] as const)[idx];
1766 1766 const rng = new SRng(new SRng(id).randomInt(0, 1_000_000));
@@ -1788,7 +1788,7 @@ const createInvasion = (day: number, idx: number): IInvasion => {
1788 1788 defenderReward.countedItems = [rng.randomElement(invasionRewards[defender][rewardTier])!];
1789 1789 }
1790 1790 return {
1791 _id: { $oid: oid },
1791 _id: toOid2(oid, buildLabel),
1792 1792 Faction: attacker,
1793 1793 DefenderFaction: defender,
1794 1794 Node: node,
@@ -1816,18 +1816,14 @@ const createInvasion = (day: number, idx: number): IInvasion => {
1816 1816 seed: rng.randomInt(0, 1_000_000),
1817 1817 faction: attacker
1818 1818 },
1819 Activation: {
1820 $date: {
1821 $numberLong: startMs.toString()
1822 }
1823 }
1819 Activation: toMongoDate2(startMs, buildLabel)
1824 1820 };
1825 1821 };
1826 1822
1827 1823 export const getInvasionByOid = (oid: string): IInvasion | undefined => {
1828 1824 const arr = oid.split("fd148cb8");
1829 1825 if (arr.length == 2 && arr[0].length == 8 && arr[1].length == 8) {
1830 return createInvasion(idToDay(oid), parseInt(arr[1], 16));
1826 return createInvasion(idToDay(oid), parseInt(arr[1], 16), undefined);
1831 1827 }
1832 1828 return undefined;
1833 1829 };
@@ -1916,19 +1912,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
1916 1912
1917 1913 if (config.worldState?.tennoLiveRelay) {
1918 1914 worldState.Goals.push({
1919 _id: {
1920 $oid: "687bf9400000000000000000"
1921 },
1922 Activation: {
1923 $date: {
1924 $numberLong: "1752955200000"
1925 }
1926 },
1927 Expiry: {
1928 $date: {
1929 $numberLong: "2000000000000"
1930 }
1931 },
1915 _id: toOid2("687bf9400000000000000000", buildLabel),
1916 Activation: toMongoDate2(1752955200000, buildLabel),
1917 Expiry: toMongoDate2(2000000000000, buildLabel),
1932 1918 Count: 0,
1933 1919 Goal: 0,
1934 1920 Success: 0,
@@ -1942,9 +1928,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
1942 1928 }
1943 1929 if (config.worldState?.baroTennoConRelay) {
1944 1930 worldState.Goals.push({
1945 _id: { $oid: "687bb2f00000000000000000" },
1946 Activation: { $date: { $numberLong: "1752937200000" } },
1947 Expiry: { $date: { $numberLong: "2000000000000" } },
1931 _id: toOid2("687bb2f00000000000000000", buildLabel),
1932 Activation: toMongoDate2(1752937200000, buildLabel),
1933 Expiry: toMongoDate2(2000000000000, buildLabel),
1948 1934 Count: 0,
1949 1935 Goal: 0,
1950 1936 Success: 0,
@@ -1957,9 +1943,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
1957 1943 Node: "TennoConHUB2"
1958 1944 });
1959 1945 const vt: IVoidTrader = {
1960 _id: { $oid: "687809030379266d790495c6" },
1961 Activation: { $date: { $numberLong: "1752937200000" } },
1962 Expiry: { $date: { $numberLong: "2000000000000" } },
1946 _id: toOid2("687809030379266d790495c6", buildLabel),
1947 Activation: toMongoDate2(1752937200000, buildLabel),
1948 Expiry: toMongoDate2(2000000000000, buildLabel),
1963 1949 Character: "Baro'Ki Teel",
1964 1950 Node: "TennoConHUB2",
1965 1951 Manifest: []
@@ -1986,9 +1972,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
1986 1972
1987 1973 worldState.Alerts.push(
1988 1974 {
1989 _id: {
1990 $oid: "68dc23c42e9d3acfa708ff3b"
1991 },
1975 _id: toOid2("68dc23c42e9d3acfa708ff3b", buildLabel),
1992 1976 Activation: { $date: { $numberLong: activation.toString() } },
1993 1977 Expiry: { $date: { $numberLong: expiry.toString() } },
1994 1978 MissionInfo: {
@@ -2011,9 +1995,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2011 1995 ForceUnlock: true
2012 1996 },
2013 1997 {
2014 _id: {
2015 $oid: "68dc2466e298b4f04206687a"
2016 },
1998 _id: toOid2("68dc2466e298b4f04206687a", buildLabel),
2017 1999 Activation: { $date: { $numberLong: activation.toString() } },
2018 2000 Expiry: { $date: { $numberLong: expiry.toString() } },
2019 2001 MissionInfo: {
@@ -2036,9 +2018,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2036 2018 ForceUnlock: true
2037 2019 },
2038 2020 {
2039 _id: {
2040 $oid: "68dc26865e7cb56b820b4252"
2041 },
2021 _id: toOid2("68dc26865e7cb56b820b4252", buildLabel),
2042 2022 Activation: { $date: { $numberLong: activation.toString() } },
2043 2023 Expiry: { $date: { $numberLong: expiry.toString() } },
2044 2024 MissionInfo: {
@@ -2100,7 +2080,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2100 2080 (!buildLabel || version_compare(buildLabel, gameToBuildVersion["29.10.0"]) >= 0)
2101 2081 ) {
2102 2082 worldState.Goals.push({
2103 _id: { $oid: "67a4dcce2a198564d62e1647" },
2083 _id: toOid2("67a4dcce2a198564d62e1647", buildLabel),
2104 2084 Activation: {
2105 2085 $date: {
2106 2086 $numberLong: config.worldState?.starDaysOverride
@@ -2132,9 +2112,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2132 2112 // The client gets kinda confused when multiple goals have the same tag, so considering these mutually exclusive.
2133 2113 if (config.worldState?.galleonOfGhouls == 1) {
2134 2114 worldState.Goals.push({
2135 _id: { $oid: "6814ddf00000000000000000" },
2136 Activation: { $date: { $numberLong: "1746198000000" } },
2137 Expiry: { $date: { $numberLong: "2000000000000" } },
2115 _id: toOid2("6814ddf00000000000000000", buildLabel),
2116 Activation: toMongoDate2(1746198000000, buildLabel),
2117 Expiry: toMongoDate2(2000000000000, buildLabel),
2138 2118 Count: 0,
2139 2119 Goal: 1,
2140 2120 Success: 0,
@@ -2155,9 +2135,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2155 2135 });
2156 2136 } else if (config.worldState?.galleonOfGhouls == 2) {
2157 2137 worldState.Goals.push({
2158 _id: { $oid: "681e18700000000000000000" },
2159 Activation: { $date: { $numberLong: "1746802800000" } },
2160 Expiry: { $date: { $numberLong: "2000000000000" } },
2138 _id: toOid2("681e18700000000000000000", buildLabel),
2139 Activation: toMongoDate2(1746802800000, buildLabel),
2140 Expiry: toMongoDate2(2000000000000, buildLabel),
2161 2141 Count: 0,
2162 2142 Goal: 1,
2163 2143 Success: 0,
@@ -2178,9 +2158,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2178 2158 });
2179 2159 } else if (config.worldState?.galleonOfGhouls == 3) {
2180 2160 worldState.Goals.push({
2181 _id: { $oid: "682752f00000000000000000" },
2182 Activation: { $date: { $numberLong: "1747407600000" } },
2183 Expiry: { $date: { $numberLong: "2000000000000" } },
2161 _id: toOid2("682752f00000000000000000", buildLabel),
2162 Activation: toMongoDate2(1747407600000, buildLabel),
2163 Expiry: toMongoDate2(2000000000000, buildLabel),
2184 2164 Count: 0,
2185 2165 Goal: 1,
2186 2166 Success: 0,
@@ -2214,7 +2194,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2214 2194 (!buildLabel || version_compare(buildLabel, gameToBuildVersion["22.7.0"]) >= 0)
2215 2195 ) {
2216 2196 worldState.Goals.push({
2217 _id: { $oid: "654a5058c757487cdb11824f" },
2197 _id: toOid2("654a5058c757487cdb11824f", buildLabel),
2218 2198 Activation: {
2219 2199 $date: {
2220 2200 $numberLong: config.worldState?.plagueStarOverride ? "1699372800000" : plagueStarStart.toString()
@@ -2724,8 +2704,8 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2724 2704 config.worldState?.anniversary!.toString(16).padStart(4, "0") +
2725 2705 i.toString(16).padStart(4, "0")
2726 2706 },
2727 Activation: { $date: { $numberLong: "1745593200000" } },
2728 Expiry: { $date: { $numberLong: "2000000000000" } },
2707 Activation: toMongoDate2(1745593200000, buildLabel),
2708 Expiry: toMongoDate2(2000000000000, buildLabel),
2729 2709 Count: 0,
2730 2710 Goal: 1,
2731 2711 Success: 0,
@@ -2749,9 +2729,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2749 2729 ) {
2750 2730 if (config.worldState.wolfHunt == 0) {
2751 2731 worldState.Goals.push({
2752 _id: {
2753 $oid: "67ed7672798d6466172e3b9c"
2754 },
2732 _id: toOid2("67ed7672798d6466172e3b9c", buildLabel),
2755 2733 Activation: {
2756 2734 $date: {
2757 2735 $numberLong: "1743616800000"
@@ -2790,9 +2768,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2790 2768 });
2791 2769 } else if (config.worldState.wolfHunt == 1) {
2792 2770 worldState.Goals.push({
2793 _id: {
2794 $oid: "67ed7672798d6466172e3b9d"
2795 },
2771 _id: toOid2("67ed7672798d6466172e3b9d", buildLabel),
2796 2772 Activation: {
2797 2773 $date: {
2798 2774 $numberLong: "1743616800000"
@@ -2868,9 +2844,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2868 2844 ) {
2869 2845 worldState.Goals.push(
2870 2846 {
2871 _id: { $oid: "5db305403d34b5158873519a" },
2872 Activation: { $date: { $numberLong: "1699372800000" } },
2873 Expiry: { $date: { $numberLong: "2000000000000" } },
2847 _id: toOid2("5db305403d34b5158873519a", buildLabel),
2848 Activation: toMongoDate2(1699372800000, buildLabel),
2849 Expiry: toMongoDate2(2000000000000, buildLabel),
2874 2850 Count: 0,
2875 2851 Goal: 3,
2876 2852 InterimGoals: [1, 2],
@@ -2899,9 +2875,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2899 2875 }
2900 2876 },
2901 2877 {
2902 _id: { $oid: "5db3054a3d34b5158873519c" },
2903 Activation: { $date: { $numberLong: "1699372800000" } },
2904 Expiry: { $date: { $numberLong: "2000000000000" } },
2878 _id: toOid2("5db3054a3d34b5158873519c", buildLabel),
2879 Activation: toMongoDate2(1699372800000, buildLabel),
2880 Expiry: toMongoDate2(2000000000000, buildLabel),
2905 2881 Count: 0,
2906 2882 Goal: 900,
2907 2883 Success: 0,
@@ -2976,8 +2952,8 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
2976 2952
2977 2953 worldState.Goals.push({
2978 2954 _id: { $oid: "5bc98f00000000000000000" + year.toString(16) },
2979 Activation: { $date: { $numberLong: "1539972000000" } },
2980 Expiry: { $date: { $numberLong: "2000000000000" } },
2955 Activation: toMongoDate2(1539972000000, buildLabel),
2956 Expiry: toMongoDate2(2000000000000, buildLabel),
2981 2957 Count: 0,
2982 2958 InterimGoals: [1],
2983 2959 Goal: 2,
@@ -3001,8 +2977,8 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3001 2977 if (year != 2) {
3002 2978 worldState.Goals.push({
3003 2979 _id: { $oid: "5bc98f01000000000000000" + year.toString(16) },
3004 Activation: { $date: { $numberLong: "1539972000000" } },
3005 Expiry: { $date: { $numberLong: "2000000000000" } },
2980 Activation: toMongoDate2(1539972000000, buildLabel),
2981 Expiry: toMongoDate2(2000000000000, buildLabel),
3006 2982 Count: 0,
3007 2983 Goal: 666,
3008 2984 Success: 0,
@@ -3079,8 +3055,8 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3079 3055
3080 3056 worldState.Goals.push({
3081 3057 _id: { $oid: "5b5b5da0000000000000000" + year.toString(16) },
3082 Activation: { $date: { $numberLong: "1532714400000" } },
3083 Expiry: { $date: { $numberLong: "2000000000000" } },
3058 Activation: toMongoDate2(1532714400000, buildLabel),
3059 Expiry: toMongoDate2(2000000000000, buildLabel),
3084 3060 Count: 0,
3085 3061 Goal: 3,
3086 3062 InterimGoals: [1, 2],
@@ -3113,9 +3089,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3113 3089 (!buildLabel || version_compare(buildLabel, gameToBuildVersion["18.22.1"]) >= 0)
3114 3090 ) {
3115 3091 worldState.Goals.push({
3116 _id: { $oid: "5bc9e8f7272d5d184c8398c9" },
3117 Activation: { $date: { $numberLong: "1539972000000" } },
3118 Expiry: { $date: { $numberLong: "2000000000000" } },
3092 _id: toOid2("5bc9e8f7272d5d184c8398c9", buildLabel),
3093 Activation: toMongoDate2(1539972000000, buildLabel),
3094 Expiry: toMongoDate2(2000000000000, buildLabel),
3119 3095 Count: 0,
3120 3096 InterimGoals: [1, 2],
3121 3097 Goal: 3,
@@ -3169,7 +3145,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3169 3145 : Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + 1, 1);
3170 3146
3171 3147 worldState.Goals.push({
3172 _id: { $oid: "66fd602de1778d583419e8e7" },
3148 _id: toOid2("66fd602de1778d583419e8e7", buildLabel),
3173 3149 Activation: { $date: { $numberLong: activation.toString() } },
3174 3150 Expiry: { $date: { $numberLong: expiry.toString() } },
3175 3151 Count: 0,
@@ -3328,9 +3304,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3328 3304
3329 3305 if (config.worldState?.bellyOfTheBeast && (!buildLabel || version_compare(buildLabel, "2024.06.12.18.42") >= 0)) {
3330 3306 worldState.Goals.push({
3331 _id: { $oid: "67a5035c2a198564d62e165e" },
3332 Activation: { $date: { $numberLong: "1738868400000" } },
3333 Expiry: { $date: { $numberLong: "2000000000000" } },
3307 _id: toOid2("67a5035c2a198564d62e165e", buildLabel),
3308 Activation: toMongoDate2(1738868400000, buildLabel),
3309 Expiry: toMongoDate2(2000000000000, buildLabel),
3334 3310 Count: config.worldState.bellyOfTheBeastProgressOverride ?? 0,
3335 3311 HealthPct: (config.worldState.bellyOfTheBeastProgressOverride ?? 0) / 100,
3336 3312 Goal: 0,
@@ -3355,9 +3331,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3355 3331 (!buildLabel || version_compare(buildLabel, gameToBuildVersion["42.0.0"]) >= 0)
3356 3332 ) {
3357 3333 worldState.Goals.push({
3358 _id: { $oid: "69ce8b780000000000000000" },
3359 Activation: { $date: { $numberLong: "1738868400000" } },
3360 Expiry: { $date: { $numberLong: "2000000000000" } },
3334 _id: toOid2("69ce8b780000000000000000", buildLabel),
3335 Activation: toMongoDate2(1738868400000, buildLabel),
3336 Expiry: toMongoDate2(2000000000000, buildLabel),
3361 3337 Count: config.worldState.operationAtramentumProgressOverride ?? 0,
3362 3338 HealthPct: (config.worldState.operationAtramentumProgressOverride ?? 0) / 100,
3363 3339 Goal: 0,
@@ -3379,9 +3355,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3379 3355 // <U39
3380 3356 if (config.worldState?.eightClaw && (!buildLabel || version_compare(buildLabel, "2025.06.23.11.39") >= 0)) {
3381 3357 worldState.Goals.push({
3382 _id: { $oid: "685c15f80000000000000000" },
3383 Activation: { $date: { $numberLong: "1750865400000" } },
3384 Expiry: { $date: { $numberLong: "2000000000000" } },
3358 _id: toOid2("685c15f80000000000000000", buildLabel),
3359 Activation: toMongoDate2(1750865400000, buildLabel),
3360 Expiry: toMongoDate2(2000000000000, buildLabel),
3385 3361 Count: config.worldState.eightClawProgressOverride ?? 0,
3386 3362 HealthPct: (config.worldState.eightClawProgressOverride ?? 0) / 100,
3387 3363 Goal: 0,
@@ -3401,9 +3377,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3401 3377
3402 3378 if (config.worldState?.scarletSpear) {
3403 3379 worldState.Goals.push({
3404 _id: {
3405 $oid: "5e7a3e2389e3090b0c6a998b"
3406 },
3380 _id: toOid2("5e7a3e2389e3090b0c6a998b", buildLabel),
3407 3381 Activation: {
3408 3382 $date: {
3409 3383 $numberLong: "1585070400000"
@@ -3467,9 +3441,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3467 3441 ) {
3468 3442 worldState.Goals.push(
3469 3443 {
3470 _id: { $oid: "5fdcccb875d5ad500dc477d0" },
3471 Activation: { $date: { $numberLong: "1608320400000" } },
3472 Expiry: { $date: { $numberLong: "2000000000000" } },
3444 _id: toOid2("5fdcccb875d5ad500dc477d0", buildLabel),
3445 Activation: toMongoDate2(1608320400000, buildLabel),
3446 Expiry: toMongoDate2(2000000000000, buildLabel),
3473 3447 Count: 0,
3474 3448 Goal: 500,
3475 3449 Success: 0,
@@ -3487,9 +3461,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3487 3461 }
3488 3462 },
3489 3463 {
3490 _id: { $oid: "5fdcccb875d5ad500dc477d1" },
3491 Activation: { $date: { $numberLong: "1608320400000" } },
3492 Expiry: { $date: { $numberLong: "2000000000000" } },
3464 _id: toOid2("5fdcccb875d5ad500dc477d1", buildLabel),
3465 Activation: toMongoDate2(1608320400000, buildLabel),
3466 Expiry: toMongoDate2(2000000000000, buildLabel),
3493 3467 Count: 0,
3494 3468 Goal: 1000,
3495 3469 Success: 0,
@@ -3508,9 +3482,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3508 3482 }
3509 3483 },
3510 3484 {
3511 _id: { $oid: "5fdcccb875d5ad500dc477d2" },
3512 Activation: { $date: { $numberLong: "1608320400000" } },
3513 Expiry: { $date: { $numberLong: "2000000000000" } },
3485 _id: toOid2("5fdcccb875d5ad500dc477d2", buildLabel),
3486 Activation: toMongoDate2(1608320400000, buildLabel),
3487 Expiry: toMongoDate2(2000000000000, buildLabel),
3514 3488 Count: 0,
3515 3489 Goal: 2000,
3516 3490 Success: 0,
@@ -3546,9 +3520,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3546 3520 (!buildLabel || version_compare(buildLabel, gameToBuildVersion["41.0.0"]) >= 0)
3547 3521 ) {
3548 3522 worldState.Goals.push({
3549 _id: { $oid: "694189080000000000000000" },
3550 Activation: { $date: { $numberLong: "1765902600000" } },
3551 Expiry: { $date: { $numberLong: "2000000000000" } },
3523 _id: toOid2("694189080000000000000000", buildLabel),
3524 Activation: toMongoDate2(1765902600000, buildLabel),
3525 Expiry: toMongoDate2(2000000000000, buildLabel),
3552 3526 GracePeriod: { $date: { $numberLong: "2000000000000" } },
3553 3527 Count: 0,
3554 3528 Goal: 0,
@@ -3803,7 +3777,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3803 3777 // If we push it, the game may show the event even tho it's not activated yet (https://onlyg.it/OpenWF/SpaceNinjaServer/issues/2721)
3804 3778 if (timeMs >= activation) {
3805 3779 worldState.Goals.push({
3806 _id: { $oid: "5c7cb0d00000000000000000" },
3780 _id: toOid2("5c7cb0d00000000000000000", buildLabel),
3807 3781 Activation: { $date: { $numberLong: activation.toString() } },
3808 3782 Expiry: { $date: { $numberLong: expiry.toString() } },
3809 3783 Node: "SolNode129",
@@ -3842,7 +3816,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3842 3816 ]
3843 3817 });
3844 3818 worldState.NodeOverrides.push({
3845 _id: { $oid: "5c7cb0d00000000000000000" },
3819 _id: toOid2("5c7cb0d00000000000000000", buildLabel),
3846 3820 Activation: { $date: { $numberLong: activation.toString() } },
3847 3821 Expiry: { $date: { $numberLong: expiry.toString() } },
3848 3822 Node: "SolNode129",
@@ -3851,7 +3825,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3851 3825 });
3852 3826 if (count >= 35) {
3853 3827 worldState.GlobalUpgrades.push({
3854 _id: { $oid: "5c81cefa4c4566791728eaa6" },
3828 _id: toOid2("5c81cefa4c4566791728eaa6", buildLabel),
3855 3829 Activation: { $date: { $numberLong: activation.toString() } },
3856 3830 ExpiryDate: { $date: { $numberLong: expiry.toString() } },
3857 3831 UpgradeType: "GAMEPLAY_MONEY_REWARD_AMOUNT",
@@ -3863,7 +3837,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3863 3837 // Not sure about that
3864 3838 if (count == 100) {
3865 3839 worldState.GlobalUpgrades.push({
3866 _id: { $oid: "5c81cefa4c4566791728eaa7" },
3840 _id: toOid2("5c81cefa4c4566791728eaa7", buildLabel),
3867 3841 Activation: { $date: { $numberLong: activation.toString() } },
3868 3842 ExpiryDate: { $date: { $numberLong: expiry.toString() } },
3869 3843 UpgradeType: "GAMEPLAY_PICKUP_AMOUNT",
@@ -3911,13 +3885,13 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3911 3885
3912 3886 {
3913 3887 worldState.NodeOverrides.push(
3914 { _id: { $oid: "549b18e9b029cef5991d6aec" }, Node: "EuropaHUB", Hide: true },
3915 { _id: { $oid: "54a1737aeb658f6cbccf70ff" }, Node: "ErisHUB", Hide: true },
3916 { _id: { $oid: "54a736ddec12f80bd6e9e326" }, Node: "VenusHUB", Hide: true }
3888 { _id: toOid2("549b18e9b029cef5991d6aec", buildLabel), Node: "EuropaHUB", Hide: true },
3889 { _id: toOid2("54a1737aeb658f6cbccf70ff", buildLabel), Node: "ErisHUB", Hide: true },
3890 { _id: toOid2("54a736ddec12f80bd6e9e326", buildLabel), Node: "VenusHUB", Hide: true }
3917 3891 );
3918 3892 if (!buildLabel || version_compare(buildLabel, gameToBuildVersion["22.18.0"]) >= 0) {
3919 3893 worldState.NodeOverrides.push({
3920 _id: { $oid: "5ad9f9bb6df82a56eabf3d44" },
3894 _id: toOid2("5ad9f9bb6df82a56eabf3d44", buildLabel),
3921 3895 Node: "SolNode802",
3922 3896 // Elite Sanctuary Onslaught cycling every week
3923 3897 Seed: new SRng(week).randomInt(0, 0xff_ffff)
@@ -3925,20 +3899,20 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3925 3899 }
3926 3900 if (!buildLabel || version_compare(buildLabel, gameToBuildVersion["25.7.0"]) >= 0) {
3927 3901 worldState.NodeOverrides.push({
3928 _id: { $oid: "5d24d1f674491d51f8d44473" },
3902 _id: toOid2("5d24d1f674491d51f8d44473", buildLabel),
3929 3903 Node: "MercuryHUB",
3930 3904 Hide: true,
3931 3905 LevelOverride: "/Lotus/Levels/Proc/Hub/RelayStationHubHydroid",
3932 Activation: { $date: { $numberLong: "1563030000000" } }
3906 Activation: toMongoDate2(1563030000000, buildLabel)
3933 3907 });
3934 3908 }
3935 3909 if (!buildLabel || version_compare(buildLabel, gameToBuildVersion["21.0.0"]) >= 0) {
3936 3910 worldState.NodeOverrides.push({
3937 _id: { $oid: "5b8817c2bd4f253264d6aa91" },
3911 _id: toOid2("5b8817c2bd4f253264d6aa91", buildLabel),
3938 3912 Node: "EarthHUB",
3939 3913 Hide: false,
3940 3914 LevelOverride: "/Lotus/Levels/Proc/Hub/RelayStationHubTwoB",
3941 Activation: { $date: { $numberLong: "1535646600000" } }
3915 Activation: toMongoDate2(1535646600000, buildLabel)
3942 3916 });
3943 3917 }
3944 3918 }
@@ -4002,7 +3976,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
4002 3976 const bountyCycleStartSecs = Math.trunc(bountyEpoch + bountyCycle * eidolonCycleDuration);
4003 3977
4004 3978 worldState.Goals.push({
4005 _id: { $oid: "687ebbe6d1d17841c9c59f38" },
3979 _id: toOid2("687ebbe6d1d17841c9c59f38", buildLabel),
4006 3980 Activation: {
4007 3981 $date: {
4008 3982 $numberLong: config.worldState?.ghoulEmergenceOverride
@@ -4073,9 +4047,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
4073 4047
4074 4048 if (config.worldState?.creditBoost) {
4075 4049 worldState.GlobalUpgrades.push({
4076 _id: { $oid: "5b23106f283a555109666672" },
4077 Activation: { $date: { $numberLong: "1740164400000" } },
4078 ExpiryDate: { $date: { $numberLong: "2000000000000" } },
4050 _id: toOid2("5b23106f283a555109666672", buildLabel),
4051 Activation: toMongoDate2(1740164400000, buildLabel),
4052 ExpiryDate: toMongoDate2(2000000000000, buildLabel),
4079 4053 UpgradeType: "GAMEPLAY_MONEY_REWARD_AMOUNT",
4080 4054 OperationType: "MULTIPLY",
4081 4055 Value: 2,
@@ -4085,9 +4059,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
4085 4059 }
4086 4060 if (config.worldState?.affinityBoost) {
4087 4061 worldState.GlobalUpgrades.push({
4088 _id: { $oid: "5b23106f283a555109666673" },
4089 Activation: { $date: { $numberLong: "1740164400000" } },
4090 ExpiryDate: { $date: { $numberLong: "2000000000000" } },
4062 _id: toOid2("5b23106f283a555109666673", buildLabel),
4063 Activation: toMongoDate2(1740164400000, buildLabel),
4064 ExpiryDate: toMongoDate2(2000000000000, buildLabel),
4091 4065 UpgradeType: "GAMEPLAY_KILL_XP_AMOUNT",
4092 4066 OperationType: "MULTIPLY",
4093 4067 Value: 2,
@@ -4097,9 +4071,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
4097 4071 }
4098 4072 if (config.worldState?.resourceBoost) {
4099 4073 worldState.GlobalUpgrades.push({
4100 _id: { $oid: "5b23106f283a555109666674" },
4101 Activation: { $date: { $numberLong: "1740164400000" } },
4102 ExpiryDate: { $date: { $numberLong: "2000000000000" } },
4074 _id: toOid2("5b23106f283a555109666674", buildLabel),
4075 Activation: toMongoDate2(1740164400000, buildLabel),
4076 ExpiryDate: toMongoDate2(2000000000000, buildLabel),
4103 4077 UpgradeType: "GAMEPLAY_PICKUP_AMOUNT",
4104 4078 OperationType: "MULTIPLY",
4105 4079 Value: 2,
@@ -4114,14 +4088,14 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
4114 4088 // TODO: Invasions chains, e.g. an infestation mission would soon lead to other nodes on that planet also having an infestation invasion.
4115 4089 // TODO: Grineer/Corpus to fund their death stars with each invasion win.
4116 4090 {
4117 worldState.Invasions.push(createInvasion(day, 0));
4118 worldState.Invasions.push(createInvasion(day, 1));
4119 worldState.Invasions.push(createInvasion(day, 2));
4091 worldState.Invasions.push(createInvasion(day, 0, buildLabel));
4092 worldState.Invasions.push(createInvasion(day, 1, buildLabel));
4093 worldState.Invasions.push(createInvasion(day, 2, buildLabel));
4120 4094
4121 4095 // Completed invasions stay for up to 24 hours as the winner 'occupies' that node
4122 worldState.Invasions.push(createInvasion(day - 1, 0));
4123 worldState.Invasions.push(createInvasion(day - 1, 1));
4124 worldState.Invasions.push(createInvasion(day - 1, 2));
4096 worldState.Invasions.push(createInvasion(day - 1, 0, buildLabel));
4097 worldState.Invasions.push(createInvasion(day - 1, 1, buildLabel));
4098 worldState.Invasions.push(createInvasion(day - 1, 2, buildLabel));
4125 4099 }
4126 4100 }
4127 4101
Modified src/types/worldStateTypes.ts +14 -14
@@ -38,7 +38,7 @@ export interface IWorldState {
38 38 EndlessXpChoices: IEndlessXpChoice[];
39 39 FeaturedGuilds: IFeaturedGuild[];
40 40 SeasonInfo?: {
41 Activation: IMongoDate;
41 Activation: IMongoDate; // Nightwave was introduced in U24 so this is fine
42 42 Expiry: IMongoDate;
43 43 AffiliationTag: string;
44 44 Season: number;
@@ -73,7 +73,7 @@ export interface IEvent {
73 73 }
74 74
75 75 export interface IAlert {
76 _id: IOid;
76 _id: IOidWithLegacySupport;
77 77 Activation: IMongoDate;
78 78 Expiry: IMongoDate;
79 79 MissionInfo: IAlertMissionInfo;
@@ -106,9 +106,9 @@ export interface IAlertMissionInfo {
106 106 }
107 107
108 108 export interface IGoal {
109 _id: IOid;
110 Activation: IMongoDate;
111 Expiry: IMongoDate;
109 _id: IOidWithLegacySupport;
110 Activation: IMongoDateWithLegacySupport;
111 Expiry: IMongoDateWithLegacySupport;
112 112 GracePeriod?: IMongoDate; // U41+
113 113
114 114 Count?: number;
@@ -205,9 +205,9 @@ export interface ISyndicateMissionInfo {
205 205 }
206 206
207 207 export interface IGlobalUpgrade {
208 _id: IOid;
209 Activation: IMongoDate;
210 ExpiryDate: IMongoDate;
208 _id: IOidWithLegacySupport;
209 Activation: IMongoDateWithLegacySupport;
210 ExpiryDate: IMongoDateWithLegacySupport;
211 211 UpgradeType: string;
212 212 OperationType: string;
213 213 Value: number;
@@ -217,7 +217,7 @@ export interface IGlobalUpgrade {
217 217 }
218 218
219 219 export interface IInvasion {
220 _id: IOid;
220 _id: IOidWithLegacySupport;
221 221 Faction: string;
222 222 DefenderFaction: string;
223 223 Node: string;
@@ -225,12 +225,12 @@ export interface IInvasion {
225 225 Goal: number;
226 226 LocTag: string;
227 227 Completed: boolean;
228 ChainID: IOid;
228 ChainID: IOidWithLegacySupport;
229 229 AttackerReward: IMissionReward;
230 230 AttackerMissionInfo: IInvasionMissionInfo;
231 231 DefenderReward: IMissionReward;
232 232 DefenderMissionInfo: IInvasionMissionInfo;
233 Activation: IMongoDate;
233 Activation: IMongoDateWithLegacySupport;
234 234 }
235 235
236 236 export interface IInvasionMissionInfo {
@@ -259,9 +259,9 @@ export interface IFissureDatabase {
259 259 }
260 260
261 261 export interface INodeOverride {
262 _id: IOid;
263 Activation?: IMongoDate;
264 Expiry?: IMongoDate;
262 _id: IOidWithLegacySupport;
263 Activation?: IMongoDateWithLegacySupport;
264 Expiry?: IMongoDateWithLegacySupport;
265 265 Node: string;
266 266 Hide?: boolean;
267 267 Seed?: number;