forked from OpenWF/SpaceNinjaServer
Compare commits
251 Commits
Author | SHA1 | Date | |
---|---|---|---|
3053112428 | |||
f448d03880 | |||
d00fbed46f | |||
c283d61399 | |||
12d09531b3 | |||
b67ddf6df2 | |||
8b27fcf459 | |||
071ef528ea | |||
71d1b6094c | |||
fcc11206cc | |||
3c019e41b9 | |||
54a73ad5d7 | |||
62eeb313ec | |||
62d4b9f6cb | |||
1d813a1b1b | |||
4823406229 | |||
bdc41de8bb | |||
60236a1154 | |||
1979b20f8c | |||
c736310ff3 | |||
2b555a6456 | |||
870c964854 | |||
4535b193e0 | |||
943574bf3a | |||
f9a4d48b4d | |||
135b1e54fe | |||
b7c47b91ff | |||
9def5c265e | |||
65387ccdea | |||
4118528603 | |||
8ffbb308c5 | |||
2e649cabf6 | |||
5c5296d565 | |||
8f5f2fc206 | |||
0997f9567f | |||
be02435661 | |||
20c4092dfe | |||
01492f4f16 | |||
d739945a1d | |||
d43e39d7b5 | |||
b0499a62aa | |||
8f02bd1509 | |||
32f4c5105a | |||
28da982c80 | |||
ae1850d6cd | |||
b90bdd2783 | |||
90f2b90398 | |||
84916bf64e | |||
d41e4f7f56 | |||
082ae536f7 | |||
ba6cd47432 | |||
92d34fd69e | |||
09b9683fa1 | |||
a47eccdec8 | |||
ffd410537e | |||
79eab71aaf | |||
21164554a3 | |||
45c0da6ed8 | |||
727f6837ba | |||
77a3b64f49 | |||
ce59086f7d | |||
9b0989f1df | |||
b01376f703 | |||
870ff2dd2c | |||
1ac71a9b28 | |||
a622787500 | |||
52c8802d57 | |||
daf721f7cd | |||
f724073d93 | |||
8fb676c906 | |||
2ce5cc4562 | |||
099f12a197 | |||
bfe2e93c76 | |||
8b97bb4b0a | |||
85a45a04ea | |||
2a40449604 | |||
382f8c55ce | |||
77513190e4 | |||
5e8ce934c9 | |||
6de81c2b41 | |||
4c5ac4f03a | |||
d6f4c1a035 | |||
c58c70c4ce | |||
3e1e19d6c5 | |||
2521733e55 | |||
d5297d3547 | |||
5bc39aac8a | |||
b201508fa1 | |||
5f9ae2aef6 | |||
b451c73598 | |||
9d4bce852e | |||
c83e732b88 | |||
3d13ec311e | |||
31043b55de | |||
ab32728c47 | |||
3fc2dccf81 | |||
1084932afb | |||
f9b3fecc10 | |||
7a51fab5d3 | |||
0e255067a8 | |||
8d788d38a5 | |||
bdd5ade2eb | |||
3ff7e4264c | |||
29b54b52dd | |||
dab8c6c8ba | |||
bdb4c8fd7c | |||
3bcac1459b | |||
b987e01811 | |||
d831732513 | |||
42c63ecbe8 | |||
0319031e13 | |||
1f3bb88910 | |||
6171b36479 | |||
c56507e12d | |||
e545ecf767 | |||
58549c1488 | |||
bb606f3a95 | |||
4b12fe12cb | |||
4f28688837 | |||
203b3e20d9 | |||
005690daa4 | |||
5fefd189af | |||
f6cbc02c47 | |||
da6d75c748 | |||
460deed3ed | |||
4e57bcd1ae | |||
e2fe406017 | |||
c53dc2fd02 | |||
cfa3586f64 | |||
238af294fe | |||
1914fd8f10 | |||
ec4af075b5 | |||
355a70d366 | |||
cad82cf7de | |||
ff3a9b382c | |||
18fbd51efb | |||
f7b4b4f089 | |||
83743831c9 | |||
8520650018 | |||
b958c108f9 | |||
8ae5fcfad0 | |||
468efed71c | |||
4926b2f2be | |||
562ddd513f | |||
35d5c01203 | |||
8f8bc5b364 | |||
a8227ce54c | |||
ec9dc2aa5f | |||
f7906c91e3 | |||
159598979d | |||
4983417201 | |||
9b652f5c3c | |||
19b04533df | |||
cddd4bdf5c | |||
12b6e5d16e | |||
8eefd67d79 | |||
c4b2248df5 | |||
2c3043f40e | |||
7d02906656 | |||
ed54e00a03 | |||
3d6c880c96 | |||
660768b53b | |||
3de68e51d5 | |||
c06abded11 | |||
9468768947 | |||
0af7f41201 | |||
de1e2a25f2 | |||
1cf7b41d3f | |||
ab9cc685eb | |||
743b784754 | |||
5df533a7fb | |||
9417aa3c84 | |||
a1872e2b07 | |||
9042e85355 | |||
66ee550ccd | |||
7a295a86ec | |||
88d00eaaa1 | |||
1e8f2fc766 | |||
0d842ade90 | |||
4e3a2e17ee | |||
61864b2be1 | |||
45748fa8be | |||
afec59e8a6 | |||
ee1a49f5f2 | |||
9e94083875 | |||
db0e0d80dd | |||
5cda2e2d08 | |||
e23d865044 | |||
c7658b5b20 | |||
9993500eca | |||
267357871b | |||
cf5ed0442d | |||
de36e2ee8d | |||
ca1b6c31b6 | |||
d66c474bfc | |||
781f01520f | |||
ac37702468 | |||
75c011e3cb | |||
4d4f885c8e | |||
66d1a65e63 | |||
48eefd8db1 | |||
4a6a5ea9cc | |||
95c0ad7892 | |||
a90d3a5156 | |||
d0c9409a2d | |||
bbde7b2141 | |||
5271123090 | |||
f3e56480e5 | |||
6f46ace40c | |||
883426e429 | |||
13432bf034 | |||
a1267e5f64 | |||
2058207b6a | |||
c7c416c100 | |||
90e97d7888 | |||
3f6734ac1c | |||
6f64690b91 | |||
fb5a7320bb | |||
143b358a03 | |||
0b75757277 | |||
fd7f4c9e92 | |||
fa6fac494b | |||
6b3f524574 | |||
506365f97e | |||
70646160c3 | |||
3ffa4a7fd3 | |||
826a09a473 | |||
100aefcee4 | |||
409c089d11 | |||
8c32dc2670 | |||
a67f99b665 | |||
756a01d270 | |||
efc7467a99 | |||
99e1a66da8 | |||
370f8c1008 | |||
f039998d71 | |||
eb594af9d8 | |||
bb8596fa87 | |||
a85539a686 | |||
ada6a4bad0 | |||
948104a9a6 | |||
7a8b12b372 | |||
26d644a982 | |||
d6750cd84b | |||
f3601ec43e | |||
15aaa28a4f | |||
ce5b0fc9e2 | |||
64290b72c0 | |||
570c6fe0d1 | |||
146dbd1b89 | |||
e17d43dcb6 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -10,6 +10,8 @@ jobs:
|
|||||||
uses: actions/checkout@v4.1.2
|
uses: actions/checkout@v4.1.2
|
||||||
- name: Setup Node.js environment
|
- name: Setup Node.js environment
|
||||||
uses: actions/setup-node@v4.0.2
|
uses: actions/setup-node@v4.0.2
|
||||||
|
with:
|
||||||
|
node-version: ">=20.6.0"
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: cp config.json.example config.json
|
- run: cp config.json.example config.json
|
||||||
- run: npm run verify
|
- run: npm run verify
|
||||||
|
49
Dockerfile
49
Dockerfile
@ -5,17 +5,44 @@ ENV APP_MY_ADDRESS=localhost
|
|||||||
ENV APP_HTTP_PORT=80
|
ENV APP_HTTP_PORT=80
|
||||||
ENV APP_HTTPS_PORT=443
|
ENV APP_HTTPS_PORT=443
|
||||||
ENV APP_AUTO_CREATE_ACCOUNT=true
|
ENV APP_AUTO_CREATE_ACCOUNT=true
|
||||||
ENV APP_SKIP_STORY_MODE_CHOICE=true
|
ENV APP_SKIP_TUTORIAL=false
|
||||||
ENV APP_SKIP_TUTORIAL=true
|
ENV APP_SKIP_ALL_DIALOGUE=false
|
||||||
ENV APP_SKIP_ALL_DIALOGUE=true
|
ENV APP_UNLOCK_ALL_SCANS=false
|
||||||
ENV APP_UNLOCK_ALL_SCANS=true
|
ENV APP_UNLOCK_ALL_MISSIONS=false
|
||||||
ENV APP_UNLOCK_ALL_MISSIONS=true
|
ENV APP_INFINITE_CREDITS=false
|
||||||
ENV APP_INFINITE_RESOURCES=true
|
ENV APP_INFINITE_PLATINUM=false
|
||||||
ENV APP_UNLOCK_ALL_SHIP_FEATURES=true
|
ENV APP_INFINITE_ENDO=false
|
||||||
ENV APP_UNLOCK_ALL_SHIP_DECORATIONS=true
|
ENV APP_INFINITE_REGAL_AYA=false
|
||||||
ENV APP_UNLOCK_ALL_FLAVOUR_ITEMS=true
|
ENV APP_INFINITE_HELMINTH_MATERIALS=false
|
||||||
ENV APP_UNLOCK_ALL_SKINS=true
|
ENV APP_CLAIMING_BLUEPRINT_REFUNDS_INGREDIENTS=false
|
||||||
ENV APP_UNIVERSAL_POLARITY_EVERYWHERE=true
|
ENV APP_DONT_SUBTRACT_VOIDTRACES=false
|
||||||
|
ENV APP_DONT_SUBTRACT_CONSUMABLES=false
|
||||||
|
ENV APP_UNLOCK_ALL_SHIP_FEATURES=false
|
||||||
|
ENV APP_UNLOCK_ALL_SHIP_DECORATIONS=false
|
||||||
|
ENV APP_UNLOCK_ALL_FLAVOUR_ITEMS=false
|
||||||
|
ENV APP_UNLOCK_ALL_SKINS=false
|
||||||
|
ENV APP_UNLOCK_ALL_CAPTURA_SCENES=false
|
||||||
|
ENV APP_UNIVERSAL_POLARITY_EVERYWHERE=false
|
||||||
|
ENV APP_UNLOCK_DOUBLE_CAPACITY_POTATOES_EVERYWHERE=false
|
||||||
|
ENV APP_UNLOCK_EXILUS_EVERYWHERE=false
|
||||||
|
ENV APP_UNLOCK_ARCANES_EVERYWHERE=false
|
||||||
|
ENV APP_NO_DAILY_FOCUS_LIMIT=false
|
||||||
|
ENV APP_NO_ARGON_CRYSTAL_DECAY=false
|
||||||
|
ENV APP_NO_MASTERY_RANK_UP_COOLDOWN=false
|
||||||
|
ENV APP_NO_VENDOR_PURCHASE_LIMITS=true
|
||||||
|
ENV APP_NO_DEATH_MARKS=false
|
||||||
|
ENV APP_NO_KIM_COOLDOWNS=false
|
||||||
|
ENV APP_SYNDICATE_MISSIONS_REPEATABLE=false
|
||||||
|
ENV APP_INSTANT_FINISH_RIVEN_CHALLENGE=false
|
||||||
|
ENV APP_INSTANT_RESOURCE_EXTRACTOR_DRONES=false
|
||||||
|
ENV APP_NO_RESOURCE_EXTRACTOR_DRONES_DAMAGE=false
|
||||||
|
ENV APP_SKIP_CLAN_KEY_CRAFTING=false
|
||||||
|
ENV APP_NO_DOJO_ROOM_BUILD_STAGE=false
|
||||||
|
ENV APP_NO_DECO_BUILD_STAGE=false
|
||||||
|
ENV APP_FAST_DOJO_ROOM_DESTRUCTION=false
|
||||||
|
ENV APP_NO_DOJO_RESEARCH_COSTS=false
|
||||||
|
ENV APP_NO_DOJO_RESEARCH_TIME=false
|
||||||
|
ENV APP_FAST_CLAN_ASCENSION=false
|
||||||
ENV APP_SPOOF_MASTERY_RANK=-1
|
ENV APP_SPOOF_MASTERY_RANK=-1
|
||||||
|
|
||||||
RUN apk add --no-cache bash sed wget jq
|
RUN apk add --no-cache bash sed wget jq
|
||||||
|
20
README.md
20
README.md
@ -14,4 +14,22 @@ SpaceNinjaServer requires a `config.json`. To set it up, you can copy the [confi
|
|||||||
|
|
||||||
- `logger.level` can be `fatal`, `error`, `warn`, `info`, `http`, `debug`, or `trace`.
|
- `logger.level` can be `fatal`, `error`, `warn`, `info`, `http`, `debug`, or `trace`.
|
||||||
- `myIrcAddresses` can be used to point to an IRC server. If not provided, defaults to `[ myAddress ]`.
|
- `myIrcAddresses` can be used to point to an IRC server. If not provided, defaults to `[ myAddress ]`.
|
||||||
- `worldState.lockTime` will lock the time provided in worldState if nonzero, e.g. `1743202800` for night in POE.
|
- `worldState.eidolonOverride` can be set to `day` or `night` to lock the time to day/fass and night/vome on Plains of Eidolon/Cambion Drift.
|
||||||
|
- `worldState.vallisOverride` can be set to `warm` or `cold` to lock the temperature on Orb Vallis.
|
||||||
|
- `worldState.nightwaveOverride` will lock the nightwave season, assuming the client is new enough for it. Valid values:
|
||||||
|
- `RadioLegionIntermission13Syndicate` for Nora's Mix Vol. 9
|
||||||
|
- `RadioLegionIntermission12Syndicate` for Nora's Mix Vol. 8
|
||||||
|
- `RadioLegionIntermission11Syndicate` for Nora's Mix Vol. 7
|
||||||
|
- `RadioLegionIntermission10Syndicate` for Nora's Mix Vol. 6
|
||||||
|
- `RadioLegionIntermission9Syndicate` for Nora's Mix Vol. 5
|
||||||
|
- `RadioLegionIntermission8Syndicate` for Nora's Mix Vol. 4
|
||||||
|
- `RadioLegionIntermission7Syndicate` for Nora's Mix Vol. 3
|
||||||
|
- `RadioLegionIntermission6Syndicate` for Nora's Mix Vol. 2
|
||||||
|
- `RadioLegionIntermission5Syndicate` for Nora's Mix Vol. 1
|
||||||
|
- `RadioLegionIntermission4Syndicate` for Nora's Choice
|
||||||
|
- `RadioLegionIntermission3Syndicate` for Intermission III
|
||||||
|
- `RadioLegion3Syndicate` for Glassmaker
|
||||||
|
- `RadioLegionIntermission2Syndicate` for Intermission II
|
||||||
|
- `RadioLegion2Syndicate` for The Emissary
|
||||||
|
- `RadioLegionIntermissionSyndicate` for Intermission I
|
||||||
|
- `RadioLegionSyndicate` for The Wolf of Saturn Six
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
echo Updating SpaceNinjaServer...
|
echo Updating SpaceNinjaServer...
|
||||||
git config remote.origin.url https://openwf.io/SpaceNinjaServer.git
|
|
||||||
git fetch --prune
|
git fetch --prune
|
||||||
git stash
|
git stash
|
||||||
git reset --hard origin/main
|
git checkout -f origin/main
|
||||||
|
|
||||||
if exist static\data\0\ (
|
if exist static\data\0\ (
|
||||||
echo Updating stripped assets...
|
echo Updating stripped assets...
|
||||||
|
23
UPDATE AND START SERVER.sh
Executable file
23
UPDATE AND START SERVER.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Updating SpaceNinjaServer..."
|
||||||
|
git fetch --prune
|
||||||
|
git stash
|
||||||
|
git checkout -f origin/main
|
||||||
|
|
||||||
|
if [ -d "static/data/0/" ]; then
|
||||||
|
echo "Updating stripped assets..."
|
||||||
|
cd static/data/0/
|
||||||
|
git pull
|
||||||
|
cd ../../../
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Updating dependencies..."
|
||||||
|
npm i --omit=dev
|
||||||
|
|
||||||
|
npm run build
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
npm run start
|
||||||
|
echo "SpaceNinjaServer seems to have crashed."
|
||||||
|
fi
|
||||||
|
|
@ -19,6 +19,9 @@
|
|||||||
"infiniteEndo": false,
|
"infiniteEndo": false,
|
||||||
"infiniteRegalAya": false,
|
"infiniteRegalAya": false,
|
||||||
"infiniteHelminthMaterials": false,
|
"infiniteHelminthMaterials": false,
|
||||||
|
"claimingBlueprintRefundsIngredients": false,
|
||||||
|
"dontSubtractVoidTraces": false,
|
||||||
|
"dontSubtractConsumables": false,
|
||||||
"unlockAllShipFeatures": false,
|
"unlockAllShipFeatures": false,
|
||||||
"unlockAllShipDecorations": false,
|
"unlockAllShipDecorations": false,
|
||||||
"unlockAllFlavourItems": false,
|
"unlockAllFlavourItems": false,
|
||||||
@ -35,8 +38,11 @@
|
|||||||
"noVendorPurchaseLimits": true,
|
"noVendorPurchaseLimits": true,
|
||||||
"noDeathMarks": false,
|
"noDeathMarks": false,
|
||||||
"noKimCooldowns": false,
|
"noKimCooldowns": false,
|
||||||
|
"syndicateMissionsRepeatable": false,
|
||||||
|
"instantFinishRivenChallenge": false,
|
||||||
"instantResourceExtractorDrones": false,
|
"instantResourceExtractorDrones": false,
|
||||||
"noResourceExtractorDronesDamage": false,
|
"noResourceExtractorDronesDamage": false,
|
||||||
|
"skipClanKeyCrafting": false,
|
||||||
"noDojoRoomBuildStage": false,
|
"noDojoRoomBuildStage": false,
|
||||||
"noDecoBuildStage": false,
|
"noDecoBuildStage": false,
|
||||||
"fastDojoRoomDestruction": false,
|
"fastDojoRoomDestruction": false,
|
||||||
@ -44,11 +50,17 @@
|
|||||||
"noDojoResearchTime": false,
|
"noDojoResearchTime": false,
|
||||||
"fastClanAscension": false,
|
"fastClanAscension": false,
|
||||||
"spoofMasteryRank": -1,
|
"spoofMasteryRank": -1,
|
||||||
|
"nightwaveStandingMultiplier": 1,
|
||||||
"worldState": {
|
"worldState": {
|
||||||
"creditBoost": false,
|
"creditBoost": false,
|
||||||
"affinityBoost": false,
|
"affinityBoost": false,
|
||||||
"resourceBoost": false,
|
"resourceBoost": false,
|
||||||
"starDays": true,
|
"starDays": true,
|
||||||
"lockTime": 0
|
"eidolonOverride": "",
|
||||||
|
"vallisOverride": "",
|
||||||
|
"nightwaveOverride": ""
|
||||||
|
},
|
||||||
|
"dev": {
|
||||||
|
"keepVendorsExpired": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,19 +12,44 @@ services:
|
|||||||
# APP_HTTP_PORT: 80
|
# APP_HTTP_PORT: 80
|
||||||
# APP_HTTPS_PORT: 443
|
# APP_HTTPS_PORT: 443
|
||||||
# APP_AUTO_CREATE_ACCOUNT: true
|
# APP_AUTO_CREATE_ACCOUNT: true
|
||||||
# APP_SKIP_STORY_MODE_CHOICE: true
|
# APP_SKIP_TUTORIAL: false
|
||||||
# APP_SKIP_TUTORIAL: true
|
# APP_SKIP_ALL_DIALOGUE: false
|
||||||
# APP_SKIP_ALL_DIALOGUE: true
|
# APP_UNLOCK_ALL_SCANS: false
|
||||||
# APP_UNLOCK_ALL_SCANS: true
|
# APP_UNLOCK_ALL_MISSIONS: false
|
||||||
# APP_UNLOCK_ALL_MISSIONS: true
|
# APP_INFINITE_CREDITS: false
|
||||||
# APP_UNLOCK_ALL_QUESTS: true
|
# APP_INFINITE_PLATINUM: false
|
||||||
# APP_COMPLETE_ALL_QUESTS: true
|
# APP_INFINITE_ENDO: false
|
||||||
# APP_INFINITE_RESOURCES: true
|
# APP_INFINITE_REGAL_AYA: false
|
||||||
# APP_UNLOCK_ALL_SHIP_FEATURES: true
|
# APP_INFINITE_HELMINTH_MATERIALS: false
|
||||||
# APP_UNLOCK_ALL_SHIP_DECORATIONS: true
|
# APP_CLAIMING_BLUEPRINT_REFUNDS_INGREDIENTS: false
|
||||||
# APP_UNLOCK_ALL_FLAVOUR_ITEMS: true
|
# APP_DONT_SUBTRACT_VOIDTRACES: false
|
||||||
# APP_UNLOCK_ALL_SKINS: true
|
# APP_DONT_SUBTRACT_CONSUMABLES: false
|
||||||
# APP_UNIVERSAL_POLARITY_EVERYWHERE: true
|
# APP_UNLOCK_ALL_SHIP_FEATURES: false
|
||||||
|
# APP_UNLOCK_ALL_SHIP_DECORATIONS: false
|
||||||
|
# APP_UNLOCK_ALL_FLAVOUR_ITEMS: false
|
||||||
|
# APP_UNLOCK_ALL_SKINS: false
|
||||||
|
# APP_UNLOCK_ALL_CAPTURA_SCENES: false
|
||||||
|
# APP_UNIVERSAL_POLARITY_EVERYWHERE: false
|
||||||
|
# APP_UNLOCK_DOUBLE_CAPACITY_POTATOES_EVERYWHERE: false
|
||||||
|
# APP_UNLOCK_EXILUS_EVERYWHERE: false
|
||||||
|
# APP_UNLOCK_ARCANES_EVERYWHERE: false
|
||||||
|
# APP_NO_DAILY_FOCUS_LIMIT: false
|
||||||
|
# APP_NO_ARGON_CRYSTAL_DECAY: false
|
||||||
|
# APP_NO_MASTERY_RANK_UP_COOLDOWN: false
|
||||||
|
# APP_NO_VENDOR_PURCHASE_LIMITS: true
|
||||||
|
# APP_NO_DEATH_MARKS: false
|
||||||
|
# APP_NO_KIM_COOLDOWNS: false
|
||||||
|
# APP_SYNDICATE_MISSIONS_REPEATABLE: false
|
||||||
|
# APP_INSTANT_FINISH_RIVEN_CHALLENGE: false
|
||||||
|
# APP_INSTANT_RESOURCE_EXTRACTOR_DRONES: false
|
||||||
|
# APP_NO_RESOURCE_EXTRACTOR_DRONES_DAMAGE: false
|
||||||
|
# APP_SKIP_CLAN_KEY_CRAFTING: false
|
||||||
|
# APP_NO_DOJO_ROOM_BUILD_STAGE: false
|
||||||
|
# APP_NO_DECO_BUILD_STAGE: false
|
||||||
|
# APP_FAST_DOJO_ROOM_DESTRUCTION: false
|
||||||
|
# APP_NO_DOJO_RESEARCH_COSTS: false
|
||||||
|
# APP_NO_DOJO_RESEARCH_TIME: false
|
||||||
|
# APP_FAST_CLAN_ASCENSION: false
|
||||||
# APP_SPOOF_MASTERY_RANK: -1
|
# APP_SPOOF_MASTERY_RANK: -1
|
||||||
volumes:
|
volumes:
|
||||||
- ./docker-data/static:/app/static/data
|
- ./docker-data/static:/app/static/data
|
||||||
|
@ -19,5 +19,6 @@ do
|
|||||||
mv config.tmp config.json
|
mv config.tmp config.json
|
||||||
done
|
done
|
||||||
|
|
||||||
npm install
|
npm i --omit=dev
|
||||||
exec npm run dev
|
npm run build
|
||||||
|
exec npm run start
|
||||||
|
665
package-lock.json
generated
665
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@ -20,28 +20,24 @@
|
|||||||
"@types/morgan": "^1.9.9",
|
"@types/morgan": "^1.9.9",
|
||||||
"crc-32": "^1.2.2",
|
"crc-32": "^1.2.2",
|
||||||
"express": "^5",
|
"express": "^5",
|
||||||
"json-with-bigint": "^3.2.2",
|
"json-with-bigint": "^3.4.4",
|
||||||
"mongoose": "^8.11.0",
|
"mongoose": "^8.11.0",
|
||||||
"morgan": "^1.10.0",
|
"morgan": "^1.10.0",
|
||||||
"ncp": "^2.0.0",
|
"ncp": "^2.0.0",
|
||||||
"typescript": "^5.5",
|
"typescript": "^5.5",
|
||||||
"warframe-public-export-plus": "^0.5.56",
|
"warframe-public-export-plus": "^0.5.66",
|
||||||
"warframe-riven-info": "^0.1.2",
|
"warframe-riven-info": "^0.1.2",
|
||||||
"winston": "^3.17.0",
|
"winston": "^3.17.0",
|
||||||
"winston-daily-rotate-file": "^5.0.0"
|
"winston-daily-rotate-file": "^5.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rxliuli/tsgo": "^2025.3.31",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^8.28.0",
|
"@typescript-eslint/eslint-plugin": "^8.28.0",
|
||||||
"@typescript-eslint/parser": "^8.28.0",
|
"@typescript-eslint/parser": "^8.28.0",
|
||||||
|
"@typescript/native-preview": "^7.0.0-dev.20250523.1",
|
||||||
"eslint": "^8",
|
"eslint": "^8",
|
||||||
"eslint-plugin-prettier": "^5.2.5",
|
"eslint-plugin-prettier": "^5.2.5",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
"ts-node-dev": "^2.0.0",
|
"ts-node-dev": "^2.0.0",
|
||||||
"tsconfig-paths": "^4.2.0"
|
"tsconfig-paths": "^4.2.0"
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18.15.0",
|
|
||||||
"npm": ">=9.5.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,13 @@ app.use((req, _res, next) => {
|
|||||||
if (req.headers["content-encoding"] == "ezip" || req.headers["content-encoding"] == "e") {
|
if (req.headers["content-encoding"] == "ezip" || req.headers["content-encoding"] == "e") {
|
||||||
req.headers["content-encoding"] = undefined;
|
req.headers["content-encoding"] = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// U18 uses application/x-www-form-urlencoded even tho the data is JSON which Express doesn't like.
|
||||||
|
// U17 sets no Content-Type at all, which Express also doesn't like.
|
||||||
|
if (!req.headers["content-type"] || req.headers["content-type"] == "application/x-www-form-urlencoded") {
|
||||||
|
req.headers["content-type"] = "application/octet-stream";
|
||||||
|
}
|
||||||
|
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2,15 +2,18 @@ const millisecondsPerSecond = 1000;
|
|||||||
const secondsPerMinute = 60;
|
const secondsPerMinute = 60;
|
||||||
const minutesPerHour = 60;
|
const minutesPerHour = 60;
|
||||||
const hoursPerDay = 24;
|
const hoursPerDay = 24;
|
||||||
|
const daysPerWeek = 7;
|
||||||
|
|
||||||
const unixSecond = millisecondsPerSecond;
|
const unixSecond = millisecondsPerSecond;
|
||||||
const unixMinute = secondsPerMinute * millisecondsPerSecond;
|
const unixMinute = secondsPerMinute * millisecondsPerSecond;
|
||||||
const unixHour = unixMinute * minutesPerHour;
|
const unixHour = unixMinute * minutesPerHour;
|
||||||
const unixDay = hoursPerDay * unixHour;
|
const unixDay = hoursPerDay * unixHour;
|
||||||
|
const unixWeek = daysPerWeek * unixDay;
|
||||||
|
|
||||||
export const unixTimesInMs = {
|
export const unixTimesInMs = {
|
||||||
second: unixSecond,
|
second: unixSecond,
|
||||||
minute: unixMinute,
|
minute: unixMinute,
|
||||||
hour: unixHour,
|
hour: unixHour,
|
||||||
day: unixDay
|
day: unixDay,
|
||||||
|
week: unixWeek
|
||||||
};
|
};
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
import { toOid } from "@/src/helpers/inventoryHelpers";
|
import { toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { createVeiledRivenFingerprint, rivenRawToRealWeighted } from "@/src/helpers/rivenHelper";
|
import {
|
||||||
|
createVeiledRivenFingerprint,
|
||||||
|
createUnveiledRivenFingerprint,
|
||||||
|
rivenRawToRealWeighted
|
||||||
|
} from "@/src/helpers/rivenHelper";
|
||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { addMods, getInventory } from "@/src/services/inventoryService";
|
import { addMods, getInventory } from "@/src/services/inventoryService";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { getRandomElement } from "@/src/services/rngService";
|
import { getRandomElement } from "@/src/services/rngService";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { ExportUpgrades } from "warframe-public-export-plus";
|
import { ExportUpgrades } from "warframe-public-export-plus";
|
||||||
|
import { config } from "@/src/services/configService";
|
||||||
|
|
||||||
export const activateRandomModController: RequestHandler = async (req, res) => {
|
export const activateRandomModController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -17,8 +22,10 @@ export const activateRandomModController: RequestHandler = async (req, res) => {
|
|||||||
ItemCount: -1
|
ItemCount: -1
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
const rivenType = getRandomElement(rivenRawToRealWeighted[request.ItemType]);
|
const rivenType = getRandomElement(rivenRawToRealWeighted[request.ItemType])!;
|
||||||
const fingerprint = createVeiledRivenFingerprint(ExportUpgrades[rivenType]);
|
const fingerprint = config.instantFinishRivenChallenge
|
||||||
|
? createUnveiledRivenFingerprint(ExportUpgrades[rivenType])
|
||||||
|
: createVeiledRivenFingerprint(ExportUpgrades[rivenType]);
|
||||||
const upgradeIndex =
|
const upgradeIndex =
|
||||||
inventory.Upgrades.push({
|
inventory.Upgrades.push({
|
||||||
ItemType: rivenType,
|
ItemType: rivenType,
|
||||||
|
60
src/controllers/api/addFriendController.ts
Normal file
60
src/controllers/api/addFriendController.ts
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
import { toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
|
import { Friendship } from "@/src/models/friendModel";
|
||||||
|
import { addAccountDataToFriendInfo, addInventoryDataToFriendInfo } from "@/src/services/friendService";
|
||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { IFriendInfo } from "@/src/types/friendTypes";
|
||||||
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
|
export const addFriendController: RequestHandler = async (req, res) => {
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
const payload = getJSONfromString<IAddFriendRequest>(String(req.body));
|
||||||
|
const promises: Promise<void>[] = [];
|
||||||
|
const newFriends: IFriendInfo[] = [];
|
||||||
|
if (payload.friend == "all") {
|
||||||
|
const [internalFriendships, externalFriendships] = await Promise.all([
|
||||||
|
Friendship.find({ owner: accountId }, "friend"),
|
||||||
|
Friendship.find({ friend: accountId }, "owner")
|
||||||
|
]);
|
||||||
|
for (const externalFriendship of externalFriendships) {
|
||||||
|
if (!internalFriendships.find(x => x.friend.equals(externalFriendship.owner))) {
|
||||||
|
promises.push(
|
||||||
|
Friendship.insertOne({
|
||||||
|
owner: accountId,
|
||||||
|
friend: externalFriendship.owner,
|
||||||
|
Note: externalFriendship.Note // TOVERIFY: Should the note be copied when accepting a friend request?
|
||||||
|
}) as unknown as Promise<void>
|
||||||
|
);
|
||||||
|
newFriends.push({
|
||||||
|
_id: toOid(externalFriendship.owner)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const externalFriendship = await Friendship.findOne({ owner: payload.friend, friend: accountId }, "Note");
|
||||||
|
if (externalFriendship) {
|
||||||
|
promises.push(
|
||||||
|
Friendship.insertOne({
|
||||||
|
owner: accountId,
|
||||||
|
friend: payload.friend,
|
||||||
|
Note: externalFriendship.Note
|
||||||
|
}) as unknown as Promise<void>
|
||||||
|
);
|
||||||
|
newFriends.push({
|
||||||
|
_id: { $oid: payload.friend }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const newFriend of newFriends) {
|
||||||
|
promises.push(addAccountDataToFriendInfo(newFriend));
|
||||||
|
promises.push(addInventoryDataToFriendInfo(newFriend));
|
||||||
|
}
|
||||||
|
await Promise.all(promises);
|
||||||
|
res.json({
|
||||||
|
Friends: newFriends
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
interface IAddFriendRequest {
|
||||||
|
friend: string; // oid or "all" in which case all=1 is also a query parameter
|
||||||
|
}
|
@ -2,7 +2,7 @@ import { toOid } from "@/src/helpers/inventoryHelpers";
|
|||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { Account, Ignore } from "@/src/models/loginModel";
|
import { Account, Ignore } from "@/src/models/loginModel";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { IFriendInfo } from "@/src/types/guildTypes";
|
import { IFriendInfo } from "@/src/types/friendTypes";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
export const addIgnoredUserController: RequestHandler = async (req, res) => {
|
export const addIgnoredUserController: RequestHandler = async (req, res) => {
|
||||||
|
52
src/controllers/api/addPendingFriendController.ts
Normal file
52
src/controllers/api/addPendingFriendController.ts
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
|
import { Friendship } from "@/src/models/friendModel";
|
||||||
|
import { Account } from "@/src/models/loginModel";
|
||||||
|
import { addInventoryDataToFriendInfo, areFriendsOfFriends } from "@/src/services/friendService";
|
||||||
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { IFriendInfo } from "@/src/types/friendTypes";
|
||||||
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
|
export const addPendingFriendController: RequestHandler = async (req, res) => {
|
||||||
|
const payload = getJSONfromString<IAddPendingFriendRequest>(String(req.body));
|
||||||
|
|
||||||
|
const account = await Account.findOne({ DisplayName: payload.friend });
|
||||||
|
if (!account) {
|
||||||
|
res.status(400).end();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
const inventory = await getInventory(account._id.toString(), "Settings");
|
||||||
|
if (
|
||||||
|
inventory.Settings?.FriendInvRestriction == "GIFT_MODE_NONE" ||
|
||||||
|
(inventory.Settings?.FriendInvRestriction == "GIFT_MODE_FRIENDS" &&
|
||||||
|
!(await areFriendsOfFriends(account._id, accountId)))
|
||||||
|
) {
|
||||||
|
res.status(400).send("Friend Invite Restriction");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await Friendship.insertOne({
|
||||||
|
owner: accountId,
|
||||||
|
friend: account._id,
|
||||||
|
Note: payload.message
|
||||||
|
});
|
||||||
|
|
||||||
|
const friendInfo: IFriendInfo = {
|
||||||
|
_id: toOid(account._id),
|
||||||
|
DisplayName: account.DisplayName,
|
||||||
|
LastLogin: toMongoDate(account.LastLogin),
|
||||||
|
Note: payload.message
|
||||||
|
};
|
||||||
|
await addInventoryDataToFriendInfo(friendInfo);
|
||||||
|
res.json({
|
||||||
|
Friend: friendInfo
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
interface IAddPendingFriendRequest {
|
||||||
|
friend: string;
|
||||||
|
message: string;
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
import { getJSONfromString, regexEscape } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString, regexEscape } from "@/src/helpers/stringHelpers";
|
||||||
import { Alliance, AllianceMember, Guild, GuildMember } from "@/src/models/guildModel";
|
import { Alliance, AllianceMember, Guild, GuildMember } from "@/src/models/guildModel";
|
||||||
import { createMessage } from "@/src/services/inboxService";
|
import { createMessage } from "@/src/services/inboxService";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { getEffectiveAvatarImageType, getInventory } from "@/src/services/inventoryService";
|
||||||
import { getAccountForRequest, getSuffixedName } from "@/src/services/loginService";
|
import { getAccountForRequest, getSuffixedName } from "@/src/services/loginService";
|
||||||
import { GuildPermission } from "@/src/types/guildTypes";
|
import { GuildPermission } from "@/src/types/guildTypes";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
@ -75,7 +75,7 @@ export const addToAllianceController: RequestHandler = async (req, res) => {
|
|||||||
const invitedClanOwnerMember = (await GuildMember.findOne({ guildId: guilds[0]._id, rank: 0 }))!;
|
const invitedClanOwnerMember = (await GuildMember.findOne({ guildId: guilds[0]._id, rank: 0 }))!;
|
||||||
const senderInventory = await getInventory(account._id.toString(), "ActiveAvatarImageType");
|
const senderInventory = await getInventory(account._id.toString(), "ActiveAvatarImageType");
|
||||||
const senderGuild = (await Guild.findById(allianceMember.guildId, "Name"))!;
|
const senderGuild = (await Guild.findById(allianceMember.guildId, "Name"))!;
|
||||||
const alliance = (await Alliance.findById(req.query.allianceId, "Name"))!;
|
const alliance = (await Alliance.findById(req.query.allianceId as string, "Name"))!;
|
||||||
await createMessage(invitedClanOwnerMember.accountId, [
|
await createMessage(invitedClanOwnerMember.accountId, [
|
||||||
{
|
{
|
||||||
sndr: getSuffixedName(account),
|
sndr: getSuffixedName(account),
|
||||||
@ -95,7 +95,7 @@ export const addToAllianceController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
sub: "/Lotus/Language/Menu/Mailbox_AllianceInvite_Title",
|
sub: "/Lotus/Language/Menu/Mailbox_AllianceInvite_Title",
|
||||||
icon: ExportFlavour[senderInventory.ActiveAvatarImageType].icon,
|
icon: ExportFlavour[getEffectiveAvatarImageType(senderInventory)].icon,
|
||||||
contextInfo: alliance._id.toString(),
|
contextInfo: alliance._id.toString(),
|
||||||
highPriority: true,
|
highPriority: true,
|
||||||
acceptAction: "ALLIANCE_INVITE",
|
acceptAction: "ALLIANCE_INVITE",
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
|
import { toMongoDate } from "@/src/helpers/inventoryHelpers";
|
||||||
import { Guild, GuildMember } from "@/src/models/guildModel";
|
import { Guild, GuildMember } from "@/src/models/guildModel";
|
||||||
import { Account } from "@/src/models/loginModel";
|
import { Account } from "@/src/models/loginModel";
|
||||||
import { fillInInventoryDataForGuildMember, hasGuildPermission } from "@/src/services/guildService";
|
import { addInventoryDataToFriendInfo, areFriends } from "@/src/services/friendService";
|
||||||
|
import { hasGuildPermission } from "@/src/services/guildService";
|
||||||
import { createMessage } from "@/src/services/inboxService";
|
import { createMessage } from "@/src/services/inboxService";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { getEffectiveAvatarImageType, getInventory } from "@/src/services/inventoryService";
|
||||||
import { getAccountForRequest, getAccountIdForRequest, getSuffixedName } from "@/src/services/loginService";
|
import { getAccountForRequest, getAccountIdForRequest, getSuffixedName } from "@/src/services/loginService";
|
||||||
import { IOid } from "@/src/types/commonTypes";
|
import { IOid } from "@/src/types/commonTypes";
|
||||||
import { GuildPermission, IGuildMemberClient } from "@/src/types/guildTypes";
|
import { GuildPermission, IGuildMemberClient } from "@/src/types/guildTypes";
|
||||||
@ -22,15 +24,18 @@ export const addToGuildController: RequestHandler = async (req, res) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const senderAccount = await getAccountForRequest(req);
|
||||||
const inventory = await getInventory(account._id.toString(), "Settings");
|
const inventory = await getInventory(account._id.toString(), "Settings");
|
||||||
// TODO: Also consider GIFT_MODE_FRIENDS once friends are implemented
|
if (
|
||||||
if (inventory.Settings?.GuildInvRestriction == "GIFT_MODE_NONE") {
|
inventory.Settings?.GuildInvRestriction == "GIFT_MODE_NONE" ||
|
||||||
|
(inventory.Settings?.GuildInvRestriction == "GIFT_MODE_FRIENDS" &&
|
||||||
|
!(await areFriends(account._id, senderAccount._id)))
|
||||||
|
) {
|
||||||
res.status(400).json("Invite restricted");
|
res.status(400).json("Invite restricted");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const guild = (await Guild.findById(payload.GuildId.$oid, "Name Ranks"))!;
|
const guild = (await Guild.findById(payload.GuildId.$oid, "Name Ranks"))!;
|
||||||
const senderAccount = await getAccountForRequest(req);
|
|
||||||
if (!(await hasGuildPermission(guild, senderAccount._id.toString(), GuildPermission.Recruiter))) {
|
if (!(await hasGuildPermission(guild, senderAccount._id.toString(), GuildPermission.Recruiter))) {
|
||||||
res.status(400).json("Invalid permission");
|
res.status(400).json("Invalid permission");
|
||||||
}
|
}
|
||||||
@ -59,7 +64,7 @@ export const addToGuildController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
sub: "/Lotus/Language/Menu/Mailbox_ClanInvite_Title",
|
sub: "/Lotus/Language/Menu/Mailbox_ClanInvite_Title",
|
||||||
icon: ExportFlavour[senderInventory.ActiveAvatarImageType].icon,
|
icon: ExportFlavour[getEffectiveAvatarImageType(senderInventory)].icon,
|
||||||
contextInfo: payload.GuildId.$oid,
|
contextInfo: payload.GuildId.$oid,
|
||||||
highPriority: true,
|
highPriority: true,
|
||||||
acceptAction: "GUILD_INVITE",
|
acceptAction: "GUILD_INVITE",
|
||||||
@ -71,10 +76,11 @@ export const addToGuildController: RequestHandler = async (req, res) => {
|
|||||||
const member: IGuildMemberClient = {
|
const member: IGuildMemberClient = {
|
||||||
_id: { $oid: account._id.toString() },
|
_id: { $oid: account._id.toString() },
|
||||||
DisplayName: account.DisplayName,
|
DisplayName: account.DisplayName,
|
||||||
|
LastLogin: toMongoDate(account.LastLogin),
|
||||||
Rank: 7,
|
Rank: 7,
|
||||||
Status: 2
|
Status: 2
|
||||||
};
|
};
|
||||||
await fillInInventoryDataForGuildMember(member);
|
await addInventoryDataToFriendInfo(member);
|
||||||
res.json({ NewMember: member });
|
res.json({ NewMember: member });
|
||||||
} else if ("RequestMsg" in payload) {
|
} else if ("RequestMsg" in payload) {
|
||||||
// Player applying to join a clan
|
// Player applying to join a clan
|
||||||
|
27
src/controllers/api/adoptPetController.ts
Normal file
27
src/controllers/api/adoptPetController.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
|
export const adoptPetController: RequestHandler = async (req, res) => {
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
const inventory = await getInventory(accountId, "KubrowPets");
|
||||||
|
const data = getJSONfromString<IAdoptPetRequest>(String(req.body));
|
||||||
|
const details = inventory.KubrowPets.id(data.petId)!.Details!;
|
||||||
|
details.Name = data.name;
|
||||||
|
await inventory.save();
|
||||||
|
res.json({
|
||||||
|
petId: data.petId,
|
||||||
|
newName: data.name
|
||||||
|
} satisfies IAdoptPetResponse);
|
||||||
|
};
|
||||||
|
|
||||||
|
interface IAdoptPetRequest {
|
||||||
|
petId: string;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IAdoptPetResponse {
|
||||||
|
petId: string;
|
||||||
|
newName: string;
|
||||||
|
}
|
@ -1,9 +1,9 @@
|
|||||||
import { toOid } from "@/src/helpers/inventoryHelpers";
|
import { fromOid, toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { createVeiledRivenFingerprint, rivenRawToRealWeighted } from "@/src/helpers/rivenHelper";
|
import { createVeiledRivenFingerprint, rivenRawToRealWeighted } from "@/src/helpers/rivenHelper";
|
||||||
import { addMiscItems, addMods, getInventory } from "@/src/services/inventoryService";
|
import { addMiscItems, addMods, getInventory } from "@/src/services/inventoryService";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { getRandomElement, getRandomWeightedReward, getRandomWeightedRewardUc } from "@/src/services/rngService";
|
import { getRandomElement, getRandomWeightedReward, getRandomWeightedRewardUc } from "@/src/services/rngService";
|
||||||
import { IOid } from "@/src/types/commonTypes";
|
import { IUpgradeFromClient } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { ExportBoosterPacks, ExportUpgrades, TRarity } from "warframe-public-export-plus";
|
import { ExportBoosterPacks, ExportUpgrades, TRarity } from "warframe-public-export-plus";
|
||||||
|
|
||||||
@ -24,11 +24,11 @@ export const artifactTransmutationController: RequestHandler = async (req, res)
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
payload.Consumed.forEach(upgrade => {
|
payload.Consumed.forEach(upgrade => {
|
||||||
inventory.Upgrades.pull({ _id: upgrade.ItemId.$oid });
|
inventory.Upgrades.pull({ _id: fromOid(upgrade.ItemId) });
|
||||||
});
|
});
|
||||||
|
|
||||||
const rawRivenType = getRandomRawRivenType();
|
const rawRivenType = getRandomRawRivenType();
|
||||||
const rivenType = getRandomElement(rivenRawToRealWeighted[rawRivenType]);
|
const rivenType = getRandomElement(rivenRawToRealWeighted[rawRivenType])!;
|
||||||
const fingerprint = createVeiledRivenFingerprint(ExportUpgrades[rivenType]);
|
const fingerprint = createVeiledRivenFingerprint(ExportUpgrades[rivenType]);
|
||||||
|
|
||||||
const upgradeIndex =
|
const upgradeIndex =
|
||||||
@ -57,8 +57,8 @@ export const artifactTransmutationController: RequestHandler = async (req, res)
|
|||||||
payload.Consumed.forEach(upgrade => {
|
payload.Consumed.forEach(upgrade => {
|
||||||
const meta = ExportUpgrades[upgrade.ItemType];
|
const meta = ExportUpgrades[upgrade.ItemType];
|
||||||
counts[meta.rarity] += upgrade.ItemCount;
|
counts[meta.rarity] += upgrade.ItemCount;
|
||||||
if (upgrade.ItemId.$oid != "000000000000000000000000") {
|
if (fromOid(upgrade.ItemId) != "000000000000000000000000") {
|
||||||
inventory.Upgrades.pull({ _id: upgrade.ItemId.$oid });
|
inventory.Upgrades.pull({ _id: fromOid(upgrade.ItemId) });
|
||||||
} else {
|
} else {
|
||||||
addMods(inventory, [
|
addMods(inventory, [
|
||||||
{
|
{
|
||||||
@ -128,24 +128,14 @@ const getRandomRawRivenType = (): string => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
interface IArtifactTransmutationRequest {
|
interface IArtifactTransmutationRequest {
|
||||||
Upgrade: IAgnosticUpgradeClient;
|
Upgrade: IUpgradeFromClient;
|
||||||
LevelDiff: number;
|
LevelDiff: number;
|
||||||
Consumed: IAgnosticUpgradeClient[];
|
Consumed: IUpgradeFromClient[];
|
||||||
Cost: number;
|
Cost: number;
|
||||||
FusionPointCost: number;
|
FusionPointCost: number;
|
||||||
RivenTransmute?: boolean;
|
RivenTransmute?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IAgnosticUpgradeClient {
|
|
||||||
ItemType: string;
|
|
||||||
ItemId: IOid;
|
|
||||||
FromSKU: boolean;
|
|
||||||
UpgradeFingerprint: string;
|
|
||||||
PendingRerollFingerprint: string;
|
|
||||||
ItemCount: number;
|
|
||||||
LastAdded: IOid;
|
|
||||||
}
|
|
||||||
|
|
||||||
const specialModSets: string[][] = [
|
const specialModSets: string[][] = [
|
||||||
[
|
[
|
||||||
"/Lotus/Upgrades/Mods/Immortal/ImmortalOneMod",
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalOneMod",
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { getRecipe } from "@/src/services/itemDataService";
|
import { getRecipe } from "@/src/services/itemDataService";
|
||||||
import { IOid } from "@/src/types/commonTypes";
|
import { IOid, IOidWithLegacySupport } from "@/src/types/commonTypes";
|
||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountForRequest } from "@/src/services/loginService";
|
||||||
import {
|
import {
|
||||||
getInventory,
|
getInventory,
|
||||||
updateCurrency,
|
updateCurrency,
|
||||||
@ -17,8 +17,11 @@ import {
|
|||||||
} from "@/src/services/inventoryService";
|
} from "@/src/services/inventoryService";
|
||||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { InventorySlot, IPendingRecipeDatabase, Status } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { toOid } from "@/src/helpers/inventoryHelpers";
|
import { toOid2 } from "@/src/helpers/inventoryHelpers";
|
||||||
|
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
||||||
|
import { IRecipe } from "warframe-public-export-plus";
|
||||||
|
import { config } from "@/src/services/configService";
|
||||||
|
|
||||||
interface IClaimCompletedRecipeRequest {
|
interface IClaimCompletedRecipeRequest {
|
||||||
RecipeIds: IOid[];
|
RecipeIds: IOid[];
|
||||||
@ -26,10 +29,8 @@ interface IClaimCompletedRecipeRequest {
|
|||||||
|
|
||||||
export const claimCompletedRecipeController: RequestHandler = async (req, res) => {
|
export const claimCompletedRecipeController: RequestHandler = async (req, res) => {
|
||||||
const claimCompletedRecipeRequest = getJSONfromString<IClaimCompletedRecipeRequest>(String(req.body));
|
const claimCompletedRecipeRequest = getJSONfromString<IClaimCompletedRecipeRequest>(String(req.body));
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const account = await getAccountForRequest(req);
|
||||||
if (!accountId) throw new Error("no account id");
|
const inventory = await getInventory(account._id.toString());
|
||||||
|
|
||||||
const inventory = await getInventory(accountId);
|
|
||||||
const pendingRecipe = inventory.PendingRecipes.id(claimCompletedRecipeRequest.RecipeIds[0].$oid);
|
const pendingRecipe = inventory.PendingRecipes.id(claimCompletedRecipeRequest.RecipeIds[0].$oid);
|
||||||
if (!pendingRecipe) {
|
if (!pendingRecipe) {
|
||||||
throw new Error(`no pending recipe found with id ${claimCompletedRecipeRequest.RecipeIds[0].$oid}`);
|
throw new Error(`no pending recipe found with id ${claimCompletedRecipeRequest.RecipeIds[0].$oid}`);
|
||||||
@ -48,40 +49,14 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) =
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (req.query.cancel) {
|
if (req.query.cancel) {
|
||||||
const inventoryChanges: IInventoryChanges = {
|
const inventoryChanges: IInventoryChanges = {};
|
||||||
...updateCurrency(inventory, recipe.buildPrice * -1, false)
|
await refundRecipeIngredients(inventory, inventoryChanges, recipe, pendingRecipe);
|
||||||
};
|
|
||||||
|
|
||||||
const equipmentIngredients = new Set();
|
|
||||||
for (const category of ["LongGuns", "Pistols", "Melee"] as const) {
|
|
||||||
if (pendingRecipe[category]) {
|
|
||||||
pendingRecipe[category].forEach(item => {
|
|
||||||
const index = inventory[category].push(item) - 1;
|
|
||||||
inventoryChanges[category] ??= [];
|
|
||||||
inventoryChanges[category].push(inventory[category][index].toJSON<IEquipmentClient>());
|
|
||||||
equipmentIngredients.add(item.ItemType);
|
|
||||||
|
|
||||||
occupySlot(inventory, InventorySlot.WEAPONS, false);
|
|
||||||
inventoryChanges.WeaponBin ??= { Slots: 0 };
|
|
||||||
inventoryChanges.WeaponBin.Slots -= 1;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (const ingredient of recipe.ingredients) {
|
|
||||||
if (!equipmentIngredients.has(ingredient.ItemType)) {
|
|
||||||
combineInventoryChanges(
|
|
||||||
inventoryChanges,
|
|
||||||
await addItem(inventory, ingredient.ItemType, ingredient.ItemCount)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.json(inventoryChanges); // Not a bug: In the specific case of cancelling a recipe, InventoryChanges are expected to be the root.
|
res.json(inventoryChanges); // Not a bug: In the specific case of cancelling a recipe, InventoryChanges are expected to be the root.
|
||||||
} else {
|
} else {
|
||||||
logger.debug("Claiming Recipe", { recipe, pendingRecipe });
|
logger.debug("Claiming Recipe", { recipe, pendingRecipe });
|
||||||
|
|
||||||
let BrandedSuits: undefined | IOid[];
|
let BrandedSuits: undefined | IOidWithLegacySupport[];
|
||||||
if (recipe.secretIngredientAction == "SIA_SPECTRE_LOADOUT_COPY") {
|
if (recipe.secretIngredientAction == "SIA_SPECTRE_LOADOUT_COPY") {
|
||||||
inventory.PendingSpectreLoadouts ??= [];
|
inventory.PendingSpectreLoadouts ??= [];
|
||||||
inventory.SpectreLoadouts ??= [];
|
inventory.SpectreLoadouts ??= [];
|
||||||
@ -106,7 +81,7 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) =
|
|||||||
inventory.BrandedSuits!.findIndex(x => x.equals(pendingRecipe.SuitToUnbrand)),
|
inventory.BrandedSuits!.findIndex(x => x.equals(pendingRecipe.SuitToUnbrand)),
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
BrandedSuits = [toOid(pendingRecipe.SuitToUnbrand!)];
|
BrandedSuits = [toOid2(pendingRecipe.SuitToUnbrand!, account.BuildLabel)];
|
||||||
}
|
}
|
||||||
|
|
||||||
let InventoryChanges: IInventoryChanges = {};
|
let InventoryChanges: IInventoryChanges = {};
|
||||||
@ -130,13 +105,73 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) =
|
|||||||
...updateCurrency(inventory, cost, true)
|
...updateCurrency(inventory, cost, true)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (recipe.secretIngredientAction != "SIA_UNBRAND") {
|
|
||||||
|
if (recipe.secretIngredientAction == "SIA_CREATE_KUBROW") {
|
||||||
|
const pet = inventory.KubrowPets.id(pendingRecipe.KubrowPet!)!;
|
||||||
|
if (pet.Details!.HatchDate!.getTime() > Date.now()) {
|
||||||
|
pet.Details!.HatchDate = new Date();
|
||||||
|
}
|
||||||
|
let canSetActive = true;
|
||||||
|
for (const pet of inventory.KubrowPets) {
|
||||||
|
if (pet.Details!.Status == Status.StatusAvailable) {
|
||||||
|
canSetActive = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pet.Details!.Status = canSetActive ? Status.StatusAvailable : Status.StatusStasis;
|
||||||
|
} else if (recipe.secretIngredientAction != "SIA_UNBRAND") {
|
||||||
InventoryChanges = {
|
InventoryChanges = {
|
||||||
...InventoryChanges,
|
...InventoryChanges,
|
||||||
...(await addItem(inventory, recipe.resultType, recipe.num, false))
|
...(await addItem(
|
||||||
|
inventory,
|
||||||
|
recipe.resultType,
|
||||||
|
recipe.num,
|
||||||
|
false,
|
||||||
|
undefined,
|
||||||
|
pendingRecipe.TargetFingerprint
|
||||||
|
))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
config.claimingBlueprintRefundsIngredients &&
|
||||||
|
recipe.secretIngredientAction != "SIA_CREATE_KUBROW" // Can't refund the egg
|
||||||
|
) {
|
||||||
|
await refundRecipeIngredients(inventory, InventoryChanges, recipe, pendingRecipe);
|
||||||
|
}
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.json({ InventoryChanges, BrandedSuits });
|
res.json({ InventoryChanges, BrandedSuits });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const refundRecipeIngredients = async (
|
||||||
|
inventory: TInventoryDatabaseDocument,
|
||||||
|
inventoryChanges: IInventoryChanges,
|
||||||
|
recipe: IRecipe,
|
||||||
|
pendingRecipe: IPendingRecipeDatabase
|
||||||
|
): Promise<void> => {
|
||||||
|
updateCurrency(inventory, recipe.buildPrice * -1, false, inventoryChanges);
|
||||||
|
|
||||||
|
const equipmentIngredients = new Set();
|
||||||
|
for (const category of ["LongGuns", "Pistols", "Melee"] as const) {
|
||||||
|
if (pendingRecipe[category]) {
|
||||||
|
pendingRecipe[category].forEach(item => {
|
||||||
|
const index = inventory[category].push(item) - 1;
|
||||||
|
inventoryChanges[category] ??= [];
|
||||||
|
inventoryChanges[category].push(inventory[category][index].toJSON<IEquipmentClient>());
|
||||||
|
equipmentIngredients.add(item.ItemType);
|
||||||
|
|
||||||
|
occupySlot(inventory, InventorySlot.WEAPONS, false);
|
||||||
|
inventoryChanges.WeaponBin ??= { Slots: 0 };
|
||||||
|
inventoryChanges.WeaponBin.Slots -= 1;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const ingredient of recipe.ingredients) {
|
||||||
|
if (!equipmentIngredients.has(ingredient.ItemType)) {
|
||||||
|
combineInventoryChanges(
|
||||||
|
inventoryChanges,
|
||||||
|
await addItem(inventory, ingredient.ItemType, ingredient.ItemCount)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { addFusionPoints, getInventory } from "@/src/services/inventoryService";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ export const claimLibraryDailyTaskRewardController: RequestHandler = async (req,
|
|||||||
}
|
}
|
||||||
syndicate.Standing += rewardStanding;
|
syndicate.Standing += rewardStanding;
|
||||||
|
|
||||||
inventory.FusionPoints += 80 * rewardQuantity;
|
addFusionPoints(inventory, 80 * rewardQuantity);
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
|
41
src/controllers/api/completeCalendarEventController.ts
Normal file
41
src/controllers/api/completeCalendarEventController.ts
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import { getCalendarProgress, getInventory } from "@/src/services/inventoryService";
|
||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
|
||||||
|
import { getWorldState } from "@/src/services/worldStateService";
|
||||||
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
|
// GET request; query parameters: CompletedEventIdx=0&Iteration=4&Version=19&Season=CST_SUMMER
|
||||||
|
export const completeCalendarEventController: RequestHandler = async (req, res) => {
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
const inventory = await getInventory(accountId);
|
||||||
|
const calendarProgress = getCalendarProgress(inventory);
|
||||||
|
const currentSeason = getWorldState().KnownCalendarSeasons[0];
|
||||||
|
let inventoryChanges: IInventoryChanges = {};
|
||||||
|
let dayIndex = 0;
|
||||||
|
for (const day of currentSeason.Days) {
|
||||||
|
if (day.events.length == 0 || day.events[0].type != "CET_CHALLENGE") {
|
||||||
|
if (dayIndex == calendarProgress.SeasonProgress.LastCompletedDayIdx) {
|
||||||
|
if (day.events.length != 0) {
|
||||||
|
const selection = day.events[parseInt(req.query.CompletedEventIdx as string)];
|
||||||
|
if (selection.type == "CET_REWARD") {
|
||||||
|
inventoryChanges = (await handleStoreItemAcquisition(selection.reward!, inventory))
|
||||||
|
.InventoryChanges;
|
||||||
|
} else if (selection.type == "CET_UPGRADE") {
|
||||||
|
calendarProgress.YearProgress.Upgrades.push(selection.upgrade!);
|
||||||
|
} else if (selection.type != "CET_PLOT") {
|
||||||
|
throw new Error(`unexpected selection type: ${selection.type}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
++dayIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
calendarProgress.SeasonProgress.LastCompletedDayIdx++;
|
||||||
|
await inventory.save();
|
||||||
|
res.json({
|
||||||
|
InventoryChanges: inventoryChanges,
|
||||||
|
CalendarProgress: inventory.CalendarProgress
|
||||||
|
});
|
||||||
|
};
|
@ -1,8 +1,14 @@
|
|||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { Guild, GuildMember } from "@/src/models/guildModel";
|
import { Guild, GuildMember } from "@/src/models/guildModel";
|
||||||
import { Account } from "@/src/models/loginModel";
|
import { Account } from "@/src/models/loginModel";
|
||||||
import { deleteGuild, getGuildClient, hasGuildPermission, removeDojoKeyItems } from "@/src/services/guildService";
|
import {
|
||||||
import { addRecipes, combineInventoryChanges, getInventory } from "@/src/services/inventoryService";
|
deleteGuild,
|
||||||
|
getGuildClient,
|
||||||
|
giveClanKey,
|
||||||
|
hasGuildPermission,
|
||||||
|
removeDojoKeyItems
|
||||||
|
} from "@/src/services/guildService";
|
||||||
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
import { getAccountForRequest, getAccountIdForRequest, getSuffixedName } from "@/src/services/loginService";
|
import { getAccountForRequest, getAccountIdForRequest, getSuffixedName } from "@/src/services/loginService";
|
||||||
import { GuildPermission } from "@/src/types/guildTypes";
|
import { GuildPermission } from "@/src/types/guildTypes";
|
||||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
@ -41,14 +47,7 @@ export const confirmGuildInvitationGetController: RequestHandler = async (req, r
|
|||||||
// Update inventory of new member
|
// Update inventory of new member
|
||||||
const inventory = await getInventory(account._id.toString(), "GuildId LevelKeys Recipes");
|
const inventory = await getInventory(account._id.toString(), "GuildId LevelKeys Recipes");
|
||||||
inventory.GuildId = new Types.ObjectId(req.query.clanId as string);
|
inventory.GuildId = new Types.ObjectId(req.query.clanId as string);
|
||||||
const recipeChanges = [
|
giveClanKey(inventory, inventoryChanges);
|
||||||
{
|
|
||||||
ItemType: "/Lotus/Types/Keys/DojoKeyBlueprint",
|
|
||||||
ItemCount: 1
|
|
||||||
}
|
|
||||||
];
|
|
||||||
addRecipes(inventory, recipeChanges);
|
|
||||||
combineInventoryChanges(inventoryChanges, { Recipes: recipeChanges });
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
|
|
||||||
const guild = (await Guild.findById(req.query.clanId as string))!;
|
const guild = (await Guild.findById(req.query.clanId as string))!;
|
||||||
@ -63,7 +62,7 @@ export const confirmGuildInvitationGetController: RequestHandler = async (req, r
|
|||||||
await guild.save();
|
await guild.save();
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
...(await getGuildClient(guild, account._id.toString())),
|
...(await getGuildClient(guild, account)),
|
||||||
InventoryChanges: inventoryChanges
|
InventoryChanges: inventoryChanges
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -96,14 +95,9 @@ export const confirmGuildInvitationPostController: RequestHandler = async (req,
|
|||||||
await GuildMember.deleteMany({ accountId: guildMember.accountId, status: 1 });
|
await GuildMember.deleteMany({ accountId: guildMember.accountId, status: 1 });
|
||||||
|
|
||||||
// Update inventory of new member
|
// Update inventory of new member
|
||||||
const inventory = await getInventory(guildMember.accountId.toString(), "GuildId Recipes");
|
const inventory = await getInventory(guildMember.accountId.toString(), "GuildId LevelKeys Recipes");
|
||||||
inventory.GuildId = new Types.ObjectId(req.query.clanId as string);
|
inventory.GuildId = new Types.ObjectId(req.query.clanId as string);
|
||||||
addRecipes(inventory, [
|
giveClanKey(inventory);
|
||||||
{
|
|
||||||
ItemType: "/Lotus/Types/Keys/DojoKeyBlueprint",
|
|
||||||
ItemCount: 1
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
|
|
||||||
// Add join to clan log
|
// Add join to clan log
|
||||||
|
@ -2,7 +2,7 @@ import { toMongoDate } from "@/src/helpers/inventoryHelpers";
|
|||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { Guild } from "@/src/models/guildModel";
|
import { Guild } from "@/src/models/guildModel";
|
||||||
import { checkClanAscensionHasRequiredContributors } from "@/src/services/guildService";
|
import { checkClanAscensionHasRequiredContributors } from "@/src/services/guildService";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { addFusionPoints, getInventory } from "@/src/services/inventoryService";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
@ -36,7 +36,7 @@ export const contributeGuildClassController: RequestHandler = async (req, res) =
|
|||||||
|
|
||||||
// Either way, endo is given to the contributor.
|
// Either way, endo is given to the contributor.
|
||||||
const inventory = await getInventory(accountId, "FusionPoints");
|
const inventory = await getInventory(accountId, "FusionPoints");
|
||||||
inventory.FusionPoints += guild.CeremonyEndo!;
|
addFusionPoints(inventory, guild.CeremonyEndo!);
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountForRequest } from "@/src/services/loginService";
|
||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { Guild, GuildMember } from "@/src/models/guildModel";
|
import { Guild, GuildMember } from "@/src/models/guildModel";
|
||||||
import { createUniqueClanName, getGuildClient } from "@/src/services/guildService";
|
import { createUniqueClanName, getGuildClient, giveClanKey } from "@/src/services/guildService";
|
||||||
import { addRecipes, getInventory } from "@/src/services/inventoryService";
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
|
|
||||||
export const createGuildController: RequestHandler = async (req, res) => {
|
export const createGuildController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const account = await getAccountForRequest(req);
|
||||||
const payload = getJSONfromString<ICreateGuildRequest>(String(req.body));
|
const payload = getJSONfromString<ICreateGuildRequest>(String(req.body));
|
||||||
|
|
||||||
// Remove pending applications for this account
|
// Remove pending applications for this account
|
||||||
await GuildMember.deleteMany({ accountId, status: 1 });
|
await GuildMember.deleteMany({ accountId: account._id, status: 1 });
|
||||||
|
|
||||||
// Create guild on database
|
// Create guild on database
|
||||||
const guild = new Guild({
|
const guild = new Guild({
|
||||||
@ -20,32 +21,21 @@ export const createGuildController: RequestHandler = async (req, res) => {
|
|||||||
|
|
||||||
// Create guild member on database
|
// Create guild member on database
|
||||||
await GuildMember.insertOne({
|
await GuildMember.insertOne({
|
||||||
accountId: accountId,
|
accountId: account._id,
|
||||||
guildId: guild._id,
|
guildId: guild._id,
|
||||||
status: 0,
|
status: 0,
|
||||||
rank: 0
|
rank: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
const inventory = await getInventory(accountId, "GuildId Recipes");
|
const inventory = await getInventory(account._id.toString(), "GuildId LevelKeys Recipes");
|
||||||
inventory.GuildId = guild._id;
|
inventory.GuildId = guild._id;
|
||||||
addRecipes(inventory, [
|
const inventoryChanges: IInventoryChanges = {};
|
||||||
{
|
giveClanKey(inventory, inventoryChanges);
|
||||||
ItemType: "/Lotus/Types/Keys/DojoKeyBlueprint",
|
|
||||||
ItemCount: 1
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
...(await getGuildClient(guild, accountId)),
|
...(await getGuildClient(guild, account)),
|
||||||
InventoryChanges: {
|
InventoryChanges: inventoryChanges
|
||||||
Recipes: [
|
|
||||||
{
|
|
||||||
ItemType: "/Lotus/Types/Keys/DojoKeyBlueprint",
|
|
||||||
ItemCount: 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
|
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { ICrewMemberClient } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { ICrewMemberClient } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
@ -7,15 +8,23 @@ import { Types } from "mongoose";
|
|||||||
|
|
||||||
export const crewMembersController: RequestHandler = async (req, res) => {
|
export const crewMembersController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
const inventory = await getInventory(accountId, "CrewMembers");
|
const inventory = await getInventory(accountId, "CrewMembers NemesisHistory");
|
||||||
const data = getJSONfromString<ICrewMembersRequest>(String(req.body));
|
const data = getJSONfromString<ICrewMembersRequest>(String(req.body));
|
||||||
const dbCrewMember = inventory.CrewMembers.id(data.crewMember.ItemId.$oid)!;
|
if (data.crewMember.SecondInCommand) {
|
||||||
dbCrewMember.AssignedRole = data.crewMember.AssignedRole;
|
clearOnCall(inventory);
|
||||||
dbCrewMember.SkillEfficiency = data.crewMember.SkillEfficiency;
|
}
|
||||||
dbCrewMember.WeaponConfigIdx = data.crewMember.WeaponConfigIdx;
|
if (data.crewMember.ItemId.$oid == "000000000000000000000000") {
|
||||||
dbCrewMember.WeaponId = new Types.ObjectId(data.crewMember.WeaponId.$oid);
|
const convertedNemesis = inventory.NemesisHistory!.find(x => x.fp == data.crewMember.NemesisFingerprint)!;
|
||||||
dbCrewMember.Configs = data.crewMember.Configs;
|
convertedNemesis.SecondInCommand = data.crewMember.SecondInCommand;
|
||||||
dbCrewMember.SecondInCommand = data.crewMember.SecondInCommand;
|
} else {
|
||||||
|
const dbCrewMember = inventory.CrewMembers.id(data.crewMember.ItemId.$oid)!;
|
||||||
|
dbCrewMember.AssignedRole = data.crewMember.AssignedRole;
|
||||||
|
dbCrewMember.SkillEfficiency = data.crewMember.SkillEfficiency;
|
||||||
|
dbCrewMember.WeaponConfigIdx = data.crewMember.WeaponConfigIdx;
|
||||||
|
dbCrewMember.WeaponId = new Types.ObjectId(data.crewMember.WeaponId.$oid);
|
||||||
|
dbCrewMember.Configs = data.crewMember.Configs;
|
||||||
|
dbCrewMember.SecondInCommand = data.crewMember.SecondInCommand;
|
||||||
|
}
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.json({
|
res.json({
|
||||||
crewMemberId: data.crewMember.ItemId.$oid,
|
crewMemberId: data.crewMember.ItemId.$oid,
|
||||||
@ -26,3 +35,20 @@ export const crewMembersController: RequestHandler = async (req, res) => {
|
|||||||
interface ICrewMembersRequest {
|
interface ICrewMembersRequest {
|
||||||
crewMember: ICrewMemberClient;
|
crewMember: ICrewMemberClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const clearOnCall = (inventory: TInventoryDatabaseDocument): void => {
|
||||||
|
for (const cm of inventory.CrewMembers) {
|
||||||
|
if (cm.SecondInCommand) {
|
||||||
|
cm.SecondInCommand = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (inventory.NemesisHistory) {
|
||||||
|
for (const cm of inventory.NemesisHistory) {
|
||||||
|
if (cm.SecondInCommand) {
|
||||||
|
cm.SecondInCommand = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@ -62,14 +62,7 @@ export const crewShipIdentifySalvageController: RequestHandler = async (req, res
|
|||||||
} satisfies IInnateDamageFingerprint)
|
} satisfies IInnateDamageFingerprint)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
addEquipment(
|
addEquipment(inventory, "CrewShipSalvagedWeapons", payload.ItemType, defaultOverwrites, inventoryChanges);
|
||||||
inventory,
|
|
||||||
"CrewShipSalvagedWeapons",
|
|
||||||
payload.ItemType,
|
|
||||||
undefined,
|
|
||||||
inventoryChanges,
|
|
||||||
defaultOverwrites
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inventoryChanges.CrewShipRawSalvage = [
|
inventoryChanges.CrewShipRawSalvage = [
|
||||||
|
@ -1,60 +1,529 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { combineInventoryChanges, getInventory } from "@/src/services/inventoryService";
|
||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { TEndlessXpCategory } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IEndlessXpReward, IInventoryClient, TEndlessXpCategory } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
|
import { logger } from "@/src/utils/logger";
|
||||||
|
import { ExportRewards, ICountedStoreItem } from "warframe-public-export-plus";
|
||||||
|
import { getRandomElement } from "@/src/services/rngService";
|
||||||
|
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
|
||||||
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
|
|
||||||
export const endlessXpController: RequestHandler = async (req, res) => {
|
export const endlessXpController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
const inventory = await getInventory(accountId);
|
|
||||||
const payload = getJSONfromString<IEndlessXpRequest>(String(req.body));
|
const payload = getJSONfromString<IEndlessXpRequest>(String(req.body));
|
||||||
|
if (payload.Mode == "r") {
|
||||||
inventory.EndlessXP ??= [];
|
const inventory = await getInventory(accountId, "EndlessXP");
|
||||||
const entry = inventory.EndlessXP.find(x => x.Category == payload.Category);
|
inventory.EndlessXP ??= [];
|
||||||
if (entry) {
|
let entry = inventory.EndlessXP.find(x => x.Category == payload.Category);
|
||||||
entry.Choices = payload.Choices;
|
if (!entry) {
|
||||||
} else {
|
entry = {
|
||||||
inventory.EndlessXP.push({
|
Category: payload.Category,
|
||||||
Category: payload.Category,
|
Earn: 0,
|
||||||
Choices: payload.Choices
|
Claim: 0,
|
||||||
});
|
Choices: payload.Choices,
|
||||||
}
|
PendingRewards: []
|
||||||
await inventory.save();
|
};
|
||||||
|
inventory.EndlessXP.push(entry);
|
||||||
res.json({
|
|
||||||
NewProgress: {
|
|
||||||
Category: payload.Category,
|
|
||||||
Earn: 0,
|
|
||||||
Claim: 0,
|
|
||||||
BonusAvailable: {
|
|
||||||
$date: {
|
|
||||||
$numberLong: "9999999999999"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Expiry: {
|
|
||||||
$date: {
|
|
||||||
$numberLong: "9999999999999"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Choices: payload.Choices,
|
|
||||||
PendingRewards: [
|
|
||||||
{
|
|
||||||
RequiredTotalXp: 190,
|
|
||||||
Rewards: [
|
|
||||||
{
|
|
||||||
StoreItem: "/Lotus/StoreItems/Upgrades/Mods/Aura/PlayerHealthAuraMod",
|
|
||||||
ItemCount: 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
// ...
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
const weekStart = 1734307200_000 + Math.trunc((Date.now() - 1734307200_000) / 604800000) * 604800000;
|
||||||
|
const weekEnd = weekStart + 604800000;
|
||||||
|
|
||||||
|
entry.Earn = 0;
|
||||||
|
entry.Claim = 0;
|
||||||
|
entry.BonusAvailable = new Date(weekStart);
|
||||||
|
entry.Expiry = new Date(weekEnd);
|
||||||
|
entry.Choices = payload.Choices;
|
||||||
|
entry.PendingRewards =
|
||||||
|
payload.Category == "EXC_HARD"
|
||||||
|
? generateHardModeRewards(payload.Choices)
|
||||||
|
: generateNormalModeRewards(payload.Choices);
|
||||||
|
|
||||||
|
await inventory.save();
|
||||||
|
res.json({
|
||||||
|
NewProgress: inventory.toJSON<IInventoryClient>().EndlessXP!.find(x => x.Category == payload.Category)!
|
||||||
|
});
|
||||||
|
} else if (payload.Mode == "c") {
|
||||||
|
const inventory = await getInventory(accountId);
|
||||||
|
const entry = inventory.EndlessXP!.find(x => x.Category == payload.Category)!;
|
||||||
|
const inventoryChanges: IInventoryChanges = {};
|
||||||
|
for (const reward of entry.PendingRewards) {
|
||||||
|
if (entry.Claim < reward.RequiredTotalXp && reward.RequiredTotalXp <= entry.Earn) {
|
||||||
|
combineInventoryChanges(
|
||||||
|
inventoryChanges,
|
||||||
|
(
|
||||||
|
await handleStoreItemAcquisition(
|
||||||
|
reward.Rewards[0].StoreItem,
|
||||||
|
inventory,
|
||||||
|
reward.Rewards[0].ItemCount
|
||||||
|
)
|
||||||
|
).InventoryChanges
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
entry.Claim = entry.Earn;
|
||||||
|
await inventory.save();
|
||||||
|
res.json({
|
||||||
|
InventoryChanges: inventoryChanges,
|
||||||
|
ClaimedXp: entry.Claim
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
logger.debug(`data provided to ${req.path}: ${String(req.body)}`);
|
||||||
|
throw new Error(`unexpected endlessXp mode: ${payload.Mode}`);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
interface IEndlessXpRequest {
|
type IEndlessXpRequest =
|
||||||
Mode: string; // "r"
|
| {
|
||||||
Category: TEndlessXpCategory;
|
Mode: "r";
|
||||||
Choices: string[];
|
Category: TEndlessXpCategory;
|
||||||
}
|
Choices: string[];
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
Mode: "c" | "something else";
|
||||||
|
Category: TEndlessXpCategory;
|
||||||
|
};
|
||||||
|
|
||||||
|
const generateRandomRewards = (deckName: string): ICountedStoreItem[] => {
|
||||||
|
const reward = getRandomElement(ExportRewards[deckName][0])!;
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
StoreItem: reward.type,
|
||||||
|
ItemCount: reward.itemCount
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
const normalModeChosenRewards: Record<string, string[]> = {
|
||||||
|
Excalibur: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/ExcaliburHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/ExcaliburChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Excalibur/RadialJavelinAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/ExcaliburSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/ExcaliburBlueprint"
|
||||||
|
],
|
||||||
|
Trinity: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/TrinityHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/TrinityChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Trinity/EnergyVampireAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/TrinitySystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/TrinityBlueprint"
|
||||||
|
],
|
||||||
|
Ember: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/EmberHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/EmberChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Ember/WorldOnFireAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/EmberSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/EmberBlueprint"
|
||||||
|
],
|
||||||
|
Loki: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/LOKIHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/LOKIChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Loki/InvisibilityAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/LOKISystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/LOKIBlueprint"
|
||||||
|
],
|
||||||
|
Mag: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/MagHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/MagChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Mag/CrushAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/MagSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/MagBlueprint"
|
||||||
|
],
|
||||||
|
Rhino: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/RhinoHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/RhinoChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Rhino/RhinoChargeAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/RhinoSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/RhinoBlueprint"
|
||||||
|
],
|
||||||
|
Ash: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/AshHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/AshChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Ninja/GlaiveAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/AshSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/AshBlueprint"
|
||||||
|
],
|
||||||
|
Frost: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/FrostHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/FrostChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Frost/IceShieldAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/FrostSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/FrostBlueprint"
|
||||||
|
],
|
||||||
|
Nyx: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NyxHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NyxChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Jade/SelfBulletAttractorAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NyxSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NyxBlueprint"
|
||||||
|
],
|
||||||
|
Saryn: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/SarynHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/SarynChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Saryn/PoisonAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/SarynSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/SarynBlueprint"
|
||||||
|
],
|
||||||
|
Vauban: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/TrapperHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/TrapperChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Trapper/LevTrapAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/TrapperSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/TrapperBlueprint"
|
||||||
|
],
|
||||||
|
Nova: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NovaHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NovaChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/AntiMatter/MolecularPrimeAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NovaSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NovaBlueprint"
|
||||||
|
],
|
||||||
|
Nekros: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NecroHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NecroChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Necro/CloneTheDeadAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NecroSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NecroBlueprint"
|
||||||
|
],
|
||||||
|
Valkyr: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/BerserkerHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/BerserkerChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Berserker/IntimidateAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/BerserkerSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/BerserkerBlueprint"
|
||||||
|
],
|
||||||
|
Oberon: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/PaladinHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/PaladinChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Paladin/RegenerationAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/PaladinSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/PaladinBlueprint"
|
||||||
|
],
|
||||||
|
Hydroid: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/HydroidHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/HydroidChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Pirate/CannonBarrageAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/HydroidSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/HydroidBlueprint"
|
||||||
|
],
|
||||||
|
Mirage: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/HarlequinHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/HarlequinChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Harlequin/LightAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/HarlequinSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/HarlequinBlueprint"
|
||||||
|
],
|
||||||
|
Limbo: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/MagicianHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/MagicianChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Magician/TearInSpaceAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/MagicianSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/MagicianBlueprint"
|
||||||
|
],
|
||||||
|
Mesa: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/GunslingerHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/GunslingerChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Cowgirl/GunFuPvPAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/GunslingerSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/GunslingerBlueprint"
|
||||||
|
],
|
||||||
|
Chroma: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/ChromaHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/ChromaChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Dragon/DragonLuckAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/ChromaSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/ChromaBlueprint"
|
||||||
|
],
|
||||||
|
Atlas: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/BrawlerHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/BrawlerChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Brawler/BrawlerPassiveAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/BrawlerSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/BrawlerBlueprint"
|
||||||
|
],
|
||||||
|
Ivara: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/RangerHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/RangerChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Ranger/RangerStealAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/RangerSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/RangerBlueprint"
|
||||||
|
],
|
||||||
|
Inaros: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/MummyHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/MummyChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Sandman/SandmanSwarmAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/MummySystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/MummyBlueprint"
|
||||||
|
],
|
||||||
|
Titania: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/FairyHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/FairyChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Fairy/FairyFlightAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/FairySystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/FairyBlueprint"
|
||||||
|
],
|
||||||
|
Nidus: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NidusHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NidusChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Infestation/InfestPodsAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NidusSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/NidusBlueprint"
|
||||||
|
],
|
||||||
|
Octavia: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/OctaviaHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/OctaviaChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Bard/BardCharmAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/OctaviaSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/OctaviaBlueprint"
|
||||||
|
],
|
||||||
|
Harrow: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/PriestHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/PriestChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Priest/PriestPactAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/PriestSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/PriestBlueprint"
|
||||||
|
],
|
||||||
|
Gara: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/GlassHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/GlassChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Glass/GlassFragmentAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/GlassSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/GlassBlueprint"
|
||||||
|
],
|
||||||
|
Khora: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/KhoraHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/KhoraChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Khora/KhoraCrackAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/KhoraSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/KhoraBlueprint"
|
||||||
|
],
|
||||||
|
Revenant: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/RevenantHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/RevenantChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Revenant/RevenantMarkAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/RevenantSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/RevenantBlueprint"
|
||||||
|
],
|
||||||
|
Garuda: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/GarudaHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/GarudaChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Garuda/GarudaUnstoppableAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/GarudaSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/GarudaBlueprint"
|
||||||
|
],
|
||||||
|
Baruuk: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/PacifistHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/PacifistChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/Pacifist/PacifistFistAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/PacifistSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/PacifistBlueprint"
|
||||||
|
],
|
||||||
|
Hildryn: [
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/IronframeHelmetBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/IronframeChassisBlueprint",
|
||||||
|
"/Lotus/StoreItems/Powersuits/IronFrame/IronFrameStripAugmentCard",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/IronframeSystemsBlueprint",
|
||||||
|
"/Lotus/StoreItems/Types/Recipes/WarframeRecipes/IronframeBlueprint"
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
const generateNormalModeRewards = (choices: string[]): IEndlessXpReward[] => {
|
||||||
|
const choiceRewards = normalModeChosenRewards[choices[0]];
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 190,
|
||||||
|
Rewards: generateRandomRewards(
|
||||||
|
"/Lotus/Types/Game/MissionDecks/DuviriEndlessCircuitRewards/DuviriEndlessNormalSilverRewards"
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 400,
|
||||||
|
Rewards: [
|
||||||
|
{
|
||||||
|
StoreItem: choiceRewards[0],
|
||||||
|
ItemCount: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 630,
|
||||||
|
Rewards: generateRandomRewards(
|
||||||
|
"/Lotus/Types/Game/MissionDecks/DuviriEndlessCircuitRewards/DuviriEndlessNormalSilverRewards"
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 890,
|
||||||
|
Rewards: generateRandomRewards(
|
||||||
|
"/Lotus/Types/Game/MissionDecks/DuviriEndlessCircuitRewards/DuviriEndlessNormalMODRewards"
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 1190,
|
||||||
|
Rewards: [
|
||||||
|
{
|
||||||
|
StoreItem: choiceRewards[1],
|
||||||
|
ItemCount: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 1540,
|
||||||
|
Rewards: generateRandomRewards(
|
||||||
|
"/Lotus/Types/Game/MissionDecks/DuviriEndlessCircuitRewards/DuviriEndlessNormalGoldRewards"
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 1950,
|
||||||
|
Rewards: [
|
||||||
|
{
|
||||||
|
StoreItem: choiceRewards[2],
|
||||||
|
ItemCount: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 2430,
|
||||||
|
Rewards: [
|
||||||
|
{
|
||||||
|
StoreItem: choiceRewards[3],
|
||||||
|
ItemCount: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 2990,
|
||||||
|
Rewards: generateRandomRewards(
|
||||||
|
"/Lotus/Types/Game/MissionDecks/DuviriEndlessCircuitRewards/DuviriEndlessNormalArcaneRewards"
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 3640,
|
||||||
|
Rewards: [
|
||||||
|
{
|
||||||
|
StoreItem: choiceRewards[4],
|
||||||
|
ItemCount: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
const hardModeChosenRewards: Record<string, string> = {
|
||||||
|
Braton: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Primary/BratonIncarnonUnlocker",
|
||||||
|
Lato: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Secondary/LatoIncarnonUnlocker",
|
||||||
|
Skana: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Melee/SkanaIncarnonUnlocker",
|
||||||
|
Paris: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Primary/ParisIncarnonUnlocker",
|
||||||
|
Kunai: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Secondary/KunaiIncarnonUnlocker",
|
||||||
|
Boar: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Primary/BoarIncarnonUnlocker",
|
||||||
|
Gammacor: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Secondary/GammacorIncarnonUnlocker",
|
||||||
|
Anku: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Melee/AnkuIncarnonUnlocker",
|
||||||
|
Gorgon: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Primary/GorgonIncarnonUnlocker",
|
||||||
|
Angstrum: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Secondary/AngstrumIncarnonUnlocker",
|
||||||
|
Bo: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Melee/BoIncarnonUnlocker",
|
||||||
|
Latron: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Primary/LatronIncarnonUnlocker",
|
||||||
|
Furis: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Secondary/FurisIncarnonUnlocker",
|
||||||
|
Furax: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Melee/FuraxIncarnonUnlocker",
|
||||||
|
Strun: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Primary/StrunIncarnonUnlocker",
|
||||||
|
Lex: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Secondary/LexIncarnonUnlocker",
|
||||||
|
Magistar: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Melee/MagistarIncarnonUnlocker",
|
||||||
|
Boltor: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Primary/BoltorIncarnonUnlocker",
|
||||||
|
Bronco: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Secondary/BroncoIncarnonUnlocker",
|
||||||
|
CeramicDagger: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Melee/CeramicDaggerIncarnonUnlocker",
|
||||||
|
Torid: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Primary/ToridIncarnonUnlocker",
|
||||||
|
DualToxocyst: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Secondary/DualToxocystIncarnonUnlocker",
|
||||||
|
DualIchor: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Melee/DualIchorIncarnonUnlocker",
|
||||||
|
Miter: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Primary/MiterIncarnonUnlocker",
|
||||||
|
Atomos: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Secondary/AtomosIncarnonUnlocker",
|
||||||
|
AckAndBrunt: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Melee/AckAndBruntIncarnonUnlocker",
|
||||||
|
Soma: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Primary/SomaIncarnonUnlocker",
|
||||||
|
Vasto: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Secondary/VastoIncarnonUnlocker",
|
||||||
|
NamiSolo: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Melee/NamiSoloIncarnonUnlocker",
|
||||||
|
Burston: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Primary/BurstonIncarnonUnlocker",
|
||||||
|
Zylok: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Secondary/ZylokIncarnonUnlocker",
|
||||||
|
Sibear: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Melee/SibearIncarnonUnlocker",
|
||||||
|
Dread: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Primary/DreadIncarnonUnlocker",
|
||||||
|
Despair: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Secondary/DespairIncarnonUnlocker",
|
||||||
|
Hate: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Melee/HateIncarnonUnlocker",
|
||||||
|
Dera: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Primary/DeraIncarnonUnlocker",
|
||||||
|
Cestra: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Secondary/CestraIncarnonUnlocker",
|
||||||
|
Okina: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Melee/OkinaIncarnonUnlocker",
|
||||||
|
Sybaris: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Primary/SybarisIncarnonUnlocker",
|
||||||
|
Sicarus: "/Lotus/StoreItems/Types/Items/MiscItems/IncarnonAdapters/Secondary/SicarusIncarnonUnlocker",
|
||||||
|
RivenPrimary: "/Lotus/StoreItems/Upgrades/Mods/Randomized/RawRifleRandomMod",
|
||||||
|
RivenSecondary: "/Lotus/StoreItems/Upgrades/Mods/Randomized/RawPistolRandomMod",
|
||||||
|
RivenMelee: "/Lotus/StoreItems/Upgrades/Mods/Randomized/RawMeleeRandomMod",
|
||||||
|
Kuva: "/Lotus/Types/Game/DuviriEndless/CircuitSteelPathBIGKuvaReward"
|
||||||
|
};
|
||||||
|
|
||||||
|
const generateHardModeRewards = (choices: string[]): IEndlessXpReward[] => {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 285,
|
||||||
|
Rewards: generateRandomRewards(
|
||||||
|
"/Lotus/Types/Game/MissionDecks/DuviriEndlessCircuitRewards/DuviriEndlessSteelPathSilverRewards"
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 600,
|
||||||
|
Rewards: generateRandomRewards(
|
||||||
|
"/Lotus/Types/Game/MissionDecks/DuviriEndlessCircuitRewards/DuviriEndlessSteelPathArcaneRewards"
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 945,
|
||||||
|
Rewards: generateRandomRewards(
|
||||||
|
"/Lotus/Types/Game/MissionDecks/DuviriEndlessCircuitRewards/DuviriEndlessSteelPathSilverRewards"
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 1335,
|
||||||
|
Rewards: generateRandomRewards(
|
||||||
|
"/Lotus/Types/Game/MissionDecks/DuviriEndlessCircuitRewards/DuviriEndlessSteelPathSilverRewards"
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 1785,
|
||||||
|
Rewards: [
|
||||||
|
{
|
||||||
|
StoreItem: hardModeChosenRewards[choices[0]],
|
||||||
|
ItemCount: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 2310,
|
||||||
|
Rewards: generateRandomRewards(
|
||||||
|
"/Lotus/Types/Game/MissionDecks/DuviriEndlessCircuitRewards/DuviriEndlessSteelPathGoldRewards"
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 2925,
|
||||||
|
Rewards: generateRandomRewards(
|
||||||
|
"/Lotus/Types/Game/MissionDecks/DuviriEndlessCircuitRewards/DuviriEndlessSteelPathGoldRewards"
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 3645,
|
||||||
|
Rewards: generateRandomRewards(
|
||||||
|
"/Lotus/Types/Game/MissionDecks/DuviriEndlessCircuitRewards/DuviriEndlessSteelPathArcaneRewards"
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 4485,
|
||||||
|
Rewards: generateRandomRewards(
|
||||||
|
"/Lotus/Types/Game/MissionDecks/DuviriEndlessCircuitRewards/DuviriEndlessSteelPathSteelEssenceRewards"
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
RequiredTotalXp: 5460,
|
||||||
|
Rewards: [
|
||||||
|
{
|
||||||
|
StoreItem: hardModeChosenRewards[choices[1]],
|
||||||
|
ItemCount: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
@ -21,10 +21,12 @@ export const entratiLabConquestModeController: RequestHandler = async (req, res)
|
|||||||
inventory.EntratiVaultCountResetDate = new Date(weekEnd);
|
inventory.EntratiVaultCountResetDate = new Date(weekEnd);
|
||||||
if (inventory.EntratiLabConquestUnlocked) {
|
if (inventory.EntratiLabConquestUnlocked) {
|
||||||
inventory.EntratiLabConquestUnlocked = 0;
|
inventory.EntratiLabConquestUnlocked = 0;
|
||||||
|
inventory.EntratiLabConquestCacheScoreMission = 0;
|
||||||
inventory.EntratiLabConquestActiveFrameVariants = [];
|
inventory.EntratiLabConquestActiveFrameVariants = [];
|
||||||
}
|
}
|
||||||
if (inventory.EchoesHexConquestUnlocked) {
|
if (inventory.EchoesHexConquestUnlocked) {
|
||||||
inventory.EchoesHexConquestUnlocked = 0;
|
inventory.EchoesHexConquestUnlocked = 0;
|
||||||
|
inventory.EchoesHexConquestCacheScoreMission = 0;
|
||||||
inventory.EchoesHexConquestActiveFrameVariants = [];
|
inventory.EchoesHexConquestActiveFrameVariants = [];
|
||||||
inventory.EchoesHexConquestActiveStickers = [];
|
inventory.EchoesHexConquestActiveStickers = [];
|
||||||
}
|
}
|
||||||
|
@ -30,15 +30,14 @@ export const fishmongerController: RequestHandler = async (req, res) => {
|
|||||||
miscItemChanges.push({ ItemType: fish.ItemType, ItemCount: fish.ItemCount * -1 });
|
miscItemChanges.push({ ItemType: fish.ItemType, ItemCount: fish.ItemCount * -1 });
|
||||||
}
|
}
|
||||||
addMiscItems(inventory, miscItemChanges);
|
addMiscItems(inventory, miscItemChanges);
|
||||||
let affiliationMod;
|
if (gainedStanding && syndicateTag) addStanding(inventory, syndicateTag, gainedStanding);
|
||||||
if (gainedStanding && syndicateTag) affiliationMod = addStanding(inventory, syndicateTag, gainedStanding);
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.json({
|
res.json({
|
||||||
InventoryChanges: {
|
InventoryChanges: {
|
||||||
MiscItems: miscItemChanges
|
MiscItems: miscItemChanges
|
||||||
},
|
},
|
||||||
SyndicateTag: syndicateTag,
|
SyndicateTag: syndicateTag,
|
||||||
StandingChange: affiliationMod?.Standing || 0
|
StandingChange: gainedStanding
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -64,7 +64,9 @@ export const focusController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
res.end();
|
res.json({
|
||||||
|
FocusUpgrade: { ItemType: focusType }
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case FocusOperation.UnlockUpgrade: {
|
case FocusOperation.UnlockUpgrade: {
|
||||||
@ -104,13 +106,14 @@ export const focusController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
case FocusOperation.SentTrainingAmplifier: {
|
case FocusOperation.SentTrainingAmplifier: {
|
||||||
const request = JSON.parse(String(req.body)) as ISentTrainingAmplifierRequest;
|
const request = JSON.parse(String(req.body)) as ISentTrainingAmplifierRequest;
|
||||||
const parts: string[] = [
|
|
||||||
"/Lotus/Weapons/Sentients/OperatorAmplifiers/SentTrainingAmplifier/SentAmpTrainingGrip",
|
|
||||||
"/Lotus/Weapons/Sentients/OperatorAmplifiers/SentTrainingAmplifier/SentAmpTrainingChassis",
|
|
||||||
"/Lotus/Weapons/Sentients/OperatorAmplifiers/SentTrainingAmplifier/SentAmpTrainingBarrel"
|
|
||||||
];
|
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(accountId);
|
||||||
const inventoryChanges = addEquipment(inventory, "OperatorAmps", request.StartingWeaponType, parts);
|
const inventoryChanges = addEquipment(inventory, "OperatorAmps", request.StartingWeaponType, {
|
||||||
|
ModularParts: [
|
||||||
|
"/Lotus/Weapons/Sentients/OperatorAmplifiers/SentTrainingAmplifier/SentAmpTrainingGrip",
|
||||||
|
"/Lotus/Weapons/Sentients/OperatorAmplifiers/SentTrainingAmplifier/SentAmpTrainingChassis",
|
||||||
|
"/Lotus/Weapons/Sentients/OperatorAmplifiers/SentTrainingAmplifier/SentAmpTrainingBarrel"
|
||||||
|
]
|
||||||
|
});
|
||||||
occupySlot(inventory, InventorySlot.AMPS, false);
|
occupySlot(inventory, InventorySlot.AMPS, false);
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.json((inventoryChanges.OperatorAmps as IEquipmentClient[])[0]);
|
res.json((inventoryChanges.OperatorAmps as IEquipmentClient[])[0]);
|
||||||
|
84
src/controllers/api/gardeningController.ts
Normal file
84
src/controllers/api/gardeningController.ts
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
import { toMongoDate } from "@/src/helpers/inventoryHelpers";
|
||||||
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
|
import { addMiscItem, getInventory } from "@/src/services/inventoryService";
|
||||||
|
import { toStoreItem } from "@/src/services/itemDataService";
|
||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { createGarden, getPersonalRooms } from "@/src/services/personalRoomsService";
|
||||||
|
import { IMongoDate } from "@/src/types/commonTypes";
|
||||||
|
import { IMissionReward } from "@/src/types/missionTypes";
|
||||||
|
import { IPersonalRoomsClient } from "@/src/types/personalRoomsTypes";
|
||||||
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
|
import { IGardeningClient } from "@/src/types/shipTypes";
|
||||||
|
import { RequestHandler } from "express";
|
||||||
|
import { dict_en, ExportResources } from "warframe-public-export-plus";
|
||||||
|
|
||||||
|
export const gardeningController: RequestHandler = async (req, res) => {
|
||||||
|
const data = getJSONfromString<IGardeningRequest>(String(req.body));
|
||||||
|
if (data.Mode != "HarvestAll") {
|
||||||
|
throw new Error(`unexpected gardening mode: ${data.Mode}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
const [inventory, personalRooms] = await Promise.all([
|
||||||
|
getInventory(accountId, "MiscItems"),
|
||||||
|
getPersonalRooms(accountId, "Apartment")
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Harvest plants
|
||||||
|
const inventoryChanges: IInventoryChanges = {};
|
||||||
|
const rewards: Record<string, IMissionReward[][]> = {};
|
||||||
|
for (const planter of personalRooms.Apartment.Gardening.Planters) {
|
||||||
|
rewards[planter.Name] = [];
|
||||||
|
for (const plant of planter.Plants) {
|
||||||
|
const itemType =
|
||||||
|
"/Lotus/Types/Gameplay/Duviri/Resource/DuviriPlantItem" +
|
||||||
|
plant.PlantType.substring(plant.PlantType.length - 1);
|
||||||
|
const itemCount = Math.random() < 0.775 ? 2 : 4;
|
||||||
|
|
||||||
|
addMiscItem(inventory, itemType, itemCount, inventoryChanges);
|
||||||
|
|
||||||
|
rewards[planter.Name].push([
|
||||||
|
{
|
||||||
|
StoreItem: toStoreItem(itemType),
|
||||||
|
TypeName: itemType,
|
||||||
|
ItemCount: itemCount,
|
||||||
|
DailyCooldown: false,
|
||||||
|
Rarity: itemCount == 2 ? 0.7743589743589744 : 0.22564102564102564,
|
||||||
|
TweetText: `${itemCount}x ${dict_en[ExportResources[itemType].name]} (Resource)`,
|
||||||
|
ProductCategory: "MiscItems"
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Refresh garden
|
||||||
|
personalRooms.Apartment.Gardening = createGarden();
|
||||||
|
|
||||||
|
await Promise.all([inventory.save(), personalRooms.save()]);
|
||||||
|
|
||||||
|
const planter = personalRooms.Apartment.Gardening.Planters[personalRooms.Apartment.Gardening.Planters.length - 1];
|
||||||
|
const plant = planter.Plants[planter.Plants.length - 1];
|
||||||
|
res.json({
|
||||||
|
GardenTagName: planter.Name,
|
||||||
|
PlantType: plant.PlantType,
|
||||||
|
PlotIndex: plant.PlotIndex,
|
||||||
|
EndTime: toMongoDate(plant.EndTime),
|
||||||
|
InventoryChanges: inventoryChanges,
|
||||||
|
Gardening: personalRooms.toJSON<IPersonalRoomsClient>().Apartment.Gardening,
|
||||||
|
Rewards: rewards
|
||||||
|
} satisfies IGardeningResponse);
|
||||||
|
};
|
||||||
|
|
||||||
|
interface IGardeningRequest {
|
||||||
|
Mode: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IGardeningResponse {
|
||||||
|
GardenTagName: string;
|
||||||
|
PlantType: string;
|
||||||
|
PlotIndex: number;
|
||||||
|
EndTime: IMongoDate;
|
||||||
|
InventoryChanges: IInventoryChanges;
|
||||||
|
Gardening: IGardeningClient;
|
||||||
|
Rewards: Record<string, IMissionReward[][]>;
|
||||||
|
}
|
@ -18,6 +18,7 @@ export const getAllianceController: RequestHandler = async (req, res) => {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// POST request since U27
|
||||||
/*interface IGetAllianceRequest {
|
/*interface IGetAllianceRequest {
|
||||||
memberCount: number;
|
memberCount: number;
|
||||||
clanLeaderName: string;
|
clanLeaderName: string;
|
||||||
|
@ -1,15 +1,54 @@
|
|||||||
import { Request, Response } from "express";
|
import { toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
|
import { Friendship } from "@/src/models/friendModel";
|
||||||
|
import { addAccountDataToFriendInfo, addInventoryDataToFriendInfo } from "@/src/services/friendService";
|
||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { IFriendInfo } from "@/src/types/friendTypes";
|
||||||
|
import { Request, RequestHandler, Response } from "express";
|
||||||
|
|
||||||
// POST with {} instead of GET as of 38.5.0
|
// POST with {} instead of GET as of 38.5.0
|
||||||
const getFriendsController = (_request: Request, response: Response): void => {
|
export const getFriendsController: RequestHandler = async (req: Request, res: Response) => {
|
||||||
response.writeHead(200, {
|
const accountId = await getAccountIdForRequest(req);
|
||||||
//Connection: "keep-alive",
|
const response: IGetFriendsResponse = {
|
||||||
//"Content-Encoding": "gzip",
|
Current: [],
|
||||||
"Content-Type": "text/html",
|
IncomingFriendRequests: [],
|
||||||
// charset: "UTF - 8",
|
OutgoingFriendRequests: []
|
||||||
"Content-Length": "3"
|
};
|
||||||
});
|
const [internalFriendships, externalFriendships] = await Promise.all([
|
||||||
response.end(Buffer.from([0x7b, 0x7d, 0x0a]));
|
Friendship.find({ owner: accountId }),
|
||||||
|
Friendship.find({ friend: accountId }, "owner Note")
|
||||||
|
]);
|
||||||
|
for (const externalFriendship of externalFriendships) {
|
||||||
|
if (!internalFriendships.find(x => x.friend.equals(externalFriendship.owner))) {
|
||||||
|
response.IncomingFriendRequests.push({
|
||||||
|
_id: toOid(externalFriendship.owner),
|
||||||
|
Note: externalFriendship.Note
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const internalFriendship of internalFriendships) {
|
||||||
|
const friendInfo: IFriendInfo = {
|
||||||
|
_id: toOid(internalFriendship.friend)
|
||||||
|
};
|
||||||
|
if (externalFriendships.find(x => x.owner.equals(internalFriendship.friend))) {
|
||||||
|
response.Current.push(friendInfo);
|
||||||
|
} else {
|
||||||
|
response.OutgoingFriendRequests.push(friendInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const promises: Promise<void>[] = [];
|
||||||
|
for (const arr of Object.values(response)) {
|
||||||
|
for (const friendInfo of arr) {
|
||||||
|
promises.push(addAccountDataToFriendInfo(friendInfo));
|
||||||
|
promises.push(addInventoryDataToFriendInfo(friendInfo));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await Promise.all(promises);
|
||||||
|
res.json(response);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { getFriendsController };
|
// interface IGetFriendsResponse {
|
||||||
|
// Current: IFriendInfo[];
|
||||||
|
// IncomingFriendRequests: IFriendInfo[];
|
||||||
|
// OutgoingFriendRequests: IFriendInfo[];
|
||||||
|
// }
|
||||||
|
type IGetFriendsResponse = Record<"Current" | "IncomingFriendRequests" | "OutgoingFriendRequests", IFriendInfo[]>;
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { Guild } from "@/src/models/guildModel";
|
import { Guild } from "@/src/models/guildModel";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountForRequest } from "@/src/services/loginService";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
import { createUniqueClanName, getGuildClient } from "@/src/services/guildService";
|
import { createUniqueClanName, getGuildClient } from "@/src/services/guildService";
|
||||||
|
|
||||||
export const getGuildController: RequestHandler = async (req, res) => {
|
export const getGuildController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const account = await getAccountForRequest(req);
|
||||||
const inventory = await getInventory(accountId, "GuildId");
|
const inventory = await getInventory(account._id.toString(), "GuildId");
|
||||||
if (inventory.GuildId) {
|
if (inventory.GuildId) {
|
||||||
const guild = await Guild.findById(inventory.GuildId);
|
const guild = await Guild.findById(inventory.GuildId);
|
||||||
if (guild) {
|
if (guild) {
|
||||||
@ -24,7 +24,7 @@ export const getGuildController: RequestHandler = async (req, res) => {
|
|||||||
guild.CeremonyResetDate = undefined;
|
guild.CeremonyResetDate = undefined;
|
||||||
await guild.save();
|
await guild.save();
|
||||||
}
|
}
|
||||||
res.json(await getGuildClient(guild, accountId));
|
res.json(await getGuildClient(guild, account));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import { RequestHandler } from "express";
|
|||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { Guild } from "@/src/models/guildModel";
|
import { Guild } from "@/src/models/guildModel";
|
||||||
import { getDojoClient } from "@/src/services/guildService";
|
import { getDojoClient } from "@/src/services/guildService";
|
||||||
|
import { Account } from "@/src/models/loginModel";
|
||||||
|
|
||||||
export const getGuildDojoController: RequestHandler = async (req, res) => {
|
export const getGuildDojoController: RequestHandler = async (req, res) => {
|
||||||
const guildId = req.query.guildId as string;
|
const guildId = req.query.guildId as string;
|
||||||
@ -25,7 +26,8 @@ export const getGuildDojoController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const payload: IGetGuildDojoRequest = req.body ? (JSON.parse(String(req.body)) as IGetGuildDojoRequest) : {};
|
const payload: IGetGuildDojoRequest = req.body ? (JSON.parse(String(req.body)) as IGetGuildDojoRequest) : {};
|
||||||
res.json(await getDojoClient(guild, 0, payload.ComponentId));
|
const account = await Account.findById(req.query.accountId as string);
|
||||||
|
res.json(await getDojoClient(guild, 0, payload.ComponentId, account?.BuildLabel));
|
||||||
};
|
};
|
||||||
|
|
||||||
interface IGetGuildDojoRequest {
|
interface IGetGuildDojoRequest {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { toOid } from "@/src/helpers/inventoryHelpers";
|
import { toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { Account, Ignore } from "@/src/models/loginModel";
|
import { Account, Ignore } from "@/src/models/loginModel";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { IFriendInfo } from "@/src/types/guildTypes";
|
import { IFriendInfo } from "@/src/types/friendTypes";
|
||||||
import { parallelForeach } from "@/src/utils/async-utils";
|
import { parallelForeach } from "@/src/utils/async-utils";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
|
@ -2,19 +2,24 @@ import { RequestHandler } from "express";
|
|||||||
import { config } from "@/src/services/configService";
|
import { config } from "@/src/services/configService";
|
||||||
import allShipFeatures from "@/static/fixed_responses/allShipFeatures.json";
|
import allShipFeatures from "@/static/fixed_responses/allShipFeatures.json";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { getPersonalRooms } from "@/src/services/personalRoomsService";
|
import { createGarden, getPersonalRooms } from "@/src/services/personalRoomsService";
|
||||||
import { getShip } from "@/src/services/shipService";
|
|
||||||
import { toOid } from "@/src/helpers/inventoryHelpers";
|
import { toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { IGetShipResponse } from "@/src/types/shipTypes";
|
import { IGetShipResponse } from "@/src/types/shipTypes";
|
||||||
import { IPersonalRooms } from "@/src/types/personalRoomsTypes";
|
import { IPersonalRoomsClient } from "@/src/types/personalRoomsTypes";
|
||||||
import { getLoadout } from "@/src/services/loadoutService";
|
import { getLoadout } from "@/src/services/loadoutService";
|
||||||
|
|
||||||
export const getShipController: RequestHandler = async (req, res) => {
|
export const getShipController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
const personalRoomsDb = await getPersonalRooms(accountId);
|
const personalRoomsDb = await getPersonalRooms(accountId);
|
||||||
const personalRooms = personalRoomsDb.toJSON<IPersonalRooms>();
|
|
||||||
|
// Setup gardening if it's missing. Maybe should be done as part of some quest completion in the future.
|
||||||
|
if (personalRoomsDb.Apartment.Gardening.Planters.length == 0) {
|
||||||
|
personalRoomsDb.Apartment.Gardening = createGarden();
|
||||||
|
await personalRoomsDb.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
const personalRooms = personalRoomsDb.toJSON<IPersonalRoomsClient>();
|
||||||
const loadout = await getLoadout(accountId);
|
const loadout = await getLoadout(accountId);
|
||||||
const ship = await getShip(personalRoomsDb.activeShipId, "ShipAttachments SkinFlavourItem");
|
|
||||||
|
|
||||||
const getShipResponse: IGetShipResponse = {
|
const getShipResponse: IGetShipResponse = {
|
||||||
ShipOwnerId: accountId,
|
ShipOwnerId: accountId,
|
||||||
@ -24,8 +29,8 @@ export const getShipController: RequestHandler = async (req, res) => {
|
|||||||
ShipId: toOid(personalRoomsDb.activeShipId),
|
ShipId: toOid(personalRoomsDb.activeShipId),
|
||||||
ShipInterior: {
|
ShipInterior: {
|
||||||
Colors: personalRooms.ShipInteriorColors,
|
Colors: personalRooms.ShipInteriorColors,
|
||||||
ShipAttachments: ship.ShipAttachments,
|
ShipAttachments: { HOOD_ORNAMENT: "" },
|
||||||
SkinFlavourItem: ship.SkinFlavourItem
|
SkinFlavourItem: ""
|
||||||
},
|
},
|
||||||
FavouriteLoadoutId: personalRooms.Ship.FavouriteLoadoutId
|
FavouriteLoadoutId: personalRooms.Ship.FavouriteLoadoutId
|
||||||
? toOid(personalRooms.Ship.FavouriteLoadoutId)
|
? toOid(personalRooms.Ship.FavouriteLoadoutId)
|
||||||
|
@ -1,14 +1,29 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getVendorManifestByTypeName } from "@/src/services/serversideVendorsService";
|
import { applyStandingToVendorManifest, getVendorManifestByTypeName } from "@/src/services/serversideVendorsService";
|
||||||
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { config } from "@/src/services/configService";
|
||||||
|
|
||||||
export const getVendorInfoController: RequestHandler = (req, res) => {
|
export const getVendorInfoController: RequestHandler = async (req, res) => {
|
||||||
if (typeof req.query.vendor == "string") {
|
let manifest = getVendorManifestByTypeName(req.query.vendor as string);
|
||||||
const manifest = getVendorManifestByTypeName(req.query.vendor);
|
if (!manifest) {
|
||||||
if (!manifest) {
|
throw new Error(`Unknown vendor: ${req.query.vendor as string}`);
|
||||||
throw new Error(`Unknown vendor: ${req.query.vendor}`);
|
|
||||||
}
|
|
||||||
res.json(manifest);
|
|
||||||
} else {
|
|
||||||
res.status(400).end();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For testing purposes, authenticating with this endpoint is optional here, but would be required on live.
|
||||||
|
if (req.query.accountId) {
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
const inventory = await getInventory(accountId);
|
||||||
|
manifest = applyStandingToVendorManifest(inventory, manifest);
|
||||||
|
if (config.dev?.keepVendorsExpired) {
|
||||||
|
manifest = {
|
||||||
|
VendorInfo: {
|
||||||
|
...manifest.VendorInfo,
|
||||||
|
Expiry: { $date: { $numberLong: "0" } }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
res.json(manifest);
|
||||||
};
|
};
|
||||||
|
@ -1,12 +1,19 @@
|
|||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { Account } from "@/src/models/loginModel";
|
import { Account } from "@/src/models/loginModel";
|
||||||
|
import { areFriends } from "@/src/services/friendService";
|
||||||
import { createMessage } from "@/src/services/inboxService";
|
import { createMessage } from "@/src/services/inboxService";
|
||||||
import { getInventory, updateCurrency } from "@/src/services/inventoryService";
|
import {
|
||||||
|
combineInventoryChanges,
|
||||||
|
getEffectiveAvatarImageType,
|
||||||
|
getInventory,
|
||||||
|
updateCurrency
|
||||||
|
} from "@/src/services/inventoryService";
|
||||||
import { getAccountForRequest, getSuffixedName } from "@/src/services/loginService";
|
import { getAccountForRequest, getSuffixedName } from "@/src/services/loginService";
|
||||||
|
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
|
||||||
import { IOid } from "@/src/types/commonTypes";
|
import { IOid } from "@/src/types/commonTypes";
|
||||||
import { IPurchaseParams } from "@/src/types/purchaseTypes";
|
import { IInventoryChanges, IPurchaseParams } from "@/src/types/purchaseTypes";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { ExportFlavour } from "warframe-public-export-plus";
|
import { ExportBundles, ExportFlavour } from "warframe-public-export-plus";
|
||||||
|
|
||||||
export const giftingController: RequestHandler = async (req, res) => {
|
export const giftingController: RequestHandler = async (req, res) => {
|
||||||
const data = getJSONfromString<IGiftingRequest>(String(req.body));
|
const data = getJSONfromString<IGiftingRequest>(String(req.body));
|
||||||
@ -30,8 +37,11 @@ export const giftingController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cannot gift to players who have gifting disabled.
|
// Cannot gift to players who have gifting disabled.
|
||||||
// TODO: Also consider GIFT_MODE_FRIENDS once friends are implemented
|
const senderAccount = await getAccountForRequest(req);
|
||||||
if (inventory.Settings?.GiftMode == "GIFT_MODE_NONE") {
|
if (
|
||||||
|
inventory.Settings?.GiftMode == "GIFT_MODE_NONE" ||
|
||||||
|
(inventory.Settings?.GiftMode == "GIFT_MODE_FRIENDS" && !(await areFriends(account._id, senderAccount._id)))
|
||||||
|
) {
|
||||||
res.status(400).send("17").end();
|
res.status(400).send("17").end();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -40,11 +50,7 @@ export const giftingController: RequestHandler = async (req, res) => {
|
|||||||
// TODO: Cannot gift archwing items to players that have not completed the archwing quest. (Code 7)
|
// TODO: Cannot gift archwing items to players that have not completed the archwing quest. (Code 7)
|
||||||
// TODO: Cannot gift necramechs to players that have not completed heart of deimos. (Code 20)
|
// TODO: Cannot gift necramechs to players that have not completed heart of deimos. (Code 20)
|
||||||
|
|
||||||
const senderAccount = await getAccountForRequest(req);
|
const senderInventory = await getInventory(senderAccount._id.toString());
|
||||||
const senderInventory = await getInventory(
|
|
||||||
senderAccount._id.toString(),
|
|
||||||
"PremiumCredits PremiumCreditsFree ActiveAvatarImageType GiftsRemaining"
|
|
||||||
);
|
|
||||||
|
|
||||||
if (senderInventory.GiftsRemaining == 0) {
|
if (senderInventory.GiftsRemaining == 0) {
|
||||||
res.status(400).send("10").end();
|
res.status(400).send("10").end();
|
||||||
@ -52,7 +58,20 @@ export const giftingController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
senderInventory.GiftsRemaining -= 1;
|
senderInventory.GiftsRemaining -= 1;
|
||||||
|
|
||||||
updateCurrency(senderInventory, data.PurchaseParams.ExpectedPrice, true);
|
const inventoryChanges: IInventoryChanges = updateCurrency(
|
||||||
|
senderInventory,
|
||||||
|
data.PurchaseParams.ExpectedPrice,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
if (data.PurchaseParams.StoreItem in ExportBundles) {
|
||||||
|
const bundle = ExportBundles[data.PurchaseParams.StoreItem];
|
||||||
|
if (bundle.giftingBonus) {
|
||||||
|
combineInventoryChanges(
|
||||||
|
inventoryChanges,
|
||||||
|
(await handleStoreItemAcquisition(bundle.giftingBonus, senderInventory)).InventoryChanges
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
await senderInventory.save();
|
await senderInventory.save();
|
||||||
|
|
||||||
const senderName = getSuffixedName(senderAccount);
|
const senderName = getSuffixedName(senderAccount);
|
||||||
@ -71,7 +90,7 @@ export const giftingController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
sub: "/Lotus/Language/Menu/GiftReceivedSubject",
|
sub: "/Lotus/Language/Menu/GiftReceivedSubject",
|
||||||
icon: ExportFlavour[senderInventory.ActiveAvatarImageType].icon,
|
icon: ExportFlavour[getEffectiveAvatarImageType(senderInventory)].icon,
|
||||||
gifts: [
|
gifts: [
|
||||||
{
|
{
|
||||||
GiftType: data.PurchaseParams.StoreItem
|
GiftType: data.PurchaseParams.StoreItem
|
||||||
@ -80,7 +99,9 @@ export const giftingController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
res.end();
|
res.json({
|
||||||
|
InventoryChanges: inventoryChanges
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
interface IGiftingRequest {
|
interface IGiftingRequest {
|
||||||
|
@ -104,7 +104,7 @@ export const guildTechController: RequestHandler = async (req, res) => {
|
|||||||
) {
|
) {
|
||||||
throw new Error(`unexpected TechProductCategory: ${data.TechProductCategory}`);
|
throw new Error(`unexpected TechProductCategory: ${data.TechProductCategory}`);
|
||||||
}
|
}
|
||||||
if (!inventory[getSalvageCategory(data.TechProductCategory)].id(data.CategoryItemId)) {
|
if (!inventory[getSalvageCategory(data.TechProductCategory)].id(data.CategoryItemId!)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`no item with id ${data.CategoryItemId} in ${getSalvageCategory(data.TechProductCategory)} array`
|
`no item with id ${data.CategoryItemId} in ${getSalvageCategory(data.TechProductCategory)} array`
|
||||||
);
|
);
|
||||||
@ -441,16 +441,9 @@ const finishComponentRepair = (
|
|||||||
const inventoryChanges = {
|
const inventoryChanges = {
|
||||||
...(category == "CrewShipWeaponSkins"
|
...(category == "CrewShipWeaponSkins"
|
||||||
? addCrewShipWeaponSkin(inventory, salvageItem.ItemType, salvageItem.UpgradeFingerprint)
|
? addCrewShipWeaponSkin(inventory, salvageItem.ItemType, salvageItem.UpgradeFingerprint)
|
||||||
: addEquipment(
|
: addEquipment(inventory, category, salvageItem.ItemType, {
|
||||||
inventory,
|
UpgradeFingerprint: salvageItem.UpgradeFingerprint
|
||||||
category,
|
})),
|
||||||
salvageItem.ItemType,
|
|
||||||
undefined,
|
|
||||||
{},
|
|
||||||
{
|
|
||||||
UpgradeFingerprint: salvageItem.UpgradeFingerprint
|
|
||||||
}
|
|
||||||
)),
|
|
||||||
...occupySlot(inventory, InventorySlot.RJ_COMPONENT_AND_ARMAMENTS, false)
|
...occupySlot(inventory, InventorySlot.RJ_COMPONENT_AND_ARMAMENTS, false)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,17 +1,24 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountForRequest } from "@/src/services/loginService";
|
||||||
import { createNewSession } from "@/src/managers/sessionManager";
|
import { createNewSession } from "@/src/managers/sessionManager";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { ISession } from "@/src/types/session";
|
import { ISession } from "@/src/types/session";
|
||||||
|
import { JSONParse } from "json-with-bigint";
|
||||||
|
import { toOid2, version_compare } from "@/src/helpers/inventoryHelpers";
|
||||||
|
|
||||||
const hostSessionController: RequestHandler = async (req, res) => {
|
const hostSessionController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const account = await getAccountForRequest(req);
|
||||||
const hostSessionRequest = JSON.parse(req.body as string) as ISession;
|
const hostSessionRequest = JSONParse(String(req.body)) as ISession;
|
||||||
logger.debug("HostSession Request", { hostSessionRequest });
|
logger.debug("HostSession Request", { hostSessionRequest });
|
||||||
const session = createNewSession(hostSessionRequest, accountId);
|
const session = createNewSession(hostSessionRequest, account._id);
|
||||||
logger.debug(`New Session Created`, { session });
|
logger.debug(`New Session Created`, { session });
|
||||||
|
|
||||||
res.json({ sessionId: { $oid: session.sessionId }, rewardSeed: 99999999 });
|
if (account.BuildLabel && version_compare(account.BuildLabel, "2015.03.21.08.17") < 0) {
|
||||||
|
// U15 or below
|
||||||
|
res.send(session.sessionId.toString());
|
||||||
|
} else {
|
||||||
|
res.json({ sessionId: toOid2(session.sessionId, account.BuildLabel), rewardSeed: 99999999 });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export { hostSessionController };
|
export { hostSessionController };
|
||||||
|
@ -9,10 +9,17 @@ import {
|
|||||||
getMessage
|
getMessage
|
||||||
} from "@/src/services/inboxService";
|
} from "@/src/services/inboxService";
|
||||||
import { getAccountForRequest, getAccountFromSuffixedName, getSuffixedName } from "@/src/services/loginService";
|
import { getAccountForRequest, getAccountFromSuffixedName, getSuffixedName } from "@/src/services/loginService";
|
||||||
import { addItems, combineInventoryChanges, getInventory } from "@/src/services/inventoryService";
|
import {
|
||||||
|
addItems,
|
||||||
|
combineInventoryChanges,
|
||||||
|
getEffectiveAvatarImageType,
|
||||||
|
getInventory
|
||||||
|
} from "@/src/services/inventoryService";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { ExportFlavour, ExportGear } from "warframe-public-export-plus";
|
import { ExportFlavour } from "warframe-public-export-plus";
|
||||||
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
|
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
|
||||||
|
import { fromStoreItem, isStoreItem } from "@/src/services/itemDataService";
|
||||||
|
import { IOid } from "@/src/types/commonTypes";
|
||||||
|
|
||||||
export const inboxController: RequestHandler = async (req, res) => {
|
export const inboxController: RequestHandler = async (req, res) => {
|
||||||
const { deleteId, lastMessage: latestClientMessageId, messageId } = req.query;
|
const { deleteId, lastMessage: latestClientMessageId, messageId } = req.query;
|
||||||
@ -27,10 +34,10 @@ export const inboxController: RequestHandler = async (req, res) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await deleteMessageRead(deleteId as string);
|
await deleteMessageRead(parseOid(deleteId as string));
|
||||||
res.status(200).end();
|
res.status(200).end();
|
||||||
} else if (messageId) {
|
} else if (messageId) {
|
||||||
const message = await getMessage(messageId as string);
|
const message = await getMessage(parseOid(messageId as string));
|
||||||
message.r = true;
|
message.r = true;
|
||||||
await message.save();
|
await message.save();
|
||||||
|
|
||||||
@ -48,8 +55,8 @@ export const inboxController: RequestHandler = async (req, res) => {
|
|||||||
await addItems(
|
await addItems(
|
||||||
inventory,
|
inventory,
|
||||||
attachmentItems.map(attItem => ({
|
attachmentItems.map(attItem => ({
|
||||||
ItemType: attItem,
|
ItemType: isStoreItem(attItem) ? fromStoreItem(attItem) : attItem,
|
||||||
ItemCount: attItem in ExportGear ? (ExportGear[attItem].purchaseQuantity ?? 1) : 1
|
ItemCount: 1
|
||||||
})),
|
})),
|
||||||
inventoryChanges
|
inventoryChanges
|
||||||
);
|
);
|
||||||
@ -86,7 +93,7 @@ export const inboxController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
sub: "/Lotus/Language/Menu/GiftReceivedConfirmationSubject",
|
sub: "/Lotus/Language/Menu/GiftReceivedConfirmationSubject",
|
||||||
icon: ExportFlavour[inventory.ActiveAvatarImageType].icon,
|
icon: ExportFlavour[getEffectiveAvatarImageType(inventory)].icon,
|
||||||
highPriority: true
|
highPriority: true
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
@ -99,7 +106,7 @@ export const inboxController: RequestHandler = async (req, res) => {
|
|||||||
await createNewEventMessages(req);
|
await createNewEventMessages(req);
|
||||||
const messages = await Inbox.find({ ownerId: accountId }).sort({ date: 1 });
|
const messages = await Inbox.find({ ownerId: accountId }).sort({ date: 1 });
|
||||||
|
|
||||||
const latestClientMessage = messages.find(m => m._id.toString() === latestClientMessageId);
|
const latestClientMessage = messages.find(m => m._id.toString() === parseOid(latestClientMessageId as string));
|
||||||
|
|
||||||
if (!latestClientMessage) {
|
if (!latestClientMessage) {
|
||||||
logger.debug(`this should only happen after DeleteAllRead `);
|
logger.debug(`this should only happen after DeleteAllRead `);
|
||||||
@ -122,3 +129,11 @@ export const inboxController: RequestHandler = async (req, res) => {
|
|||||||
res.json({ Inbox: inbox });
|
res.json({ Inbox: inbox });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 33.6.0 has query arguments like lastMessage={"$oid":"68112baebf192e786d1502bb"} instead of lastMessage=68112baebf192e786d1502bb
|
||||||
|
const parseOid = (oid: string): string => {
|
||||||
|
if (oid[0] == "{") {
|
||||||
|
return (JSON.parse(oid) as IOid).$oid;
|
||||||
|
}
|
||||||
|
return oid;
|
||||||
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountForRequest } from "@/src/services/loginService";
|
||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { getInventory, addMiscItems, updateCurrency, addRecipes, freeUpSlot } from "@/src/services/inventoryService";
|
import { getInventory, addMiscItems, updateCurrency, addRecipes, freeUpSlot } from "@/src/services/inventoryService";
|
||||||
import { IOid } from "@/src/types/commonTypes";
|
import { IOid } from "@/src/types/commonTypes";
|
||||||
@ -12,7 +12,7 @@ import {
|
|||||||
} from "@/src/types/inventoryTypes/inventoryTypes";
|
} from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { ExportMisc } from "warframe-public-export-plus";
|
import { ExportMisc } from "warframe-public-export-plus";
|
||||||
import { getRecipe } from "@/src/services/itemDataService";
|
import { getRecipe } from "@/src/services/itemDataService";
|
||||||
import { toMongoDate } from "@/src/helpers/inventoryHelpers";
|
import { toMongoDate, version_compare } from "@/src/helpers/inventoryHelpers";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { colorToShard } from "@/src/helpers/shardHelper";
|
import { colorToShard } from "@/src/helpers/shardHelper";
|
||||||
import { config } from "@/src/services/configService";
|
import { config } from "@/src/services/configService";
|
||||||
@ -23,12 +23,12 @@ import {
|
|||||||
} from "@/src/services/infestedFoundryService";
|
} from "@/src/services/infestedFoundryService";
|
||||||
|
|
||||||
export const infestedFoundryController: RequestHandler = async (req, res) => {
|
export const infestedFoundryController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const account = await getAccountForRequest(req);
|
||||||
switch (req.query.mode) {
|
switch (req.query.mode) {
|
||||||
case "s": {
|
case "s": {
|
||||||
// shard installation
|
// shard installation
|
||||||
const request = getJSONfromString<IShardInstallRequest>(String(req.body));
|
const request = getJSONfromString<IShardInstallRequest>(String(req.body));
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(account._id.toString());
|
||||||
const suit = inventory.Suits.id(request.SuitId.$oid)!;
|
const suit = inventory.Suits.id(request.SuitId.$oid)!;
|
||||||
if (!suit.ArchonCrystalUpgrades || suit.ArchonCrystalUpgrades.length != 5) {
|
if (!suit.ArchonCrystalUpgrades || suit.ArchonCrystalUpgrades.length != 5) {
|
||||||
suit.ArchonCrystalUpgrades = [{}, {}, {}, {}, {}];
|
suit.ArchonCrystalUpgrades = [{}, {}, {}, {}, {}];
|
||||||
@ -56,7 +56,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
|
|||||||
case "x": {
|
case "x": {
|
||||||
// shard removal
|
// shard removal
|
||||||
const request = getJSONfromString<IShardUninstallRequest>(String(req.body));
|
const request = getJSONfromString<IShardUninstallRequest>(String(req.body));
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(account._id.toString());
|
||||||
const suit = inventory.Suits.id(request.SuitId.$oid)!;
|
const suit = inventory.Suits.id(request.SuitId.$oid)!;
|
||||||
|
|
||||||
const miscItemChanges: IMiscItem[] = [];
|
const miscItemChanges: IMiscItem[] = [];
|
||||||
@ -70,19 +70,30 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
|
|||||||
ItemCount: 1
|
ItemCount: 1
|
||||||
});
|
});
|
||||||
addMiscItems(inventory, miscItemChanges);
|
addMiscItems(inventory, miscItemChanges);
|
||||||
|
|
||||||
|
// consume resources
|
||||||
|
if (!config.infiniteHelminthMaterials) {
|
||||||
|
let type: string;
|
||||||
|
let count: number;
|
||||||
|
if (account.BuildLabel && version_compare(account.BuildLabel, "2025.05.20.10.18") < 0) {
|
||||||
|
// < 38.6.0
|
||||||
|
type = "/Lotus/Types/Items/InfestedFoundry/HelminthBile";
|
||||||
|
count = 300;
|
||||||
|
} else {
|
||||||
|
// >= 38.6.0
|
||||||
|
type =
|
||||||
|
archonCrystalRemovalResource[
|
||||||
|
suit.ArchonCrystalUpgrades![request.Slot].Color!.replace("_MYTHIC", "")
|
||||||
|
];
|
||||||
|
count = suit.ArchonCrystalUpgrades![request.Slot].Color!.indexOf("_MYTHIC") != -1 ? 300 : 150;
|
||||||
|
}
|
||||||
|
inventory.InfestedFoundry!.Resources!.find(x => x.ItemType == type)!.Count -= count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove from suit
|
// remove from suit
|
||||||
suit.ArchonCrystalUpgrades![request.Slot] = {};
|
suit.ArchonCrystalUpgrades![request.Slot] = {};
|
||||||
|
|
||||||
if (!config.infiniteHelminthMaterials) {
|
|
||||||
// remove bile
|
|
||||||
const bile = inventory.InfestedFoundry!.Resources!.find(
|
|
||||||
x => x.ItemType == "/Lotus/Types/Items/InfestedFoundry/HelminthBile"
|
|
||||||
)!;
|
|
||||||
bile.Count -= 300;
|
|
||||||
}
|
|
||||||
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
|
|
||||||
const infestedFoundry = inventory.toJSON<IInventoryClient>().InfestedFoundry!;
|
const infestedFoundry = inventory.toJSON<IInventoryClient>().InfestedFoundry!;
|
||||||
@ -99,7 +110,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
|
|||||||
case "n": {
|
case "n": {
|
||||||
// name the beast
|
// name the beast
|
||||||
const request = getJSONfromString<IHelminthNameRequest>(String(req.body));
|
const request = getJSONfromString<IHelminthNameRequest>(String(req.body));
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(account._id.toString());
|
||||||
inventory.InfestedFoundry ??= {};
|
inventory.InfestedFoundry ??= {};
|
||||||
inventory.InfestedFoundry.Name = request.newName;
|
inventory.InfestedFoundry.Name = request.newName;
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
@ -122,7 +133,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const request = getJSONfromString<IHelminthFeedRequest>(String(req.body));
|
const request = getJSONfromString<IHelminthFeedRequest>(String(req.body));
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(account._id.toString());
|
||||||
inventory.InfestedFoundry ??= {};
|
inventory.InfestedFoundry ??= {};
|
||||||
inventory.InfestedFoundry.Resources ??= [];
|
inventory.InfestedFoundry.Resources ??= [];
|
||||||
|
|
||||||
@ -218,7 +229,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
|
|||||||
case "o": {
|
case "o": {
|
||||||
// offerings update
|
// offerings update
|
||||||
const request = getJSONfromString<IHelminthOfferingsUpdate>(String(req.body));
|
const request = getJSONfromString<IHelminthOfferingsUpdate>(String(req.body));
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(account._id.toString());
|
||||||
inventory.InfestedFoundry ??= {};
|
inventory.InfestedFoundry ??= {};
|
||||||
inventory.InfestedFoundry.InvigorationIndex = request.OfferingsIndex;
|
inventory.InfestedFoundry.InvigorationIndex = request.OfferingsIndex;
|
||||||
inventory.InfestedFoundry.InvigorationSuitOfferings = request.SuitTypes;
|
inventory.InfestedFoundry.InvigorationSuitOfferings = request.SuitTypes;
|
||||||
@ -239,7 +250,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
|
|||||||
case "a": {
|
case "a": {
|
||||||
// subsume warframe
|
// subsume warframe
|
||||||
const request = getJSONfromString<IHelminthSubsumeRequest>(String(req.body));
|
const request = getJSONfromString<IHelminthSubsumeRequest>(String(req.body));
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(account._id.toString());
|
||||||
const recipe = getRecipe(request.Recipe)!;
|
const recipe = getRecipe(request.Recipe)!;
|
||||||
if (!config.infiniteHelminthMaterials) {
|
if (!config.infiniteHelminthMaterials) {
|
||||||
for (const ingredient of recipe.secretIngredients!) {
|
for (const ingredient of recipe.secretIngredients!) {
|
||||||
@ -289,7 +300,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
|
|||||||
|
|
||||||
case "r": {
|
case "r": {
|
||||||
// rush subsume
|
// rush subsume
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(account._id.toString());
|
||||||
const currencyChanges = updateCurrency(inventory, 50, true);
|
const currencyChanges = updateCurrency(inventory, 50, true);
|
||||||
const recipeChanges = handleSubsumeCompletion(inventory);
|
const recipeChanges = handleSubsumeCompletion(inventory);
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
@ -307,7 +318,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
|
|||||||
|
|
||||||
case "u": {
|
case "u": {
|
||||||
const request = getJSONfromString<IHelminthInvigorationRequest>(String(req.body));
|
const request = getJSONfromString<IHelminthInvigorationRequest>(String(req.body));
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(account._id.toString());
|
||||||
const suit = inventory.Suits.id(request.SuitId.$oid)!;
|
const suit = inventory.Suits.id(request.SuitId.$oid)!;
|
||||||
const upgradesExpiry = new Date(Date.now() + 7 * 24 * 60 * 60 * 1000);
|
const upgradesExpiry = new Date(Date.now() + 7 * 24 * 60 * 60 * 1000);
|
||||||
suit.OffensiveUpgrade = request.OffensiveUpgradeType;
|
suit.OffensiveUpgrade = request.OffensiveUpgradeType;
|
||||||
@ -340,7 +351,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case "custom_unlockall": {
|
case "custom_unlockall": {
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(account._id.toString());
|
||||||
inventory.InfestedFoundry ??= {};
|
inventory.InfestedFoundry ??= {};
|
||||||
inventory.InfestedFoundry.XP ??= 0;
|
inventory.InfestedFoundry.XP ??= 0;
|
||||||
if (151875_00 > inventory.InfestedFoundry.XP) {
|
if (151875_00 > inventory.InfestedFoundry.XP) {
|
||||||
@ -439,3 +450,12 @@ const apetiteModel = (x: number): number => {
|
|||||||
}
|
}
|
||||||
return 3;
|
return 3;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const archonCrystalRemovalResource: Record<string, string> = {
|
||||||
|
ACC_RED: "/Lotus/Types/Items/InfestedFoundry/HelminthOxides",
|
||||||
|
ACC_YELLOW: "/Lotus/Types/Items/InfestedFoundry/HelminthBile",
|
||||||
|
ACC_BLUE: "/Lotus/Types/Items/InfestedFoundry/HelminthSynthetics",
|
||||||
|
ACC_GREEN: "/Lotus/Types/Items/InfestedFoundry/HelminthBiotics",
|
||||||
|
ACC_ORANGE: "/Lotus/Types/Items/InfestedFoundry/HelminthPheromones",
|
||||||
|
ACC_PURPLE: "/Lotus/Types/Items/InfestedFoundry/HelminthCalx"
|
||||||
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountForRequest } from "@/src/services/loginService";
|
||||||
import { Inventory, TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
import { Inventory, TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
||||||
import { config } from "@/src/services/configService";
|
import { config } from "@/src/services/configService";
|
||||||
import allDialogue from "@/static/fixed_responses/allDialogue.json";
|
import allDialogue from "@/static/fixed_responses/allDialogue.json";
|
||||||
@ -18,15 +18,22 @@ import {
|
|||||||
addMiscItems,
|
addMiscItems,
|
||||||
allDailyAffiliationKeys,
|
allDailyAffiliationKeys,
|
||||||
cleanupInventory,
|
cleanupInventory,
|
||||||
createLibraryDailyTask
|
createLibraryDailyTask,
|
||||||
|
generateRewardSeed
|
||||||
} from "@/src/services/inventoryService";
|
} from "@/src/services/inventoryService";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { catBreadHash } from "@/src/helpers/stringHelpers";
|
import { catBreadHash } from "@/src/helpers/stringHelpers";
|
||||||
|
import { Types } from "mongoose";
|
||||||
|
import { getNemesisManifest } from "@/src/helpers/nemesisHelpers";
|
||||||
|
import { getPersonalRooms } from "@/src/services/personalRoomsService";
|
||||||
|
import { IPersonalRoomsClient } from "@/src/types/personalRoomsTypes";
|
||||||
|
import { Ship } from "@/src/models/shipModel";
|
||||||
|
import { toLegacyOid, version_compare } from "@/src/helpers/inventoryHelpers";
|
||||||
|
|
||||||
export const inventoryController: RequestHandler = async (request, response) => {
|
export const inventoryController: RequestHandler = async (request, response) => {
|
||||||
const accountId = await getAccountIdForRequest(request);
|
const account = await getAccountForRequest(request);
|
||||||
|
|
||||||
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
|
const inventory = await Inventory.findOne({ accountOwnerId: account._id });
|
||||||
|
|
||||||
if (!inventory) {
|
if (!inventory) {
|
||||||
response.status(400).json({ error: "inventory was undefined" });
|
response.status(400).json({ error: "inventory was undefined" });
|
||||||
@ -87,7 +94,7 @@ export const inventoryController: RequestHandler = async (request, response) =>
|
|||||||
cleanupInventory(inventory);
|
cleanupInventory(inventory);
|
||||||
|
|
||||||
inventory.NextRefill = new Date((Math.trunc(Date.now() / 86400000) + 1) * 86400000);
|
inventory.NextRefill = new Date((Math.trunc(Date.now() / 86400000) + 1) * 86400000);
|
||||||
await inventory.save();
|
//await inventory.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@ -96,23 +103,43 @@ export const inventoryController: RequestHandler = async (request, response) =>
|
|||||||
new Date() >= inventory.InfestedFoundry.AbilityOverrideUnlockCooldown
|
new Date() >= inventory.InfestedFoundry.AbilityOverrideUnlockCooldown
|
||||||
) {
|
) {
|
||||||
handleSubsumeCompletion(inventory);
|
handleSubsumeCompletion(inventory);
|
||||||
await inventory.save();
|
//await inventory.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
response.json(await getInventoryResponse(inventory, "xpBasedLevelCapDisabled" in request.query));
|
if (inventory.LastInventorySync) {
|
||||||
|
const lastSyncDuviriMood = Math.trunc(inventory.LastInventorySync.getTimestamp().getTime() / 7200000);
|
||||||
|
const currentDuviriMood = Math.trunc(Date.now() / 7200000);
|
||||||
|
if (lastSyncDuviriMood != currentDuviriMood) {
|
||||||
|
logger.debug(`refreshing duviri seed`);
|
||||||
|
if (!inventory.DuviriInfo) {
|
||||||
|
inventory.DuviriInfo = {
|
||||||
|
Seed: generateRewardSeed(),
|
||||||
|
NumCompletions: 0
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
inventory.DuviriInfo.Seed = generateRewardSeed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
inventory.LastInventorySync = new Types.ObjectId();
|
||||||
|
await inventory.save();
|
||||||
|
|
||||||
|
response.json(
|
||||||
|
await getInventoryResponse(inventory, "xpBasedLevelCapDisabled" in request.query, account.BuildLabel)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getInventoryResponse = async (
|
export const getInventoryResponse = async (
|
||||||
inventory: TInventoryDatabaseDocument,
|
inventory: TInventoryDatabaseDocument,
|
||||||
xpBasedLevelCapDisabled: boolean
|
xpBasedLevelCapDisabled: boolean,
|
||||||
|
buildLabel: string | undefined
|
||||||
): Promise<IInventoryClient> => {
|
): Promise<IInventoryClient> => {
|
||||||
const inventoryWithLoadOutPresets = await inventory.populate<{ LoadOutPresets: ILoadoutDatabase }>(
|
const [inventoryWithLoadOutPresets, ships] = await Promise.all([
|
||||||
"LoadOutPresets"
|
inventory.populate<{ LoadOutPresets: ILoadoutDatabase }>("LoadOutPresets"),
|
||||||
);
|
Ship.find({ ShipOwnerId: inventory.accountOwnerId })
|
||||||
const inventoryWithLoadOutPresetsAndShips = await inventoryWithLoadOutPresets.populate<{ Ships: IShipInventory }>(
|
]);
|
||||||
"Ships"
|
const inventoryResponse = inventoryWithLoadOutPresets.toJSON<IInventoryClient>();
|
||||||
);
|
inventoryResponse.Ships = ships.map(x => x.toJSON<IShipInventory>());
|
||||||
const inventoryResponse = inventoryWithLoadOutPresetsAndShips.toJSON<IInventoryClient>();
|
|
||||||
|
|
||||||
if (config.infiniteCredits) {
|
if (config.infiniteCredits) {
|
||||||
inventoryResponse.RegularCredits = 999999999;
|
inventoryResponse.RegularCredits = 999999999;
|
||||||
@ -274,16 +301,49 @@ export const getInventoryResponse = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Omitting this field so opening the navigation resyncs the inventory which is more desirable for typical usage.
|
// Omitting this field so opening the navigation resyncs the inventory which is more desirable for typical usage.
|
||||||
//inventoryResponse.LastInventorySync = toOid(new Types.ObjectId());
|
inventoryResponse.LastInventorySync = undefined;
|
||||||
|
|
||||||
// Set 2FA enabled so trading post can be used
|
// Set 2FA enabled so trading post can be used
|
||||||
inventoryResponse.HWIDProtectEnabled = true;
|
inventoryResponse.HWIDProtectEnabled = true;
|
||||||
|
|
||||||
|
if (buildLabel) {
|
||||||
|
// Fix nemesis for older versions
|
||||||
|
if (
|
||||||
|
inventoryResponse.Nemesis &&
|
||||||
|
version_compare(buildLabel, getNemesisManifest(inventoryResponse.Nemesis.manifest).minBuild) < 0
|
||||||
|
) {
|
||||||
|
inventoryResponse.Nemesis = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (version_compare(buildLabel, "2018.02.22.14.34") < 0) {
|
||||||
|
const personalRoomsDb = await getPersonalRooms(inventory.accountOwnerId.toString());
|
||||||
|
const personalRooms = personalRoomsDb.toJSON<IPersonalRoomsClient>();
|
||||||
|
inventoryResponse.Ship = personalRooms.Ship;
|
||||||
|
|
||||||
|
if (version_compare(buildLabel, "2016.12.21.19.13") <= 0) {
|
||||||
|
// U19.5 and below use $id instead of $oid
|
||||||
|
for (const category of equipmentKeys) {
|
||||||
|
for (const item of inventoryResponse[category]) {
|
||||||
|
toLegacyOid(item.ItemId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const upgrade of inventoryResponse.Upgrades) {
|
||||||
|
toLegacyOid(upgrade.ItemId);
|
||||||
|
}
|
||||||
|
if (inventoryResponse.BrandedSuits) {
|
||||||
|
for (const id of inventoryResponse.BrandedSuits) {
|
||||||
|
toLegacyOid(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return inventoryResponse;
|
return inventoryResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
const addString = (arr: string[], str: string): void => {
|
const addString = (arr: string[], str: string): void => {
|
||||||
if (!arr.find(x => x == str)) {
|
if (arr.indexOf(str) == -1) {
|
||||||
arr.push(str);
|
arr.push(str);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -7,6 +7,7 @@ import { Account } from "@/src/models/loginModel";
|
|||||||
import { createAccount, isCorrectPassword, isNameTaken } from "@/src/services/loginService";
|
import { createAccount, isCorrectPassword, isNameTaken } from "@/src/services/loginService";
|
||||||
import { IDatabaseAccountJson, ILoginRequest, ILoginResponse } from "@/src/types/loginTypes";
|
import { IDatabaseAccountJson, ILoginRequest, ILoginResponse } from "@/src/types/loginTypes";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
|
import { version_compare } from "@/src/helpers/inventoryHelpers";
|
||||||
|
|
||||||
export const loginController: RequestHandler = async (request, response) => {
|
export const loginController: RequestHandler = async (request, response) => {
|
||||||
const loginRequest = JSON.parse(String(request.body)) as ILoginRequest; // parse octet stream of json data to json object
|
const loginRequest = JSON.parse(String(request.body)) as ILoginRequest; // parse octet stream of json data to json object
|
||||||
@ -19,9 +20,27 @@ export const loginController: RequestHandler = async (request, response) => {
|
|||||||
? request.query.buildLabel.split(" ").join("+")
|
? request.query.buildLabel.split(" ").join("+")
|
||||||
: buildConfig.buildLabel;
|
: buildConfig.buildLabel;
|
||||||
|
|
||||||
const myAddress = request.host.indexOf("warframe.com") == -1 ? request.host : config.myAddress;
|
let myAddress: string;
|
||||||
|
let myUrlBase: string = request.protocol + "://";
|
||||||
|
if (request.host.indexOf("warframe.com") == -1) {
|
||||||
|
// Client request was redirected cleanly, so we know it can reach us how it's reaching us now.
|
||||||
|
myAddress = request.hostname;
|
||||||
|
myUrlBase += request.host;
|
||||||
|
} else {
|
||||||
|
// Don't know how the client reached us, hoping the config does.
|
||||||
|
myAddress = config.myAddress;
|
||||||
|
myUrlBase += myAddress;
|
||||||
|
const port: number = request.protocol == "http" ? config.httpPort || 80 : config.httpsPort || 443;
|
||||||
|
if (port != (request.protocol == "http" ? 80 : 443)) {
|
||||||
|
myUrlBase += ":" + port;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!account && config.autoCreateAccount && loginRequest.ClientType != "webui") {
|
if (
|
||||||
|
!account &&
|
||||||
|
((config.autoCreateAccount && loginRequest.ClientType != "webui") ||
|
||||||
|
loginRequest.ClientType == "webui-register")
|
||||||
|
) {
|
||||||
try {
|
try {
|
||||||
const nameFromEmail = loginRequest.email.substring(0, loginRequest.email.indexOf("@"));
|
const nameFromEmail = loginRequest.email.substring(0, loginRequest.email.indexOf("@"));
|
||||||
let name = nameFromEmail || loginRequest.email.substring(1) || "SpaceNinja";
|
let name = nameFromEmail || loginRequest.email.substring(1) || "SpaceNinja";
|
||||||
@ -36,16 +55,18 @@ export const loginController: RequestHandler = async (request, response) => {
|
|||||||
email: loginRequest.email,
|
email: loginRequest.email,
|
||||||
password: loginRequest.password,
|
password: loginRequest.password,
|
||||||
DisplayName: name,
|
DisplayName: name,
|
||||||
CountryCode: loginRequest.lang.toUpperCase(),
|
CountryCode: loginRequest.lang?.toUpperCase() ?? "EN",
|
||||||
ClientType: loginRequest.ClientType,
|
ClientType: loginRequest.ClientType == "webui-register" ? "webui" : loginRequest.ClientType,
|
||||||
CrossPlatformAllowed: true,
|
CrossPlatformAllowed: true,
|
||||||
ForceLogoutVersion: 0,
|
ForceLogoutVersion: 0,
|
||||||
ConsentNeeded: false,
|
ConsentNeeded: false,
|
||||||
TrackedSettings: [],
|
TrackedSettings: [],
|
||||||
Nonce: nonce
|
Nonce: nonce,
|
||||||
|
BuildLabel: buildLabel,
|
||||||
|
LastLogin: new Date()
|
||||||
});
|
});
|
||||||
logger.debug("created new account");
|
logger.debug("created new account");
|
||||||
response.json(createLoginResponse(myAddress, newAccount, buildLabel));
|
response.json(createLoginResponse(myAddress, myUrlBase, newAccount, buildLabel));
|
||||||
return;
|
return;
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
@ -59,6 +80,11 @@ export const loginController: RequestHandler = async (request, response) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (loginRequest.ClientType == "webui-register") {
|
||||||
|
response.status(400).json({ error: "account already exists" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isCorrectPassword(loginRequest.password, account.password)) {
|
if (!isCorrectPassword(loginRequest.password, account.password)) {
|
||||||
response.status(400).json({ error: "incorrect login data" });
|
response.status(400).json({ error: "incorrect login data" });
|
||||||
return;
|
return;
|
||||||
@ -71,39 +97,72 @@ export const loginController: RequestHandler = async (request, response) => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (account.Nonce && account.ClientType != "webui" && !account.Dropped && !loginRequest.kick) {
|
if (account.Nonce && account.ClientType != "webui" && !account.Dropped && !loginRequest.kick) {
|
||||||
response.status(400).json({ error: "nonce still set" });
|
// U17 seems to handle "nonce still set" like a login failure.
|
||||||
return;
|
if (version_compare(buildLabel, "2015.12.05.18.07") >= 0) {
|
||||||
|
response.status(400).send({ error: "nonce still set" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
account.ClientType = loginRequest.ClientType;
|
account.ClientType = loginRequest.ClientType;
|
||||||
account.Nonce = nonce;
|
account.Nonce = nonce;
|
||||||
account.CountryCode = loginRequest.lang.toUpperCase();
|
account.CountryCode = loginRequest.lang?.toUpperCase() ?? "EN";
|
||||||
|
account.BuildLabel = buildLabel;
|
||||||
|
account.LastLogin = new Date();
|
||||||
}
|
}
|
||||||
await account.save();
|
await account.save();
|
||||||
|
|
||||||
response.json(createLoginResponse(myAddress, account.toJSON(), buildLabel));
|
response.json(createLoginResponse(myAddress, myUrlBase, account.toJSON(), buildLabel));
|
||||||
};
|
};
|
||||||
|
|
||||||
const createLoginResponse = (myAddress: string, account: IDatabaseAccountJson, buildLabel: string): ILoginResponse => {
|
const createLoginResponse = (
|
||||||
return {
|
myAddress: string,
|
||||||
|
myUrlBase: string,
|
||||||
|
account: IDatabaseAccountJson,
|
||||||
|
buildLabel: string
|
||||||
|
): ILoginResponse => {
|
||||||
|
const resp: ILoginResponse = {
|
||||||
id: account.id,
|
id: account.id,
|
||||||
DisplayName: account.DisplayName,
|
DisplayName: account.DisplayName,
|
||||||
CountryCode: account.CountryCode,
|
CountryCode: account.CountryCode,
|
||||||
ClientType: account.ClientType,
|
|
||||||
CrossPlatformAllowed: account.CrossPlatformAllowed,
|
|
||||||
ForceLogoutVersion: account.ForceLogoutVersion,
|
|
||||||
AmazonAuthToken: account.AmazonAuthToken,
|
AmazonAuthToken: account.AmazonAuthToken,
|
||||||
AmazonRefreshToken: account.AmazonRefreshToken,
|
AmazonRefreshToken: account.AmazonRefreshToken,
|
||||||
ConsentNeeded: account.ConsentNeeded,
|
|
||||||
TrackedSettings: account.TrackedSettings,
|
|
||||||
Nonce: account.Nonce,
|
Nonce: account.Nonce,
|
||||||
Groups: [],
|
BuildLabel: buildLabel
|
||||||
IRC: config.myIrcAddresses ?? [myAddress],
|
|
||||||
platformCDNs: [`https://${myAddress}/`],
|
|
||||||
HUB: `https://${myAddress}/api/`,
|
|
||||||
NRS: config.NRS,
|
|
||||||
DTLS: 99,
|
|
||||||
BuildLabel: buildLabel,
|
|
||||||
MatchmakingBuildId: buildConfig.matchmakingBuildId
|
|
||||||
};
|
};
|
||||||
|
if (version_compare(buildLabel, "2015.02.13.10.41") >= 0) {
|
||||||
|
resp.NRS = config.NRS;
|
||||||
|
}
|
||||||
|
if (version_compare(buildLabel, "2015.05.14.16.29") >= 0) {
|
||||||
|
// U17 and up
|
||||||
|
resp.IRC = config.myIrcAddresses ?? [myAddress];
|
||||||
|
}
|
||||||
|
if (version_compare(buildLabel, "2018.11.08.14.45") >= 0) {
|
||||||
|
// U24 and up
|
||||||
|
resp.ConsentNeeded = account.ConsentNeeded;
|
||||||
|
resp.TrackedSettings = account.TrackedSettings;
|
||||||
|
}
|
||||||
|
if (version_compare(buildLabel, "2019.08.29.20.01") >= 0) {
|
||||||
|
// U25.7 and up
|
||||||
|
resp.ForceLogoutVersion = account.ForceLogoutVersion;
|
||||||
|
}
|
||||||
|
if (version_compare(buildLabel, "2019.10.31.22.42") >= 0) {
|
||||||
|
// U26 and up
|
||||||
|
resp.Groups = [];
|
||||||
|
}
|
||||||
|
if (version_compare(buildLabel, "2021.04.13.19.58") >= 0) {
|
||||||
|
resp.DTLS = 99;
|
||||||
|
}
|
||||||
|
if (version_compare(buildLabel, "2022.04.29.12.53") >= 0) {
|
||||||
|
resp.ClientType = account.ClientType;
|
||||||
|
}
|
||||||
|
if (version_compare(buildLabel, "2022.09.06.19.24") >= 0) {
|
||||||
|
resp.CrossPlatformAllowed = account.CrossPlatformAllowed;
|
||||||
|
resp.HUB = `${myUrlBase}/api/`;
|
||||||
|
resp.MatchmakingBuildId = buildConfig.matchmakingBuildId;
|
||||||
|
}
|
||||||
|
if (version_compare(buildLabel, "2023.04.25.23.40") >= 0) {
|
||||||
|
resp.platformCDNs = [`${myUrlBase}/`];
|
||||||
|
}
|
||||||
|
return resp;
|
||||||
};
|
};
|
||||||
|
@ -26,7 +26,7 @@ export const loginRewardsSelectionController: RequestHandler = async (req, res)
|
|||||||
StoreItemType: body.ChosenReward
|
StoreItemType: body.ChosenReward
|
||||||
};
|
};
|
||||||
inventoryChanges = (await handleStoreItemAcquisition(body.ChosenReward, inventory)).InventoryChanges;
|
inventoryChanges = (await handleStoreItemAcquisition(body.ChosenReward, inventory)).InventoryChanges;
|
||||||
if (!evergreenRewards.find(x => x == body.ChosenReward)) {
|
if (evergreenRewards.indexOf(body.ChosenReward) == -1) {
|
||||||
inventory.LoginMilestoneRewards.push(body.ChosenReward);
|
inventory.LoginMilestoneRewards.push(body.ChosenReward);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountForRequest } from "@/src/services/loginService";
|
||||||
import { IMissionInventoryUpdateRequest } from "@/src/types/requestTypes";
|
import { IMissionInventoryUpdateRequest } from "@/src/types/requestTypes";
|
||||||
import { addMissionInventoryUpdates, addMissionRewards } from "@/src/services/missionInventoryUpdateService";
|
import { addMissionInventoryUpdates, addMissionRewards } from "@/src/services/missionInventoryUpdateService";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { generateRewardSeed, getInventory } from "@/src/services/inventoryService";
|
||||||
import { getInventoryResponse } from "./inventoryController";
|
import { getInventoryResponse } from "./inventoryController";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
|
import { IMissionInventoryUpdateResponse } from "@/src/types/missionTypes";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
**** INPUT ****
|
**** INPUT ****
|
||||||
@ -48,22 +49,29 @@ import { logger } from "@/src/utils/logger";
|
|||||||
*/
|
*/
|
||||||
//move credit calc in here, return MissionRewards: [] if no reward info
|
//move credit calc in here, return MissionRewards: [] if no reward info
|
||||||
export const missionInventoryUpdateController: RequestHandler = async (req, res): Promise<void> => {
|
export const missionInventoryUpdateController: RequestHandler = async (req, res): Promise<void> => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const account = await getAccountForRequest(req);
|
||||||
const missionReport = getJSONfromString<IMissionInventoryUpdateRequest>((req.body as string).toString());
|
const missionReport = getJSONfromString<IMissionInventoryUpdateRequest>((req.body as string).toString());
|
||||||
logger.debug("mission report:", missionReport);
|
logger.debug("mission report:", missionReport);
|
||||||
|
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(account._id.toString());
|
||||||
const firstCompletion = missionReport.SortieId
|
const firstCompletion = missionReport.SortieId
|
||||||
? inventory.CompletedSorties.indexOf(missionReport.SortieId) == -1
|
? inventory.CompletedSorties.indexOf(missionReport.SortieId) == -1
|
||||||
: false;
|
: false;
|
||||||
const inventoryUpdates = await addMissionInventoryUpdates(inventory, missionReport);
|
const inventoryUpdates = await addMissionInventoryUpdates(account, inventory, missionReport);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
missionReport.MissionStatus !== "GS_SUCCESS" &&
|
missionReport.MissionStatus !== "GS_SUCCESS" &&
|
||||||
!(missionReport.RewardInfo?.jobId || missionReport.RewardInfo?.challengeMissionId)
|
!(
|
||||||
|
missionReport.RewardInfo?.jobId ||
|
||||||
|
missionReport.RewardInfo?.challengeMissionId ||
|
||||||
|
missionReport.RewardInfo?.T
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
|
if (missionReport.EndOfMatchUpload) {
|
||||||
|
inventory.RewardSeed = generateRewardSeed();
|
||||||
|
}
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
const inventoryResponse = await getInventoryResponse(inventory, true);
|
const inventoryResponse = await getInventoryResponse(inventory, true, account.BuildLabel);
|
||||||
res.json({
|
res.json({
|
||||||
InventoryJson: JSON.stringify(inventoryResponse),
|
InventoryJson: JSON.stringify(inventoryResponse),
|
||||||
MissionRewards: []
|
MissionRewards: []
|
||||||
@ -71,11 +79,20 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { MissionRewards, inventoryChanges, credits, AffiliationMods, SyndicateXPItemReward } =
|
const {
|
||||||
await addMissionRewards(inventory, missionReport, firstCompletion);
|
MissionRewards,
|
||||||
|
inventoryChanges,
|
||||||
|
credits,
|
||||||
|
AffiliationMods,
|
||||||
|
SyndicateXPItemReward,
|
||||||
|
ConquestCompletedMissionsCount
|
||||||
|
} = await addMissionRewards(inventory, missionReport, firstCompletion);
|
||||||
|
|
||||||
|
if (missionReport.EndOfMatchUpload) {
|
||||||
|
inventory.RewardSeed = generateRewardSeed();
|
||||||
|
}
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
const inventoryResponse = await getInventoryResponse(inventory, true);
|
const inventoryResponse = await getInventoryResponse(inventory, true, account.BuildLabel);
|
||||||
|
|
||||||
//TODO: figure out when to send inventory. it is needed for many cases.
|
//TODO: figure out when to send inventory. it is needed for many cases.
|
||||||
res.json({
|
res.json({
|
||||||
@ -86,8 +103,9 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
|
|||||||
...inventoryUpdates,
|
...inventoryUpdates,
|
||||||
//FusionPoints: inventoryChanges?.FusionPoints, // This in combination with InventoryJson or InventoryChanges seems to just double the number of endo shown, so unsure when this is needed.
|
//FusionPoints: inventoryChanges?.FusionPoints, // This in combination with InventoryJson or InventoryChanges seems to just double the number of endo shown, so unsure when this is needed.
|
||||||
SyndicateXPItemReward,
|
SyndicateXPItemReward,
|
||||||
AffiliationMods
|
AffiliationMods,
|
||||||
});
|
ConquestCompletedMissionsCount
|
||||||
|
} satisfies IMissionInventoryUpdateResponse);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -17,7 +17,7 @@ import { getDefaultUpgrades } from "@/src/services/itemDataService";
|
|||||||
import { modularWeaponTypes } from "@/src/helpers/modularWeaponHelper";
|
import { modularWeaponTypes } from "@/src/helpers/modularWeaponHelper";
|
||||||
import { IEquipmentDatabase } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
import { IEquipmentDatabase } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { getRandomInt } from "@/src/services/rngService";
|
import { getRandomInt } from "@/src/services/rngService";
|
||||||
import { ExportSentinels, IDefaultUpgrade } from "warframe-public-export-plus";
|
import { ExportSentinels, ExportWeapons, IDefaultUpgrade } from "warframe-public-export-plus";
|
||||||
import { Status } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { Status } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
|
|
||||||
interface IModularCraftRequest {
|
interface IModularCraftRequest {
|
||||||
@ -36,7 +36,9 @@ export const modularWeaponCraftingController: RequestHandler = async (req, res)
|
|||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(accountId);
|
||||||
|
|
||||||
let defaultUpgrades: IDefaultUpgrade[] | undefined;
|
let defaultUpgrades: IDefaultUpgrade[] | undefined;
|
||||||
const defaultOverwrites: Partial<IEquipmentDatabase> = {};
|
const defaultOverwrites: Partial<IEquipmentDatabase> = {
|
||||||
|
ModularParts: data.Parts
|
||||||
|
};
|
||||||
const inventoryChanges: IInventoryChanges = {};
|
const inventoryChanges: IInventoryChanges = {};
|
||||||
if (category == "KubrowPets") {
|
if (category == "KubrowPets") {
|
||||||
const traits = {
|
const traits = {
|
||||||
@ -138,8 +140,20 @@ export const modularWeaponCraftingController: RequestHandler = async (req, res)
|
|||||||
} else {
|
} else {
|
||||||
defaultUpgrades = getDefaultUpgrades(data.Parts);
|
defaultUpgrades = getDefaultUpgrades(data.Parts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (category == "MoaPets") {
|
||||||
|
const weapon = ExportSentinels[data.WeaponType].defaultWeapon;
|
||||||
|
if (weapon) {
|
||||||
|
const category = ExportWeapons[weapon].productCategory;
|
||||||
|
addEquipment(inventory, category, weapon, undefined, inventoryChanges);
|
||||||
|
combineInventoryChanges(
|
||||||
|
inventoryChanges,
|
||||||
|
occupySlot(inventory, productCategoryToInventoryBin(category)!, !!data.isWebUi)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
defaultOverwrites.Configs = applyDefaultUpgrades(inventory, defaultUpgrades);
|
defaultOverwrites.Configs = applyDefaultUpgrades(inventory, defaultUpgrades);
|
||||||
addEquipment(inventory, category, data.WeaponType, data.Parts, inventoryChanges, defaultOverwrites);
|
addEquipment(inventory, category, data.WeaponType, defaultOverwrites, inventoryChanges);
|
||||||
combineInventoryChanges(
|
combineInventoryChanges(
|
||||||
inventoryChanges,
|
inventoryChanges,
|
||||||
occupySlot(inventory, productCategoryToInventoryBin(category)!, !!data.isWebUi)
|
occupySlot(inventory, productCategoryToInventoryBin(category)!, !!data.isWebUi)
|
||||||
|
@ -2,7 +2,7 @@ import { RequestHandler } from "express";
|
|||||||
import { ExportWeapons } from "warframe-public-export-plus";
|
import { ExportWeapons } from "warframe-public-export-plus";
|
||||||
import { IMongoDate } from "@/src/types/commonTypes";
|
import { IMongoDate } from "@/src/types/commonTypes";
|
||||||
import { toMongoDate } from "@/src/helpers/inventoryHelpers";
|
import { toMongoDate } from "@/src/helpers/inventoryHelpers";
|
||||||
import { CRng } from "@/src/services/rngService";
|
import { SRng } from "@/src/services/rngService";
|
||||||
import { ArtifactPolarity, EquipmentFeatures } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
import { ArtifactPolarity, EquipmentFeatures } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import {
|
import {
|
||||||
@ -21,7 +21,11 @@ import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
|||||||
export const modularWeaponSaleController: RequestHandler = async (req, res) => {
|
export const modularWeaponSaleController: RequestHandler = async (req, res) => {
|
||||||
const partTypeToParts: Record<string, string[]> = {};
|
const partTypeToParts: Record<string, string[]> = {};
|
||||||
for (const [uniqueName, data] of Object.entries(ExportWeapons)) {
|
for (const [uniqueName, data] of Object.entries(ExportWeapons)) {
|
||||||
if (data.partType && data.premiumPrice) {
|
if (
|
||||||
|
data.partType &&
|
||||||
|
data.premiumPrice &&
|
||||||
|
!data.excludeFromCodex // exclude pvp variants
|
||||||
|
) {
|
||||||
partTypeToParts[data.partType] ??= [];
|
partTypeToParts[data.partType] ??= [];
|
||||||
partTypeToParts[data.partType].push(uniqueName);
|
partTypeToParts[data.partType].push(uniqueName);
|
||||||
}
|
}
|
||||||
@ -41,24 +45,18 @@ export const modularWeaponSaleController: RequestHandler = async (req, res) => {
|
|||||||
const defaultUpgrades = getDefaultUpgrades(weaponInfo.ModularParts);
|
const defaultUpgrades = getDefaultUpgrades(weaponInfo.ModularParts);
|
||||||
const configs = applyDefaultUpgrades(inventory, defaultUpgrades);
|
const configs = applyDefaultUpgrades(inventory, defaultUpgrades);
|
||||||
const inventoryChanges: IInventoryChanges = {
|
const inventoryChanges: IInventoryChanges = {
|
||||||
...addEquipment(
|
...addEquipment(inventory, category, weaponInfo.ItemType, {
|
||||||
inventory,
|
Features: EquipmentFeatures.DOUBLE_CAPACITY | EquipmentFeatures.GILDED,
|
||||||
category,
|
ItemName: payload.ItemName,
|
||||||
weaponInfo.ItemType,
|
Configs: configs,
|
||||||
weaponInfo.ModularParts,
|
ModularParts: weaponInfo.ModularParts,
|
||||||
{},
|
Polarity: [
|
||||||
{
|
{
|
||||||
Features: EquipmentFeatures.DOUBLE_CAPACITY | EquipmentFeatures.GILDED,
|
Slot: payload.PolarizeSlot,
|
||||||
ItemName: payload.ItemName,
|
Value: payload.PolarizeValue
|
||||||
Configs: configs,
|
}
|
||||||
Polarity: [
|
]
|
||||||
{
|
}),
|
||||||
Slot: payload.PolarizeSlot,
|
|
||||||
Value: payload.PolarizeValue
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
),
|
|
||||||
...occupySlot(inventory, productCategoryToInventoryBin(category)!, true),
|
...occupySlot(inventory, productCategoryToInventoryBin(category)!, true),
|
||||||
...updateCurrency(inventory, weaponInfo.PremiumPrice, true)
|
...updateCurrency(inventory, weaponInfo.PremiumPrice, true)
|
||||||
};
|
};
|
||||||
@ -142,8 +140,8 @@ const getModularWeaponSale = (
|
|||||||
partTypes: string[],
|
partTypes: string[],
|
||||||
getItemType: (parts: string[]) => string
|
getItemType: (parts: string[]) => string
|
||||||
): IModularWeaponSaleInfo => {
|
): IModularWeaponSaleInfo => {
|
||||||
const rng = new CRng(day);
|
const rng = new SRng(day);
|
||||||
const parts = partTypes.map(partType => rng.randomElement(partTypeToParts[partType]));
|
const parts = partTypes.map(partType => rng.randomElement(partTypeToParts[partType])!);
|
||||||
let partsCost = 0;
|
let partsCost = 0;
|
||||||
for (const part of parts) {
|
for (const part of parts) {
|
||||||
partsCost += ExportWeapons[part].premiumPrice!;
|
partsCost += ExportWeapons[part].premiumPrice!;
|
||||||
|
@ -1,33 +1,46 @@
|
|||||||
|
import { version_compare } from "@/src/helpers/inventoryHelpers";
|
||||||
import {
|
import {
|
||||||
consumeModCharge,
|
consumeModCharge,
|
||||||
|
decodeNemesisGuess,
|
||||||
encodeNemesisGuess,
|
encodeNemesisGuess,
|
||||||
getInfNodes,
|
getInfNodes,
|
||||||
|
getKnifeUpgrade,
|
||||||
|
getNemesisManifest,
|
||||||
getNemesisPasscode,
|
getNemesisPasscode,
|
||||||
|
getNemesisPasscodeModTypes,
|
||||||
|
GUESS_CORRECT,
|
||||||
|
GUESS_INCORRECT,
|
||||||
|
GUESS_NEUTRAL,
|
||||||
|
GUESS_NONE,
|
||||||
|
GUESS_WILDCARD,
|
||||||
IKnifeResponse
|
IKnifeResponse
|
||||||
} from "@/src/helpers/nemesisHelpers";
|
} from "@/src/helpers/nemesisHelpers";
|
||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { Loadout } from "@/src/models/inventoryModels/loadoutModel";
|
import { Loadout } from "@/src/models/inventoryModels/loadoutModel";
|
||||||
import { freeUpSlot, getInventory } from "@/src/services/inventoryService";
|
import { freeUpSlot, getInventory } from "@/src/services/inventoryService";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountForRequest } from "@/src/services/loginService";
|
||||||
import { SRng } from "@/src/services/rngService";
|
import { SRng } from "@/src/services/rngService";
|
||||||
import { IMongoDate, IOid } from "@/src/types/commonTypes";
|
import { IMongoDate, IOid } from "@/src/types/commonTypes";
|
||||||
import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import {
|
import {
|
||||||
IInnateDamageFingerprint,
|
IInnateDamageFingerprint,
|
||||||
|
IInventoryClient,
|
||||||
|
INemesisClient,
|
||||||
InventorySlot,
|
InventorySlot,
|
||||||
IUpgradeClient,
|
IUpgradeClient,
|
||||||
IWeaponSkinClient,
|
IWeaponSkinClient,
|
||||||
LoadoutIndex,
|
LoadoutIndex,
|
||||||
TEquipmentKey
|
TEquipmentKey,
|
||||||
|
TNemesisFaction
|
||||||
} from "@/src/types/inventoryTypes/inventoryTypes";
|
} from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
export const nemesisController: RequestHandler = async (req, res) => {
|
export const nemesisController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const account = await getAccountForRequest(req);
|
||||||
if ((req.query.mode as string) == "f") {
|
if ((req.query.mode as string) == "f") {
|
||||||
const body = getJSONfromString<IValenceFusionRequest>(String(req.body));
|
const body = getJSONfromString<IValenceFusionRequest>(String(req.body));
|
||||||
const inventory = await getInventory(accountId, body.Category + " WeaponBin");
|
const inventory = await getInventory(account._id.toString(), body.Category + " WeaponBin");
|
||||||
const destWeapon = inventory[body.Category].id(body.DestWeapon.$oid)!;
|
const destWeapon = inventory[body.Category].id(body.DestWeapon.$oid)!;
|
||||||
const sourceWeapon = inventory[body.Category].id(body.SourceWeapon.$oid)!;
|
const sourceWeapon = inventory[body.Category].id(body.SourceWeapon.$oid)!;
|
||||||
const destFingerprint = JSON.parse(destWeapon.UpgradeFingerprint!) as IInnateDamageFingerprint;
|
const destFingerprint = JSON.parse(destWeapon.UpgradeFingerprint!) as IInnateDamageFingerprint;
|
||||||
@ -62,7 +75,7 @@ export const nemesisController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if ((req.query.mode as string) == "p") {
|
} else if ((req.query.mode as string) == "p") {
|
||||||
const inventory = await getInventory(accountId, "Nemesis");
|
const inventory = await getInventory(account._id.toString(), "Nemesis");
|
||||||
const body = getJSONfromString<INemesisPrespawnCheckRequest>(String(req.body));
|
const body = getJSONfromString<INemesisPrespawnCheckRequest>(String(req.body));
|
||||||
const passcode = getNemesisPasscode(inventory.Nemesis!);
|
const passcode = getNemesisPasscode(inventory.Nemesis!);
|
||||||
let guessResult = 0;
|
let guessResult = 0;
|
||||||
@ -75,7 +88,7 @@ export const nemesisController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (let i = 0; i != 3; ++i) {
|
for (let i = 0; i != 3; ++i) {
|
||||||
if (body.guess[i] == passcode[i]) {
|
if (body.guess[i] == passcode[i] || body.guess[i] == GUESS_WILDCARD) {
|
||||||
++guessResult;
|
++guessResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,114 +96,154 @@ export const nemesisController: RequestHandler = async (req, res) => {
|
|||||||
res.json({ GuessResult: guessResult });
|
res.json({ GuessResult: guessResult });
|
||||||
} else if (req.query.mode == "r") {
|
} else if (req.query.mode == "r") {
|
||||||
const inventory = await getInventory(
|
const inventory = await getInventory(
|
||||||
accountId,
|
account._id.toString(),
|
||||||
"Nemesis LoadOutPresets CurrentLoadOutIds DataKnives Upgrades RawUpgrades"
|
"Nemesis LoadOutPresets CurrentLoadOutIds DataKnives Upgrades RawUpgrades"
|
||||||
);
|
);
|
||||||
const body = getJSONfromString<INemesisRequiemRequest>(String(req.body));
|
const body = getJSONfromString<INemesisRequiemRequest>(String(req.body));
|
||||||
if (inventory.Nemesis!.Faction == "FC_INFESTATION") {
|
if (inventory.Nemesis!.Faction == "FC_INFESTATION") {
|
||||||
const guess: number[] = [body.guess & 0xf, (body.guess >> 4) & 0xf, (body.guess >> 8) & 0xf];
|
const guess: number[] = [body.guess & 0xf, (body.guess >> 4) & 0xf, (body.guess >> 8) & 0xf];
|
||||||
const passcode = getNemesisPasscode(inventory.Nemesis!)[0];
|
const passcode = getNemesisPasscode(inventory.Nemesis!)[0];
|
||||||
|
const result1 = passcode == guess[0] ? GUESS_CORRECT : GUESS_INCORRECT;
|
||||||
// Add to GuessHistory
|
const result2 = passcode == guess[1] ? GUESS_CORRECT : GUESS_INCORRECT;
|
||||||
const result1 = passcode == guess[0] ? 0 : 1;
|
const result3 = passcode == guess[2] ? GUESS_CORRECT : GUESS_INCORRECT;
|
||||||
const result2 = passcode == guess[1] ? 0 : 1;
|
|
||||||
const result3 = passcode == guess[2] ? 0 : 1;
|
|
||||||
inventory.Nemesis!.GuessHistory.push(
|
inventory.Nemesis!.GuessHistory.push(
|
||||||
encodeNemesisGuess(guess[0], result1, guess[1], result2, guess[2], result3)
|
encodeNemesisGuess([
|
||||||
|
{
|
||||||
|
symbol: guess[0],
|
||||||
|
result: result1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
symbol: guess[1],
|
||||||
|
result: result2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
symbol: guess[2],
|
||||||
|
result: result3
|
||||||
|
}
|
||||||
|
])
|
||||||
);
|
);
|
||||||
|
|
||||||
// Increase antivirus
|
// Increase antivirus if correct antivirus mod is installed
|
||||||
let antivirusGain = 5;
|
|
||||||
const loadout = (await Loadout.findById(inventory.LoadOutPresets, "DATAKNIFE"))!;
|
|
||||||
const dataknifeLoadout = loadout.DATAKNIFE.id(inventory.CurrentLoadOutIds[LoadoutIndex.DATAKNIFE].$oid);
|
|
||||||
const dataknifeConfigIndex = dataknifeLoadout?.s?.mod ?? 0;
|
|
||||||
const dataknifeUpgrades = inventory.DataKnives[0].Configs[dataknifeConfigIndex].Upgrades!;
|
|
||||||
const response: IKnifeResponse = {};
|
const response: IKnifeResponse = {};
|
||||||
for (const upgrade of body.knife!.AttachedUpgrades) {
|
if (result1 == GUESS_CORRECT || result2 == GUESS_CORRECT || result3 == GUESS_CORRECT) {
|
||||||
switch (upgrade.ItemType) {
|
let antivirusGain = 5;
|
||||||
case "/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusAndSpeedOnUseMod":
|
const loadout = (await Loadout.findById(inventory.LoadOutPresets, "DATAKNIFE"))!;
|
||||||
antivirusGain += 10;
|
const dataknifeLoadout = loadout.DATAKNIFE.id(inventory.CurrentLoadOutIds[LoadoutIndex.DATAKNIFE].$oid);
|
||||||
consumeModCharge(response, inventory, upgrade, dataknifeUpgrades);
|
const dataknifeConfigIndex = dataknifeLoadout?.s?.mod ?? 0;
|
||||||
break;
|
const dataknifeUpgrades = inventory.DataKnives[0].Configs[dataknifeConfigIndex].Upgrades!;
|
||||||
case "/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusAndWeaponDamageOnUseMod":
|
for (const upgrade of body.knife!.AttachedUpgrades) {
|
||||||
antivirusGain += 10;
|
switch (upgrade.ItemType) {
|
||||||
consumeModCharge(response, inventory, upgrade, dataknifeUpgrades);
|
case "/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusAndSpeedOnUseMod":
|
||||||
break;
|
antivirusGain += 10;
|
||||||
case "/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusLargeOnSingleUseMod": // Instant Secure
|
consumeModCharge(response, inventory, upgrade, dataknifeUpgrades);
|
||||||
antivirusGain += 15;
|
break;
|
||||||
consumeModCharge(response, inventory, upgrade, dataknifeUpgrades);
|
case "/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusAndWeaponDamageOnUseMod":
|
||||||
break;
|
antivirusGain += 10;
|
||||||
case "/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusOnUseMod": // Immuno Shield
|
consumeModCharge(response, inventory, upgrade, dataknifeUpgrades);
|
||||||
antivirusGain += 15;
|
break;
|
||||||
consumeModCharge(response, inventory, upgrade, dataknifeUpgrades);
|
case "/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusLargeOnSingleUseMod": // Instant Secure
|
||||||
break;
|
antivirusGain += 15;
|
||||||
case "/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusSmallOnSingleUseMod":
|
consumeModCharge(response, inventory, upgrade, dataknifeUpgrades);
|
||||||
antivirusGain += 10;
|
break;
|
||||||
consumeModCharge(response, inventory, upgrade, dataknifeUpgrades);
|
case "/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusOnUseMod": // Immuno Shield
|
||||||
break;
|
antivirusGain += 15;
|
||||||
|
consumeModCharge(response, inventory, upgrade, dataknifeUpgrades);
|
||||||
|
break;
|
||||||
|
case "/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusSmallOnSingleUseMod":
|
||||||
|
antivirusGain += 10;
|
||||||
|
consumeModCharge(response, inventory, upgrade, dataknifeUpgrades);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
inventory.Nemesis!.HenchmenKilled += antivirusGain;
|
||||||
}
|
}
|
||||||
inventory.Nemesis!.HenchmenKilled += antivirusGain;
|
|
||||||
if (inventory.Nemesis!.HenchmenKilled >= 100) {
|
if (inventory.Nemesis!.HenchmenKilled >= 100) {
|
||||||
inventory.Nemesis!.HenchmenKilled = 100;
|
inventory.Nemesis!.HenchmenKilled = 100;
|
||||||
inventory.Nemesis!.InfNodes = [
|
|
||||||
{
|
|
||||||
Node: "CrewBattleNode559",
|
|
||||||
Influence: 1
|
|
||||||
}
|
|
||||||
];
|
|
||||||
inventory.Nemesis!.Weakened = true;
|
|
||||||
} else {
|
|
||||||
inventory.Nemesis!.InfNodes = getInfNodes("FC_INFESTATION", 0);
|
|
||||||
}
|
}
|
||||||
|
inventory.Nemesis!.InfNodes = getInfNodes(getNemesisManifest(inventory.Nemesis!.manifest), 0);
|
||||||
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.json(response);
|
res.json(response);
|
||||||
} else {
|
} else {
|
||||||
const passcode = getNemesisPasscode(inventory.Nemesis!);
|
// For first guess, create a new entry.
|
||||||
if (passcode[body.position] != body.guess) {
|
if (body.position == 0) {
|
||||||
res.end();
|
inventory.Nemesis!.GuessHistory.push(
|
||||||
} else {
|
encodeNemesisGuess([
|
||||||
inventory.Nemesis!.Rank += 1;
|
{
|
||||||
inventory.Nemesis!.InfNodes = getInfNodes(inventory.Nemesis!.Faction, inventory.Nemesis!.Rank);
|
symbol: GUESS_NONE,
|
||||||
await inventory.save();
|
result: GUESS_NEUTRAL
|
||||||
res.json({ RankIncrease: 1 });
|
},
|
||||||
|
{
|
||||||
|
symbol: GUESS_NONE,
|
||||||
|
result: GUESS_NEUTRAL
|
||||||
|
},
|
||||||
|
{
|
||||||
|
symbol: GUESS_NONE,
|
||||||
|
result: GUESS_NEUTRAL
|
||||||
|
}
|
||||||
|
])
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Evaluate guess
|
||||||
|
const correct =
|
||||||
|
body.guess == GUESS_WILDCARD || getNemesisPasscode(inventory.Nemesis!)[body.position] == body.guess;
|
||||||
|
|
||||||
|
// Update entry
|
||||||
|
const guess = decodeNemesisGuess(
|
||||||
|
inventory.Nemesis!.GuessHistory[inventory.Nemesis!.GuessHistory.length - 1]
|
||||||
|
);
|
||||||
|
guess[body.position].symbol = body.guess;
|
||||||
|
guess[body.position].result = correct ? GUESS_CORRECT : GUESS_INCORRECT;
|
||||||
|
inventory.Nemesis!.GuessHistory[inventory.Nemesis!.GuessHistory.length - 1] = encodeNemesisGuess(guess);
|
||||||
|
|
||||||
|
// Increase rank if incorrect
|
||||||
|
let RankIncrease: number | undefined;
|
||||||
|
if (!correct) {
|
||||||
|
RankIncrease = 1;
|
||||||
|
const manifest = getNemesisManifest(inventory.Nemesis!.manifest);
|
||||||
|
inventory.Nemesis!.Rank = Math.min(inventory.Nemesis!.Rank + 1, manifest.systemIndexes.length - 1);
|
||||||
|
inventory.Nemesis!.InfNodes = getInfNodes(manifest, inventory.Nemesis!.Rank);
|
||||||
|
}
|
||||||
|
await inventory.save();
|
||||||
|
res.json({ RankIncrease });
|
||||||
}
|
}
|
||||||
} else if ((req.query.mode as string) == "rs") {
|
} else if ((req.query.mode as string) == "rs") {
|
||||||
// report spawn; POST but no application data in body
|
// report spawn; POST but no application data in body
|
||||||
const inventory = await getInventory(accountId, "Nemesis");
|
const inventory = await getInventory(account._id.toString(), "Nemesis");
|
||||||
inventory.Nemesis!.LastEnc = inventory.Nemesis!.MissionCount;
|
inventory.Nemesis!.LastEnc = inventory.Nemesis!.MissionCount;
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.json({ LastEnc: inventory.Nemesis!.LastEnc });
|
res.json({ LastEnc: inventory.Nemesis!.LastEnc });
|
||||||
} else if ((req.query.mode as string) == "s") {
|
} else if ((req.query.mode as string) == "s") {
|
||||||
const inventory = await getInventory(accountId, "Nemesis");
|
const inventory = await getInventory(account._id.toString(), "Nemesis");
|
||||||
|
if (inventory.Nemesis) {
|
||||||
|
logger.warn(`overwriting an existing nemesis as a new one is being requested`);
|
||||||
|
}
|
||||||
const body = getJSONfromString<INemesisStartRequest>(String(req.body));
|
const body = getJSONfromString<INemesisStartRequest>(String(req.body));
|
||||||
body.target.fp = BigInt(body.target.fp);
|
body.target.fp = BigInt(body.target.fp);
|
||||||
|
|
||||||
|
const manifest = getNemesisManifest(body.target.manifest);
|
||||||
|
if (account.BuildLabel && version_compare(account.BuildLabel, manifest.minBuild) < 0) {
|
||||||
|
logger.warn(
|
||||||
|
`client on version ${account.BuildLabel} provided nemesis manifest ${body.target.manifest} which was expected to require ${manifest.minBuild} or above. please file a bug report.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
let weaponIdx = -1;
|
let weaponIdx = -1;
|
||||||
if (body.target.Faction != "FC_INFESTATION") {
|
if (body.target.Faction != "FC_INFESTATION") {
|
||||||
let weapons: readonly string[];
|
const weapons: readonly string[] = manifest.weapons;
|
||||||
if (body.target.manifest == "/Lotus/Types/Game/Nemesis/KuvaLich/KuvaLichManifestVersionSix") {
|
|
||||||
weapons = kuvaLichVersionSixWeapons;
|
|
||||||
} else if (
|
|
||||||
body.target.manifest == "/Lotus/Types/Enemies/Corpus/Lawyers/LawyerManifestVersionFour" ||
|
|
||||||
body.target.manifest == "/Lotus/Types/Enemies/Corpus/Lawyers/LawyerManifestVersionThree"
|
|
||||||
) {
|
|
||||||
weapons = corpusVersionThreeWeapons;
|
|
||||||
} else {
|
|
||||||
throw new Error(`unknown nemesis manifest: ${body.target.manifest}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const initialWeaponIdx = new SRng(body.target.fp).randomInt(0, weapons.length - 1);
|
const initialWeaponIdx = new SRng(body.target.fp).randomInt(0, weapons.length - 1);
|
||||||
weaponIdx = initialWeaponIdx;
|
weaponIdx = initialWeaponIdx;
|
||||||
do {
|
if (body.target.DisallowedWeapons) {
|
||||||
const weapon = weapons[weaponIdx];
|
do {
|
||||||
if (!body.target.DisallowedWeapons.find(x => x == weapon)) {
|
const weapon = weapons[weaponIdx];
|
||||||
break;
|
if (body.target.DisallowedWeapons.indexOf(weapon) == -1) {
|
||||||
}
|
break;
|
||||||
weaponIdx = (weaponIdx + 1) % weapons.length;
|
}
|
||||||
} while (weaponIdx != initialWeaponIdx);
|
weaponIdx = (weaponIdx + 1) % weapons.length;
|
||||||
|
} while (weaponIdx != initialWeaponIdx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inventory.Nemesis = {
|
inventory.Nemesis = {
|
||||||
@ -207,14 +260,14 @@ export const nemesisController: RequestHandler = async (req, res) => {
|
|||||||
k: false,
|
k: false,
|
||||||
Traded: false,
|
Traded: false,
|
||||||
d: new Date(),
|
d: new Date(),
|
||||||
InfNodes: getInfNodes(body.target.Faction, 0),
|
InfNodes: getInfNodes(manifest, 0),
|
||||||
GuessHistory: [],
|
GuessHistory: [],
|
||||||
Hints: [],
|
Hints: [],
|
||||||
HintProgress: 0,
|
HintProgress: 0,
|
||||||
Weakened: body.target.Weakened,
|
Weakened: false,
|
||||||
PrevOwners: 0,
|
PrevOwners: 0,
|
||||||
HenchmenKilled: 0,
|
HenchmenKilled: 0,
|
||||||
SecondInCommand: body.target.SecondInCommand,
|
SecondInCommand: false,
|
||||||
MissionCount: 0,
|
MissionCount: 0,
|
||||||
LastEnc: 0
|
LastEnc: 0
|
||||||
};
|
};
|
||||||
@ -223,6 +276,38 @@ export const nemesisController: RequestHandler = async (req, res) => {
|
|||||||
res.json({
|
res.json({
|
||||||
target: inventory.toJSON().Nemesis
|
target: inventory.toJSON().Nemesis
|
||||||
});
|
});
|
||||||
|
} else if ((req.query.mode as string) == "w") {
|
||||||
|
const inventory = await getInventory(
|
||||||
|
account._id.toString(),
|
||||||
|
"Nemesis LoadOutPresets CurrentLoadOutIds DataKnives Upgrades RawUpgrades"
|
||||||
|
);
|
||||||
|
//const body = getJSONfromString<INemesisWeakenRequest>(String(req.body));
|
||||||
|
|
||||||
|
inventory.Nemesis!.InfNodes = [
|
||||||
|
{
|
||||||
|
Node: getNemesisManifest(inventory.Nemesis!.manifest).showdownNode,
|
||||||
|
Influence: 1
|
||||||
|
}
|
||||||
|
];
|
||||||
|
inventory.Nemesis!.Weakened = true;
|
||||||
|
|
||||||
|
const response: IKnifeResponse & { target: INemesisClient } = {
|
||||||
|
target: inventory.toJSON<IInventoryClient>().Nemesis!
|
||||||
|
};
|
||||||
|
|
||||||
|
// Consume charge of the correct requiem mod(s)
|
||||||
|
const loadout = (await Loadout.findById(inventory.LoadOutPresets, "DATAKNIFE"))!;
|
||||||
|
const dataknifeLoadout = loadout.DATAKNIFE.id(inventory.CurrentLoadOutIds[LoadoutIndex.DATAKNIFE].$oid);
|
||||||
|
const dataknifeConfigIndex = dataknifeLoadout?.s?.mod ?? 0;
|
||||||
|
const dataknifeUpgrades = inventory.DataKnives[0].Configs[dataknifeConfigIndex].Upgrades!;
|
||||||
|
const modTypes = getNemesisPasscodeModTypes(inventory.Nemesis!);
|
||||||
|
for (const modType of modTypes) {
|
||||||
|
const upgrade = getKnifeUpgrade(inventory, dataknifeUpgrades, modType);
|
||||||
|
consumeModCharge(response, inventory, upgrade, dataknifeUpgrades);
|
||||||
|
}
|
||||||
|
|
||||||
|
await inventory.save();
|
||||||
|
res.json(response);
|
||||||
} else {
|
} else {
|
||||||
logger.debug(`data provided to ${req.path}: ${String(req.body)}`);
|
logger.debug(`data provided to ${req.path}: ${String(req.body)}`);
|
||||||
throw new Error(`unknown nemesis mode: ${String(req.query.mode)}`);
|
throw new Error(`unknown nemesis mode: ${String(req.query.mode)}`);
|
||||||
@ -243,11 +328,11 @@ interface INemesisStartRequest {
|
|||||||
KillingSuit: string;
|
KillingSuit: string;
|
||||||
killingDamageType: number;
|
killingDamageType: number;
|
||||||
ShoulderHelmet: string;
|
ShoulderHelmet: string;
|
||||||
DisallowedWeapons: string[];
|
DisallowedWeapons?: string[];
|
||||||
WeaponIdx: number;
|
WeaponIdx: number;
|
||||||
AgentIdx: number;
|
AgentIdx: number;
|
||||||
BirthNode: string;
|
BirthNode: string;
|
||||||
Faction: string;
|
Faction: TNemesisFaction;
|
||||||
Rank: number;
|
Rank: number;
|
||||||
k: boolean;
|
k: boolean;
|
||||||
Traded: boolean;
|
Traded: boolean;
|
||||||
@ -274,48 +359,19 @@ interface INemesisRequiemRequest {
|
|||||||
guess: number; // grn/crp: 4 bits | coda: 3x 4 bits
|
guess: number; // grn/crp: 4 bits | coda: 3x 4 bits
|
||||||
position: number; // grn/crp: 0-2 | coda: 0
|
position: number; // grn/crp: 0-2 | coda: 0
|
||||||
// knife field provided for coda only
|
// knife field provided for coda only
|
||||||
knife?: {
|
knife?: IKnife;
|
||||||
Item: IEquipmentClient;
|
|
||||||
Skins: IWeaponSkinClient[];
|
|
||||||
ModSlot: number;
|
|
||||||
CustSlot: number;
|
|
||||||
AttachedUpgrades: IUpgradeClient[];
|
|
||||||
HiddenWhenHolstered: boolean;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const kuvaLichVersionSixWeapons = [
|
// interface INemesisWeakenRequest {
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Drakgoon/KuvaDrakgoon",
|
// target: INemesisClient;
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Karak/KuvaKarak",
|
// knife: IKnife;
|
||||||
"/Lotus/Weapons/Grineer/Melee/GrnKuvaLichScythe/GrnKuvaLichScytheWeapon",
|
// }
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Kohm/KuvaKohm",
|
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Ogris/KuvaOgris",
|
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Quartakk/KuvaQuartakk",
|
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Tonkor/KuvaTonkor",
|
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/Secondaries/Brakk/KuvaBrakk",
|
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/Secondaries/Kraken/KuvaKraken",
|
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/Secondaries/Seer/KuvaSeer",
|
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/Secondaries/Stubba/KuvaStubba",
|
|
||||||
"/Lotus/Weapons/Grineer/HeavyWeapons/GrnHeavyGrenadeLauncher",
|
|
||||||
"/Lotus/Weapons/Grineer/LongGuns/GrnKuvaLichRifle/GrnKuvaLichRifleWeapon",
|
|
||||||
"/Lotus/Weapons/Grineer/Bows/GrnBow/GrnBowWeapon",
|
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Hind/KuvaHind",
|
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/Secondaries/Nukor/KuvaNukor",
|
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Hek/KuvaHekWeapon",
|
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Zarr/KuvaZarr",
|
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/HeavyWeapons/Grattler/KuvaGrattler",
|
|
||||||
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Sobek/KuvaSobek"
|
|
||||||
];
|
|
||||||
|
|
||||||
const corpusVersionThreeWeapons = [
|
interface IKnife {
|
||||||
"/Lotus/Weapons/Corpus/LongGuns/CrpBriefcaseLauncher/CrpBriefcaseLauncher",
|
Item: IEquipmentClient;
|
||||||
"/Lotus/Weapons/Corpus/BoardExec/Primary/CrpBEArcaPlasmor/CrpBEArcaPlasmor",
|
Skins: IWeaponSkinClient[];
|
||||||
"/Lotus/Weapons/Corpus/BoardExec/Primary/CrpBEFluxRifle/CrpBEFluxRifle",
|
ModSlot: number;
|
||||||
"/Lotus/Weapons/Corpus/BoardExec/Primary/CrpBETetra/CrpBETetra",
|
CustSlot: number;
|
||||||
"/Lotus/Weapons/Corpus/BoardExec/Secondary/CrpBECycron/CrpBECycron",
|
AttachedUpgrades: IUpgradeClient[];
|
||||||
"/Lotus/Weapons/Corpus/BoardExec/Secondary/CrpBEDetron/CrpBEDetron",
|
HiddenWhenHolstered: boolean;
|
||||||
"/Lotus/Weapons/Corpus/Pistols/CrpIgniterPistol/CrpIgniterPistol",
|
}
|
||||||
"/Lotus/Weapons/Corpus/Pistols/CrpBriefcaseAkimbo/CrpBriefcaseAkimboPistol",
|
|
||||||
"/Lotus/Weapons/Corpus/BoardExec/Secondary/CrpBEPlinx/CrpBEPlinxWeapon",
|
|
||||||
"/Lotus/Weapons/Corpus/BoardExec/Primary/CrpBEGlaxion/CrpBEGlaxion"
|
|
||||||
];
|
|
||||||
|
@ -37,6 +37,7 @@ export const placeDecoInComponentController: RequestHandler = async (req, res) =
|
|||||||
const deco = component.Decos.find(x => x._id.equals(request.MoveId))!;
|
const deco = component.Decos.find(x => x._id.equals(request.MoveId))!;
|
||||||
deco.Pos = request.Pos;
|
deco.Pos = request.Pos;
|
||||||
deco.Rot = request.Rot;
|
deco.Rot = request.Rot;
|
||||||
|
deco.Scale = request.Scale;
|
||||||
} else {
|
} else {
|
||||||
const deco =
|
const deco =
|
||||||
component.Decos[
|
component.Decos[
|
||||||
@ -45,6 +46,7 @@ export const placeDecoInComponentController: RequestHandler = async (req, res) =
|
|||||||
Type: request.Type,
|
Type: request.Type,
|
||||||
Pos: request.Pos,
|
Pos: request.Pos,
|
||||||
Rot: request.Rot,
|
Rot: request.Rot,
|
||||||
|
Scale: request.Scale,
|
||||||
Name: request.Name,
|
Name: request.Name,
|
||||||
Sockets: request.Sockets
|
Sockets: request.Sockets
|
||||||
}) - 1
|
}) - 1
|
||||||
@ -113,9 +115,9 @@ interface IPlaceDecoInComponentRequest {
|
|||||||
Type: string;
|
Type: string;
|
||||||
Pos: number[];
|
Pos: number[];
|
||||||
Rot: number[];
|
Rot: number[];
|
||||||
|
Scale?: number;
|
||||||
Name?: string;
|
Name?: string;
|
||||||
Sockets?: number;
|
Sockets?: number;
|
||||||
Scale?: number; // only provided alongside MoveId and seems to always be 1
|
|
||||||
MoveId?: string;
|
MoveId?: string;
|
||||||
ShipDeco?: boolean;
|
ShipDeco?: boolean;
|
||||||
VaultDeco?: boolean;
|
VaultDeco?: boolean;
|
||||||
|
@ -2,13 +2,16 @@ import { RequestHandler } from "express";
|
|||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { addMiscItems, getInventory } from "@/src/services/inventoryService";
|
import { addMiscItems, getInventory } from "@/src/services/inventoryService";
|
||||||
import { ExportRelics, IRelic } from "warframe-public-export-plus";
|
import { ExportRelics, IRelic } from "warframe-public-export-plus";
|
||||||
|
import { config } from "@/src/services/configService";
|
||||||
|
|
||||||
export const projectionManagerController: RequestHandler = async (req, res) => {
|
export const projectionManagerController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(accountId);
|
||||||
const request = JSON.parse(String(req.body)) as IProjectionUpgradeRequest;
|
const request = JSON.parse(String(req.body)) as IProjectionUpgradeRequest;
|
||||||
const [era, category, currentQuality] = parseProjection(request.projectionType);
|
const [era, category, currentQuality] = parseProjection(request.projectionType);
|
||||||
const upgradeCost = (request.qualityTag - qualityKeywordToNumber[currentQuality]) * 25;
|
const upgradeCost = config.dontSubtractVoidTraces
|
||||||
|
? 0
|
||||||
|
: (request.qualityTag - qualityKeywordToNumber[currentQuality]) * 25;
|
||||||
const newProjectionType = findProjection(era, category, qualityNumberToKeyword[request.qualityTag]);
|
const newProjectionType = findProjection(era, category, qualityNumberToKeyword[request.qualityTag]);
|
||||||
addMiscItems(inventory, [
|
addMiscItems(inventory, [
|
||||||
{
|
{
|
||||||
|
25
src/controllers/api/questControlController.ts
Normal file
25
src/controllers/api/questControlController.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
|
// Basic shim handling action=sync to login on U21
|
||||||
|
export const questControlController: RequestHandler = async (req, res) => {
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
const inventory = await getInventory(accountId);
|
||||||
|
const quests: IQuestState[] = [];
|
||||||
|
for (const quest of inventory.QuestKeys) {
|
||||||
|
quests.push({
|
||||||
|
quest: quest.ItemType,
|
||||||
|
state: 3 // COMPLETE
|
||||||
|
});
|
||||||
|
}
|
||||||
|
res.json({
|
||||||
|
QuestState: quests
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
interface IQuestState {
|
||||||
|
quest: string;
|
||||||
|
state: number;
|
||||||
|
task?: string;
|
||||||
|
}
|
99
src/controllers/api/removeFriendController.ts
Normal file
99
src/controllers/api/removeFriendController.ts
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
import { toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
|
import { Friendship } from "@/src/models/friendModel";
|
||||||
|
import { Account } from "@/src/models/loginModel";
|
||||||
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { IOid } from "@/src/types/commonTypes";
|
||||||
|
import { parallelForeach } from "@/src/utils/async-utils";
|
||||||
|
import { RequestHandler } from "express";
|
||||||
|
import { Types } from "mongoose";
|
||||||
|
|
||||||
|
export const removeFriendGetController: RequestHandler = async (req, res) => {
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
if (req.query.all) {
|
||||||
|
const [internalFriendships, externalFriendships] = await Promise.all([
|
||||||
|
Friendship.find({ owner: accountId }, "friend"),
|
||||||
|
Friendship.find({ friend: accountId }, "owner")
|
||||||
|
]);
|
||||||
|
const promises: Promise<void>[] = [];
|
||||||
|
const friends: IOid[] = [];
|
||||||
|
for (const externalFriendship of externalFriendships) {
|
||||||
|
if (!internalFriendships.find(x => x.friend.equals(externalFriendship.owner))) {
|
||||||
|
promises.push(Friendship.deleteOne({ _id: externalFriendship._id }) as unknown as Promise<void>);
|
||||||
|
friends.push(toOid(externalFriendship.owner));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await Promise.all(promises);
|
||||||
|
res.json({
|
||||||
|
Friends: friends
|
||||||
|
} satisfies IRemoveFriendsResponse);
|
||||||
|
} else {
|
||||||
|
const friendId = req.query.friendId as string;
|
||||||
|
await Promise.all([
|
||||||
|
Friendship.deleteOne({ owner: accountId, friend: friendId }),
|
||||||
|
Friendship.deleteOne({ owner: friendId, friend: accountId })
|
||||||
|
]);
|
||||||
|
res.json({
|
||||||
|
Friends: [{ $oid: friendId }]
|
||||||
|
} satisfies IRemoveFriendsResponse);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const removeFriendPostController: RequestHandler = async (req, res) => {
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
const data = getJSONfromString<IBatchRemoveFriendsRequest>(String(req.body));
|
||||||
|
const friends = new Set((await Friendship.find({ owner: accountId }, "friend")).map(x => x.friend));
|
||||||
|
// TOVERIFY: Should pending friendships also be kept?
|
||||||
|
|
||||||
|
// Keep friends that have been online within threshold
|
||||||
|
await parallelForeach([...friends], async friend => {
|
||||||
|
const account = (await Account.findById(friend, "LastLogin"))!;
|
||||||
|
const daysLoggedOut = (Date.now() - account.LastLogin.getTime()) / 86400_000;
|
||||||
|
if (daysLoggedOut < data.DaysLoggedOut) {
|
||||||
|
friends.delete(friend);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (data.SkipClanmates) {
|
||||||
|
const inventory = await getInventory(accountId, "GuildId");
|
||||||
|
if (inventory.GuildId) {
|
||||||
|
await parallelForeach([...friends], async friend => {
|
||||||
|
const friendInventory = await getInventory(friend.toString(), "GuildId");
|
||||||
|
if (friendInventory.GuildId?.equals(inventory.GuildId)) {
|
||||||
|
friends.delete(friend);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove all remaining friends that aren't in SkipFriendIds & give response.
|
||||||
|
const promises = [];
|
||||||
|
const response: IOid[] = [];
|
||||||
|
for (const friend of friends) {
|
||||||
|
if (!data.SkipFriendIds.find(skipFriendId => checkFriendId(skipFriendId, friend))) {
|
||||||
|
promises.push(Friendship.deleteOne({ owner: accountId, friend: friend }));
|
||||||
|
promises.push(Friendship.deleteOne({ owner: friend, friend: accountId }));
|
||||||
|
response.push(toOid(friend));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await Promise.all(promises);
|
||||||
|
res.json({
|
||||||
|
Friends: response
|
||||||
|
} satisfies IRemoveFriendsResponse);
|
||||||
|
};
|
||||||
|
|
||||||
|
// The friend ids format is a bit weird, e.g. when 6633b81e9dba0b714f28ff02 (A) is friends with 67cdac105ef1f4b49741c267 (B), A's friend id for B is 808000105ef1f40560ca079e and B's friend id for A is 8000b81e9dba0b06408a8075.
|
||||||
|
const checkFriendId = (friendId: string, b: Types.ObjectId): boolean => {
|
||||||
|
return friendId.substring(6, 6 + 8) == b.toString().substring(6, 6 + 8);
|
||||||
|
};
|
||||||
|
|
||||||
|
interface IBatchRemoveFriendsRequest {
|
||||||
|
DaysLoggedOut: number;
|
||||||
|
SkipClanmates: boolean;
|
||||||
|
SkipFriendIds: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IRemoveFriendsResponse {
|
||||||
|
Friends: IOid[];
|
||||||
|
}
|
23
src/controllers/api/renamePetController.ts
Normal file
23
src/controllers/api/renamePetController.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
|
import { getInventory, updateCurrency } from "@/src/services/inventoryService";
|
||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
|
export const renamePetController: RequestHandler = async (req, res) => {
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
const inventory = await getInventory(accountId, "KubrowPets PremiumCredits PremiumCreditsFree");
|
||||||
|
const data = getJSONfromString<IRenamePetRequest>(String(req.body));
|
||||||
|
const details = inventory.KubrowPets.id(data.petId)!.Details!;
|
||||||
|
details.Name = data.name;
|
||||||
|
const currencyChanges = updateCurrency(inventory, 15, true);
|
||||||
|
await inventory.save();
|
||||||
|
res.json({
|
||||||
|
...data,
|
||||||
|
inventoryChanges: currencyChanges
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
interface IRenamePetRequest {
|
||||||
|
petId: string;
|
||||||
|
name: string;
|
||||||
|
}
|
@ -1,10 +1,8 @@
|
|||||||
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
|
||||||
import { config } from "@/src/services/configService";
|
import { config } from "@/src/services/configService";
|
||||||
import { addEmailItem, getInventory, updateCurrency } from "@/src/services/inventoryService";
|
import { addEmailItem, getDialogue, getInventory, updateCurrency } from "@/src/services/inventoryService";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { ICompletedDialogue, IDialogueDatabase } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { ICompletedDialogue } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
import { logger } from "@/src/utils/logger";
|
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
export const saveDialogueController: RequestHandler = async (req, res) => {
|
export const saveDialogueController: RequestHandler = async (req, res) => {
|
||||||
@ -26,34 +24,34 @@ export const saveDialogueController: RequestHandler = async (req, res) => {
|
|||||||
inventory.DialogueHistory.Dialogues ??= [];
|
inventory.DialogueHistory.Dialogues ??= [];
|
||||||
const dialogue = getDialogue(inventory, request.DialogueName);
|
const dialogue = getDialogue(inventory, request.DialogueName);
|
||||||
dialogue.Rank = request.Rank;
|
dialogue.Rank = request.Rank;
|
||||||
dialogue.Chemistry = request.Chemistry;
|
dialogue.Chemistry += request.Chemistry;
|
||||||
|
dialogue.QueuedDialogues = request.QueuedDialogues;
|
||||||
|
for (const bool of request.Booleans) {
|
||||||
|
dialogue.Booleans.push(bool);
|
||||||
|
if (bool == "LizzieShawzin") {
|
||||||
|
await addEmailItem(
|
||||||
|
inventory,
|
||||||
|
"/Lotus/Types/Items/EmailItems/LizzieShawzinSkinEmailItem",
|
||||||
|
inventoryChanges
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const bool of request.ResetBooleans) {
|
||||||
|
const index = dialogue.Booleans.findIndex(x => x == bool);
|
||||||
|
if (index != -1) {
|
||||||
|
dialogue.Booleans.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const info of request.OtherDialogueInfos) {
|
||||||
|
const otherDialogue = getDialogue(inventory, info.Dialogue);
|
||||||
|
if (info.Tag != "") {
|
||||||
|
otherDialogue.QueuedDialogues.push(info.Tag);
|
||||||
|
}
|
||||||
|
otherDialogue.Chemistry += info.Value; // unsure
|
||||||
|
}
|
||||||
if (request.Data) {
|
if (request.Data) {
|
||||||
dialogue.QueuedDialogues = request.QueuedDialogues;
|
|
||||||
for (const bool of request.Booleans) {
|
|
||||||
dialogue.Booleans.push(bool);
|
|
||||||
if (bool == "LizzieShawzin") {
|
|
||||||
await addEmailItem(
|
|
||||||
inventory,
|
|
||||||
"/Lotus/Types/Items/EmailItems/LizzieShawzinSkinEmailItem",
|
|
||||||
inventoryChanges
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (const bool of request.ResetBooleans) {
|
|
||||||
const index = dialogue.Booleans.findIndex(x => x == bool);
|
|
||||||
if (index != -1) {
|
|
||||||
dialogue.Booleans.splice(index, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dialogue.Completed.push(request.Data);
|
dialogue.Completed.push(request.Data);
|
||||||
dialogue.AvailableDate = new Date(tomorrowAt0Utc);
|
dialogue.AvailableDate = new Date(tomorrowAt0Utc);
|
||||||
for (const info of request.OtherDialogueInfos) {
|
|
||||||
const otherDialogue = getDialogue(inventory, info.Dialogue);
|
|
||||||
if (info.Tag != "") {
|
|
||||||
otherDialogue.QueuedDialogues.push(info.Tag);
|
|
||||||
}
|
|
||||||
otherDialogue.Chemistry += info.Value; // unsure
|
|
||||||
}
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.json({
|
res.json({
|
||||||
InventoryChanges: inventoryChanges,
|
InventoryChanges: inventoryChanges,
|
||||||
@ -74,7 +72,7 @@ export const saveDialogueController: RequestHandler = async (req, res) => {
|
|||||||
AvailableGiftDate: { $date: { $numberLong: tomorrowAt0Utc.toString() } }
|
AvailableGiftDate: { $date: { $numberLong: tomorrowAt0Utc.toString() } }
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
logger.error(`saveDialogue request not fully handled: ${String(req.body)}`);
|
res.end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -108,26 +106,3 @@ interface IOtherDialogueInfo {
|
|||||||
Tag: string;
|
Tag: string;
|
||||||
Value: number;
|
Value: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getDialogue = (inventory: TInventoryDatabaseDocument, dialogueName: string): IDialogueDatabase => {
|
|
||||||
let dialogue = inventory.DialogueHistory!.Dialogues!.find(x => x.DialogueName == dialogueName);
|
|
||||||
if (!dialogue) {
|
|
||||||
dialogue =
|
|
||||||
inventory.DialogueHistory!.Dialogues![
|
|
||||||
inventory.DialogueHistory!.Dialogues!.push({
|
|
||||||
Rank: 0,
|
|
||||||
Chemistry: 0,
|
|
||||||
AvailableDate: new Date(0),
|
|
||||||
AvailableGiftDate: new Date(0),
|
|
||||||
RankUpExpiry: new Date(0),
|
|
||||||
BountyChemExpiry: new Date(0),
|
|
||||||
QueuedDialogues: [],
|
|
||||||
Gifts: [],
|
|
||||||
Booleans: [],
|
|
||||||
Completed: [],
|
|
||||||
DialogueName: dialogueName
|
|
||||||
}) - 1
|
|
||||||
];
|
|
||||||
}
|
|
||||||
return dialogue;
|
|
||||||
};
|
|
||||||
|
@ -2,11 +2,12 @@ import { RequestHandler } from "express";
|
|||||||
import { ISaveLoadoutRequest } from "@/src/types/saveLoadoutTypes";
|
import { ISaveLoadoutRequest } from "@/src/types/saveLoadoutTypes";
|
||||||
import { handleInventoryItemConfigChange } from "@/src/services/saveLoadoutService";
|
import { handleInventoryItemConfigChange } from "@/src/services/saveLoadoutService";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
|
|
||||||
export const saveLoadoutController: RequestHandler = async (req, res) => {
|
export const saveLoadoutController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
|
||||||
const body: ISaveLoadoutRequest = JSON.parse(req.body as string) as ISaveLoadoutRequest;
|
const body: ISaveLoadoutRequest = getJSONfromString<ISaveLoadoutRequest>(String(req.body));
|
||||||
// console.log(util.inspect(body, { showHidden: false, depth: null, colors: true }));
|
// console.log(util.inspect(body, { showHidden: false, depth: null, colors: true }));
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
@ -8,7 +8,8 @@ import {
|
|||||||
addConsumables,
|
addConsumables,
|
||||||
freeUpSlot,
|
freeUpSlot,
|
||||||
combineInventoryChanges,
|
combineInventoryChanges,
|
||||||
addCrewShipRawSalvage
|
addCrewShipRawSalvage,
|
||||||
|
addFusionPoints
|
||||||
} from "@/src/services/inventoryService";
|
} from "@/src/services/inventoryService";
|
||||||
import { InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { ExportDojoRecipes } from "warframe-public-export-plus";
|
import { ExportDojoRecipes } from "warframe-public-export-plus";
|
||||||
@ -44,7 +45,10 @@ export const sellController: RequestHandler = async (req, res) => {
|
|||||||
if (payload.Items.SpaceGuns || payload.Items.SpaceMelee) {
|
if (payload.Items.SpaceGuns || payload.Items.SpaceMelee) {
|
||||||
requiredFields.add(InventorySlot.SPACEWEAPONS);
|
requiredFields.add(InventorySlot.SPACEWEAPONS);
|
||||||
}
|
}
|
||||||
if (payload.Items.Sentinels || payload.Items.SentinelWeapons) {
|
if (payload.Items.MechSuits) {
|
||||||
|
requiredFields.add(InventorySlot.MECHSUITS);
|
||||||
|
}
|
||||||
|
if (payload.Items.Sentinels || payload.Items.SentinelWeapons || payload.Items.MoaPets) {
|
||||||
requiredFields.add(InventorySlot.SENTINELS);
|
requiredFields.add(InventorySlot.SENTINELS);
|
||||||
}
|
}
|
||||||
if (payload.Items.OperatorAmps) {
|
if (payload.Items.OperatorAmps) {
|
||||||
@ -69,7 +73,7 @@ export const sellController: RequestHandler = async (req, res) => {
|
|||||||
if (payload.SellCurrency == "SC_RegularCredits") {
|
if (payload.SellCurrency == "SC_RegularCredits") {
|
||||||
inventory.RegularCredits += payload.SellPrice;
|
inventory.RegularCredits += payload.SellPrice;
|
||||||
} else if (payload.SellCurrency == "SC_FusionPoints") {
|
} else if (payload.SellCurrency == "SC_FusionPoints") {
|
||||||
inventory.FusionPoints += payload.SellPrice;
|
addFusionPoints(inventory, payload.SellPrice);
|
||||||
} else if (payload.SellCurrency == "SC_PrimeBucks") {
|
} else if (payload.SellCurrency == "SC_PrimeBucks") {
|
||||||
addMiscItems(inventory, [
|
addMiscItems(inventory, [
|
||||||
{
|
{
|
||||||
@ -135,6 +139,12 @@ export const sellController: RequestHandler = async (req, res) => {
|
|||||||
freeUpSlot(inventory, InventorySlot.SPACEWEAPONS);
|
freeUpSlot(inventory, InventorySlot.SPACEWEAPONS);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (payload.Items.MechSuits) {
|
||||||
|
payload.Items.MechSuits.forEach(sellItem => {
|
||||||
|
inventory.MechSuits.pull({ _id: sellItem.String });
|
||||||
|
freeUpSlot(inventory, InventorySlot.MECHSUITS);
|
||||||
|
});
|
||||||
|
}
|
||||||
if (payload.Items.Sentinels) {
|
if (payload.Items.Sentinels) {
|
||||||
payload.Items.Sentinels.forEach(sellItem => {
|
payload.Items.Sentinels.forEach(sellItem => {
|
||||||
inventory.Sentinels.pull({ _id: sellItem.String });
|
inventory.Sentinels.pull({ _id: sellItem.String });
|
||||||
@ -147,6 +157,12 @@ export const sellController: RequestHandler = async (req, res) => {
|
|||||||
freeUpSlot(inventory, InventorySlot.SENTINELS);
|
freeUpSlot(inventory, InventorySlot.SENTINELS);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (payload.Items.MoaPets) {
|
||||||
|
payload.Items.MoaPets.forEach(sellItem => {
|
||||||
|
inventory.MoaPets.pull({ _id: sellItem.String });
|
||||||
|
freeUpSlot(inventory, InventorySlot.SENTINELS);
|
||||||
|
});
|
||||||
|
}
|
||||||
if (payload.Items.OperatorAmps) {
|
if (payload.Items.OperatorAmps) {
|
||||||
payload.Items.OperatorAmps.forEach(sellItem => {
|
payload.Items.OperatorAmps.forEach(sellItem => {
|
||||||
inventory.OperatorAmps.pull({ _id: sellItem.String });
|
inventory.OperatorAmps.pull({ _id: sellItem.String });
|
||||||
@ -278,8 +294,10 @@ interface ISellRequest {
|
|||||||
SpaceSuits?: ISellItem[];
|
SpaceSuits?: ISellItem[];
|
||||||
SpaceGuns?: ISellItem[];
|
SpaceGuns?: ISellItem[];
|
||||||
SpaceMelee?: ISellItem[];
|
SpaceMelee?: ISellItem[];
|
||||||
|
MechSuits?: ISellItem[];
|
||||||
Sentinels?: ISellItem[];
|
Sentinels?: ISellItem[];
|
||||||
SentinelWeapons?: ISellItem[];
|
SentinelWeapons?: ISellItem[];
|
||||||
|
MoaPets?: ISellItem[];
|
||||||
OperatorAmps?: ISellItem[];
|
OperatorAmps?: ISellItem[];
|
||||||
Hoverboards?: ISellItem[];
|
Hoverboards?: ISellItem[];
|
||||||
Drones?: ISellItem[];
|
Drones?: ISellItem[];
|
||||||
|
@ -13,7 +13,7 @@ export const setDojoComponentSettingsController: RequestHandler = async (req, re
|
|||||||
res.json({ DojoRequestStatus: -1 });
|
res.json({ DojoRequestStatus: -1 });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const component = guild.DojoComponents.id(req.query.componentId)!;
|
const component = guild.DojoComponents.id(req.query.componentId as string)!;
|
||||||
const data = getJSONfromString<ISetDojoComponentSettingsRequest>(String(req.body));
|
const data = getJSONfromString<ISetDojoComponentSettingsRequest>(String(req.body));
|
||||||
component.Settings = data.Settings;
|
component.Settings = data.Settings;
|
||||||
await guild.save();
|
await guild.save();
|
||||||
|
30
src/controllers/api/setFriendNoteController.ts
Normal file
30
src/controllers/api/setFriendNoteController.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
|
import { Friendship } from "@/src/models/friendModel";
|
||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
|
export const setFriendNoteController: RequestHandler = async (req, res) => {
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
const payload = getJSONfromString<ISetFriendNoteRequest>(String(req.body));
|
||||||
|
const friendship = await Friendship.findOne({ owner: accountId, friend: payload.FriendId }, "Note Favorite");
|
||||||
|
if (friendship) {
|
||||||
|
if ("Note" in payload) {
|
||||||
|
friendship.Note = payload.Note;
|
||||||
|
} else {
|
||||||
|
friendship.Favorite = payload.Favorite;
|
||||||
|
}
|
||||||
|
await friendship.save();
|
||||||
|
}
|
||||||
|
res.json({
|
||||||
|
Id: payload.FriendId,
|
||||||
|
SetNote: "Note" in payload,
|
||||||
|
Note: friendship?.Note,
|
||||||
|
Favorite: friendship?.Favorite
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
interface ISetFriendNoteRequest {
|
||||||
|
FriendId: string;
|
||||||
|
Note?: string;
|
||||||
|
Favorite?: boolean;
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
import { version_compare } from "@/src/helpers/inventoryHelpers";
|
||||||
import { Alliance, Guild, GuildMember } from "@/src/models/guildModel";
|
import { Alliance, Guild, GuildMember } from "@/src/models/guildModel";
|
||||||
import { hasGuildPermissionEx } from "@/src/services/guildService";
|
import { hasGuildPermissionEx } from "@/src/services/guildService";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
@ -55,5 +56,9 @@ export const setGuildMotdController: RequestHandler = async (req, res) => {
|
|||||||
await guild.save();
|
await guild.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
res.json({ IsLongMOTD, MOTD });
|
if (!account.BuildLabel || version_compare(account.BuildLabel, "2020.03.24.20.24") > 0) {
|
||||||
|
res.json({ IsLongMOTD, MOTD });
|
||||||
|
} else {
|
||||||
|
res.send(MOTD).end();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
@ -20,7 +20,7 @@ export const setShipFavouriteLoadoutController: RequestHandler = async (req, res
|
|||||||
throw new Error(`unexpected BootLocation: ${body.BootLocation}`);
|
throw new Error(`unexpected BootLocation: ${body.BootLocation}`);
|
||||||
}
|
}
|
||||||
await personalRooms.save();
|
await personalRooms.save();
|
||||||
res.json({});
|
res.json(body);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface ISetShipFavouriteLoadoutRequest {
|
interface ISetShipFavouriteLoadoutRequest {
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { ExportDojoRecipes } from "warframe-public-export-plus";
|
import { ExportDojoRecipes } from "warframe-public-export-plus";
|
||||||
import { config } from "@/src/services/configService";
|
import { config } from "@/src/services/configService";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountForRequest } from "@/src/services/loginService";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
|
|
||||||
interface IStartDojoRecipeRequest {
|
interface IStartDojoRecipeRequest {
|
||||||
@ -20,10 +20,10 @@ interface IStartDojoRecipeRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const startDojoRecipeController: RequestHandler = async (req, res) => {
|
export const startDojoRecipeController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const account = await getAccountForRequest(req);
|
||||||
const inventory = await getInventory(accountId, "GuildId LevelKeys");
|
const inventory = await getInventory(account._id.toString(), "GuildId LevelKeys");
|
||||||
const guild = await getGuildForRequestEx(req, inventory);
|
const guild = await getGuildForRequestEx(req, inventory);
|
||||||
if (!hasAccessToDojo(inventory) || !(await hasGuildPermission(guild, accountId, GuildPermission.Architect))) {
|
if (!hasAccessToDojo(inventory) || !(await hasGuildPermission(guild, account._id, GuildPermission.Architect))) {
|
||||||
res.json({ DojoRequestStatus: -1 });
|
res.json({ DojoRequestStatus: -1 });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -64,5 +64,5 @@ export const startDojoRecipeController: RequestHandler = async (req, res) => {
|
|||||||
setDojoRoomLogFunded(guild, component);
|
setDojoRoomLogFunded(guild, component);
|
||||||
}
|
}
|
||||||
await guild.save();
|
await guild.save();
|
||||||
res.json(await getDojoClient(guild, 0));
|
res.json(await getDojoClient(guild, 0, undefined, account.BuildLabel));
|
||||||
};
|
};
|
||||||
|
@ -3,12 +3,14 @@ import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
|||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getRecipe } from "@/src/services/itemDataService";
|
import { getRecipe } from "@/src/services/itemDataService";
|
||||||
import { addItem, freeUpSlot, getInventory, updateCurrency } from "@/src/services/inventoryService";
|
import { addItem, addKubrowPet, freeUpSlot, getInventory, updateCurrency } from "@/src/services/inventoryService";
|
||||||
import { unixTimesInMs } from "@/src/constants/timeConstants";
|
import { unixTimesInMs } from "@/src/constants/timeConstants";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { InventorySlot, ISpectreLoadout } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { InventorySlot, ISpectreLoadout } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { toOid } from "@/src/helpers/inventoryHelpers";
|
import { fromOid, toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { ExportWeapons } from "warframe-public-export-plus";
|
import { ExportWeapons } from "warframe-public-export-plus";
|
||||||
|
import { getRandomElement } from "@/src/services/rngService";
|
||||||
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
|
|
||||||
interface IStartRecipeRequest {
|
interface IStartRecipeRequest {
|
||||||
RecipeName: string;
|
RecipeName: string;
|
||||||
@ -41,25 +43,36 @@ export const startRecipeController: RequestHandler = async (req, res) => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
for (let i = 0; i != recipe.ingredients.length; ++i) {
|
for (let i = 0; i != recipe.ingredients.length; ++i) {
|
||||||
if (startRecipeRequest.Ids[i]) {
|
if (startRecipeRequest.Ids[i] && startRecipeRequest.Ids[i][0] != "/") {
|
||||||
const category = ExportWeapons[recipe.ingredients[i].ItemType].productCategory;
|
if (recipe.ingredients[i].ItemType == "/Lotus/Types/Game/KubrowPet/Eggs/KubrowPetEggItem") {
|
||||||
if (category != "LongGuns" && category != "Pistols" && category != "Melee") {
|
const index = inventory.KubrowPetEggs!.findIndex(x => x._id.equals(startRecipeRequest.Ids[i]));
|
||||||
throw new Error(`unexpected equipment ingredient type: ${category}`);
|
if (index != -1) {
|
||||||
|
inventory.KubrowPetEggs!.splice(index, 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const category = ExportWeapons[recipe.ingredients[i].ItemType].productCategory;
|
||||||
|
if (category != "LongGuns" && category != "Pistols" && category != "Melee") {
|
||||||
|
throw new Error(`unexpected equipment ingredient type: ${category}`);
|
||||||
|
}
|
||||||
|
const equipmentIndex = inventory[category].findIndex(x => x._id.equals(startRecipeRequest.Ids[i]));
|
||||||
|
if (equipmentIndex == -1) {
|
||||||
|
throw new Error(`could not find equipment item to use for recipe`);
|
||||||
|
}
|
||||||
|
pr[category] ??= [];
|
||||||
|
pr[category].push(inventory[category][equipmentIndex]);
|
||||||
|
inventory[category].splice(equipmentIndex, 1);
|
||||||
|
freeUpSlot(inventory, InventorySlot.WEAPONS);
|
||||||
}
|
}
|
||||||
const equipmentIndex = inventory[category].findIndex(x => x._id.equals(startRecipeRequest.Ids[i]));
|
|
||||||
if (equipmentIndex == -1) {
|
|
||||||
throw new Error(`could not find equipment item to use for recipe`);
|
|
||||||
}
|
|
||||||
pr[category] ??= [];
|
|
||||||
pr[category].push(inventory[category][equipmentIndex]);
|
|
||||||
inventory[category].splice(equipmentIndex, 1);
|
|
||||||
freeUpSlot(inventory, InventorySlot.WEAPONS);
|
|
||||||
} else {
|
} else {
|
||||||
await addItem(inventory, recipe.ingredients[i].ItemType, recipe.ingredients[i].ItemCount * -1);
|
await addItem(inventory, recipe.ingredients[i].ItemType, recipe.ingredients[i].ItemCount * -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipe.secretIngredientAction == "SIA_SPECTRE_LOADOUT_COPY") {
|
let inventoryChanges: IInventoryChanges | undefined;
|
||||||
|
if (recipe.secretIngredientAction == "SIA_CREATE_KUBROW") {
|
||||||
|
inventoryChanges = addKubrowPet(inventory, getRandomElement(recipe.secretIngredients!)!.ItemType);
|
||||||
|
pr.KubrowPet = new Types.ObjectId(fromOid(inventoryChanges.KubrowPets![0].ItemId));
|
||||||
|
} else if (recipe.secretIngredientAction == "SIA_SPECTRE_LOADOUT_COPY") {
|
||||||
const spectreLoadout: ISpectreLoadout = {
|
const spectreLoadout: ISpectreLoadout = {
|
||||||
ItemType: recipe.resultType,
|
ItemType: recipe.resultType,
|
||||||
Suits: "",
|
Suits: "",
|
||||||
@ -116,5 +129,5 @@ export const startRecipeController: RequestHandler = async (req, res) => {
|
|||||||
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
|
|
||||||
res.json({ RecipeId: toOid(pr._id) });
|
res.json({ RecipeId: toOid(pr._id), InventoryChanges: inventoryChanges });
|
||||||
};
|
};
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { ExportNightwave, ExportSyndicates, ISyndicateSacrifice } from "warframe-public-export-plus";
|
import { ExportSyndicates, ISyndicateSacrifice } from "warframe-public-export-plus";
|
||||||
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
|
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
|
||||||
import { addMiscItems, combineInventoryChanges, getInventory, updateCurrency } from "@/src/services/inventoryService";
|
import { addMiscItem, combineInventoryChanges, getInventory, updateCurrency } from "@/src/services/inventoryService";
|
||||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
import { isStoreItem, toStoreItem } from "@/src/services/itemDataService";
|
import { toStoreItem } from "@/src/services/itemDataService";
|
||||||
|
import { logger } from "@/src/utils/logger";
|
||||||
|
|
||||||
export const syndicateSacrificeController: RequestHandler = async (request, response) => {
|
export const syndicateSacrificeController: RequestHandler = async (request, response) => {
|
||||||
const accountId = await getAccountIdForRequest(request);
|
const accountId = await getAccountIdForRequest(request);
|
||||||
@ -17,70 +18,83 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp
|
|||||||
syndicate = inventory.Affiliations[inventory.Affiliations.push({ Tag: data.AffiliationTag, Standing: 0 }) - 1];
|
syndicate = inventory.Affiliations[inventory.Affiliations.push({ Tag: data.AffiliationTag, Standing: 0 }) - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
const level = data.SacrificeLevel - (syndicate.Title ?? 0);
|
const oldLevel = syndicate.Title ?? 0;
|
||||||
|
const levelIncrease = data.SacrificeLevel - oldLevel;
|
||||||
|
if (levelIncrease < 0) {
|
||||||
|
throw new Error(`syndicate sacrifice can not decrease level`);
|
||||||
|
}
|
||||||
|
if (levelIncrease > 1 && !data.AllowMultiple) {
|
||||||
|
throw new Error(`desired syndicate level is an increase of ${levelIncrease}, max. allowed increase is 1`);
|
||||||
|
}
|
||||||
|
|
||||||
const res: ISyndicateSacrificeResponse = {
|
const res: ISyndicateSacrificeResponse = {
|
||||||
AffiliationTag: data.AffiliationTag,
|
AffiliationTag: data.AffiliationTag,
|
||||||
InventoryChanges: {},
|
InventoryChanges: {},
|
||||||
Level: data.SacrificeLevel,
|
Level: data.SacrificeLevel,
|
||||||
LevelIncrease: level <= 0 ? 1 : level,
|
LevelIncrease: data.SacrificeLevel < 0 ? 1 : levelIncrease,
|
||||||
NewEpisodeReward: false
|
NewEpisodeReward: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Process sacrifices and rewards for every level we're reaching
|
||||||
const manifest = ExportSyndicates[data.AffiliationTag];
|
const manifest = ExportSyndicates[data.AffiliationTag];
|
||||||
let sacrifice: ISyndicateSacrifice | undefined;
|
for (let level = oldLevel + Math.min(levelIncrease, 1); level <= data.SacrificeLevel; ++level) {
|
||||||
let reward: string | undefined;
|
let sacrifice: ISyndicateSacrifice | undefined;
|
||||||
if (data.SacrificeLevel == 0) {
|
if (level == 0) {
|
||||||
sacrifice = manifest.initiationSacrifice;
|
sacrifice = manifest.initiationSacrifice;
|
||||||
reward = manifest.initiationReward;
|
if (manifest.initiationReward) {
|
||||||
syndicate.Initiated = true;
|
combineInventoryChanges(
|
||||||
} else {
|
res.InventoryChanges,
|
||||||
sacrifice = manifest.titles?.find(x => x.level == data.SacrificeLevel)?.sacrifice;
|
(await handleStoreItemAcquisition(manifest.initiationReward, inventory)).InventoryChanges
|
||||||
}
|
);
|
||||||
|
}
|
||||||
if (sacrifice) {
|
syndicate.Initiated = true;
|
||||||
res.InventoryChanges = { ...updateCurrency(inventory, sacrifice.credits, false) };
|
} else {
|
||||||
|
sacrifice = manifest.titles?.find(x => x.level == level)?.sacrifice;
|
||||||
const miscItemChanges = sacrifice.items.map(x => ({
|
}
|
||||||
ItemType: x.ItemType,
|
|
||||||
ItemCount: x.ItemCount * -1
|
if (sacrifice) {
|
||||||
}));
|
updateCurrency(inventory, sacrifice.credits, false, res.InventoryChanges);
|
||||||
addMiscItems(inventory, miscItemChanges);
|
|
||||||
res.InventoryChanges.MiscItems = miscItemChanges;
|
for (const item of sacrifice.items) {
|
||||||
}
|
addMiscItem(inventory, item.ItemType, item.ItemCount * -1, res.InventoryChanges);
|
||||||
|
}
|
||||||
syndicate.Title ??= 0;
|
}
|
||||||
syndicate.Title += 1;
|
|
||||||
|
// Quacks like a nightwave syndicate?
|
||||||
if (syndicate.Title > 0 && manifest.favours.find(x => x.rankUpReward && x.requiredLevel == syndicate.Title)) {
|
if (manifest.dailyChallenges) {
|
||||||
syndicate.FreeFavorsEarned ??= [];
|
const title = manifest.titles!.find(x => x.level == level);
|
||||||
if (!syndicate.FreeFavorsEarned.includes(syndicate.Title)) {
|
if (title) {
|
||||||
syndicate.FreeFavorsEarned.push(syndicate.Title);
|
res.NewEpisodeReward = true;
|
||||||
}
|
let rewardType: string;
|
||||||
}
|
let rewardCount: number;
|
||||||
|
if (title.storeItemReward) {
|
||||||
if (reward) {
|
rewardType = title.storeItemReward;
|
||||||
combineInventoryChanges(
|
rewardCount = 1;
|
||||||
res.InventoryChanges,
|
} else {
|
||||||
(await handleStoreItemAcquisition(reward, inventory)).InventoryChanges
|
rewardType = toStoreItem(title.reward!.ItemType);
|
||||||
);
|
rewardCount = title.reward!.ItemCount;
|
||||||
}
|
}
|
||||||
|
const rewardInventoryChanges = (await handleStoreItemAcquisition(rewardType, inventory, rewardCount))
|
||||||
if (data.AffiliationTag == ExportNightwave.affiliationTag) {
|
.InventoryChanges;
|
||||||
const index = syndicate.Title - 1;
|
if (Object.keys(rewardInventoryChanges).length == 0) {
|
||||||
if (index < ExportNightwave.rewards.length) {
|
logger.debug(`nightwave rank up reward did not seem to get added, giving 50 creds instead`);
|
||||||
res.NewEpisodeReward = true;
|
const nightwaveCredsItemType = manifest.titles![0].reward!.ItemType;
|
||||||
const reward = ExportNightwave.rewards[index];
|
addMiscItem(inventory, nightwaveCredsItemType, 50, rewardInventoryChanges);
|
||||||
let rewardType = reward.uniqueName;
|
}
|
||||||
if (!isStoreItem(rewardType)) {
|
combineInventoryChanges(res.InventoryChanges, rewardInventoryChanges);
|
||||||
rewardType = toStoreItem(rewardType);
|
}
|
||||||
|
} else {
|
||||||
|
if (level > 0 && manifest.favours.find(x => x.rankUpReward && x.requiredLevel == level)) {
|
||||||
|
syndicate.FreeFavorsEarned ??= [];
|
||||||
|
if (!syndicate.FreeFavorsEarned.includes(level)) {
|
||||||
|
syndicate.FreeFavorsEarned.push(level);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
combineInventoryChanges(
|
|
||||||
res.InventoryChanges,
|
|
||||||
(await handleStoreItemAcquisition(rewardType, inventory, reward.itemCount)).InventoryChanges
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Commit
|
||||||
|
syndicate.Title = data.SacrificeLevel < 0 ? data.SacrificeLevel + 1 : data.SacrificeLevel;
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
|
|
||||||
response.json(res);
|
response.json(res);
|
||||||
|
@ -5,7 +5,7 @@ import { IMiscItem, InventorySlot } from "@/src/types/inventoryTypes/inventoryTy
|
|||||||
import { IOid } from "@/src/types/commonTypes";
|
import { IOid } from "@/src/types/commonTypes";
|
||||||
import { ExportSyndicates, ExportWeapons } from "warframe-public-export-plus";
|
import { ExportSyndicates, ExportWeapons } from "warframe-public-export-plus";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
import { IAffiliationMods, IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
import { EquipmentFeatures } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
import { EquipmentFeatures } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
|
|
||||||
export const syndicateStandingBonusController: RequestHandler = async (req, res) => {
|
export const syndicateStandingBonusController: RequestHandler = async (req, res) => {
|
||||||
@ -54,13 +54,14 @@ export const syndicateStandingBonusController: RequestHandler = async (req, res)
|
|||||||
inventoryChanges[slotBin] = { count: -1, platinum: 0, Slots: 1 };
|
inventoryChanges[slotBin] = { count: -1, platinum: 0, Slots: 1 };
|
||||||
}
|
}
|
||||||
|
|
||||||
const affiliationMod = addStanding(inventory, request.Operation.AffiliationTag, gainedStanding, true);
|
const affiliationMods: IAffiliationMods[] = [];
|
||||||
|
addStanding(inventory, request.Operation.AffiliationTag, gainedStanding, affiliationMods, true);
|
||||||
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
InventoryChanges: inventoryChanges,
|
InventoryChanges: inventoryChanges,
|
||||||
AffiliationMods: [affiliationMod]
|
AffiliationMods: affiliationMods
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,6 +35,17 @@ const trainingResultController: RequestHandler = async (req, res): Promise<void>
|
|||||||
inventory.PlayerLevel += 1;
|
inventory.PlayerLevel += 1;
|
||||||
inventory.TradesRemaining += 1;
|
inventory.TradesRemaining += 1;
|
||||||
|
|
||||||
|
if (inventory.PlayerLevel == 2) {
|
||||||
|
await createMessage(accountId, [
|
||||||
|
{
|
||||||
|
sndr: "/Lotus/Language/Game/Maroo",
|
||||||
|
msg: "/Lotus/Language/Clan/MarooClanSearchDesc",
|
||||||
|
sub: "/Lotus/Language/Clan/MarooClanSearchTitle",
|
||||||
|
icon: "/Lotus/Interface/Icons/Npcs/Maroo.png"
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
await createMessage(accountId, [
|
await createMessage(accountId, [
|
||||||
{
|
{
|
||||||
sndr: "/Lotus/Language/Menu/Mailbox_WarframeSender",
|
sndr: "/Lotus/Language/Menu/Mailbox_WarframeSender",
|
||||||
|
@ -1,18 +1,26 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountForRequest } from "@/src/services/loginService";
|
||||||
import { addChallenges, getInventory } from "@/src/services/inventoryService";
|
import { addChallenges, getInventory } from "@/src/services/inventoryService";
|
||||||
import { IChallengeProgress, ISeasonChallenge } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IChallengeProgress, ISeasonChallenge } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { IAffiliationMods } from "@/src/types/purchaseTypes";
|
import { IAffiliationMods } from "@/src/types/purchaseTypes";
|
||||||
|
|
||||||
export const updateChallengeProgressController: RequestHandler = async (req, res) => {
|
export const updateChallengeProgressController: RequestHandler = async (req, res) => {
|
||||||
const challenges = getJSONfromString<IUpdateChallengeProgressRequest>(String(req.body));
|
const challenges = getJSONfromString<IUpdateChallengeProgressRequest>(String(req.body));
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const account = await getAccountForRequest(req);
|
||||||
|
|
||||||
const inventory = await getInventory(accountId, "ChallengeProgress SeasonChallengeHistory Affiliations");
|
const inventory = await getInventory(
|
||||||
|
account._id.toString(),
|
||||||
|
"ChallengeProgress SeasonChallengeHistory Affiliations"
|
||||||
|
);
|
||||||
let affiliationMods: IAffiliationMods[] = [];
|
let affiliationMods: IAffiliationMods[] = [];
|
||||||
if (challenges.ChallengeProgress) {
|
if (challenges.ChallengeProgress) {
|
||||||
affiliationMods = addChallenges(inventory, challenges.ChallengeProgress, challenges.SeasonChallengeCompletions);
|
affiliationMods = addChallenges(
|
||||||
|
account,
|
||||||
|
inventory,
|
||||||
|
challenges.ChallengeProgress,
|
||||||
|
challenges.SeasonChallengeCompletions
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (challenges.SeasonChallengeHistory) {
|
if (challenges.SeasonChallengeHistory) {
|
||||||
challenges.SeasonChallengeHistory.forEach(({ challenge, id }) => {
|
challenges.SeasonChallengeHistory.forEach(({ challenge, id }) => {
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { addFusionPoints, getInventory } from "@/src/services/inventoryService";
|
||||||
|
|
||||||
export const addCurrencyController: RequestHandler = async (req, res) => {
|
export const addCurrencyController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
const inventory = await getInventory(accountId);
|
|
||||||
const request = req.body as IAddCurrencyRequest;
|
const request = req.body as IAddCurrencyRequest;
|
||||||
inventory[request.currency] += request.delta;
|
const inventory = await getInventory(accountId, request.currency);
|
||||||
|
if (request.currency == "FusionPoints") {
|
||||||
|
addFusionPoints(inventory, request.delta);
|
||||||
|
} else {
|
||||||
|
inventory[request.currency] += request.delta;
|
||||||
|
}
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
@ -7,7 +7,7 @@ export const addItemsController: RequestHandler = async (req, res) => {
|
|||||||
const requests = req.body as IAddItemRequest[];
|
const requests = req.body as IAddItemRequest[];
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(accountId);
|
||||||
for (const request of requests) {
|
for (const request of requests) {
|
||||||
await addItem(inventory, request.ItemType, request.ItemCount, true);
|
await addItem(inventory, request.ItemType, request.ItemCount, true, undefined, undefined, true);
|
||||||
}
|
}
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
44
src/controllers/custom/addMissingMaxRankModsController.ts
Normal file
44
src/controllers/custom/addMissingMaxRankModsController.ts
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { RequestHandler } from "express";
|
||||||
|
import { ExportArcanes, ExportUpgrades } from "warframe-public-export-plus";
|
||||||
|
|
||||||
|
export const addMissingMaxRankModsController: RequestHandler = async (req, res) => {
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
const inventory = await getInventory(accountId, "Upgrades");
|
||||||
|
|
||||||
|
const maxOwnedRanks: Record<string, number> = {};
|
||||||
|
for (const upgrade of inventory.Upgrades) {
|
||||||
|
const fingerprint = JSON.parse(upgrade.UpgradeFingerprint ?? "{}") as { lvl?: number };
|
||||||
|
if (fingerprint.lvl) {
|
||||||
|
maxOwnedRanks[upgrade.ItemType] ??= 0;
|
||||||
|
if (fingerprint.lvl > maxOwnedRanks[upgrade.ItemType]) {
|
||||||
|
maxOwnedRanks[upgrade.ItemType] = fingerprint.lvl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const [uniqueName, data] of Object.entries(ExportUpgrades)) {
|
||||||
|
if (data.fusionLimit != 0 && data.type != "PARAZON" && maxOwnedRanks[uniqueName] != data.fusionLimit) {
|
||||||
|
inventory.Upgrades.push({
|
||||||
|
ItemType: uniqueName,
|
||||||
|
UpgradeFingerprint: JSON.stringify({ lvl: data.fusionLimit })
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const [uniqueName, data] of Object.entries(ExportArcanes)) {
|
||||||
|
if (
|
||||||
|
data.name != "/Lotus/Language/Items/GenericCosmeticEnhancerName" &&
|
||||||
|
maxOwnedRanks[uniqueName] != data.fusionLimit
|
||||||
|
) {
|
||||||
|
inventory.Upgrades.push({
|
||||||
|
ItemType: uniqueName,
|
||||||
|
UpgradeFingerprint: JSON.stringify({ lvl: data.fusionLimit })
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await inventory.save();
|
||||||
|
res.end();
|
||||||
|
};
|
@ -1,5 +1,6 @@
|
|||||||
import { addGearExpByCategory, getInventory } from "@/src/services/inventoryService";
|
import { applyClientEquipmentUpdates, getInventory } from "@/src/services/inventoryService";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { IOid } from "@/src/types/commonTypes";
|
||||||
import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
@ -11,7 +12,7 @@ export const addXpController: RequestHandler = async (req, res) => {
|
|||||||
const request = req.body as IAddXpRequest;
|
const request = req.body as IAddXpRequest;
|
||||||
for (const [category, gear] of Object.entries(request)) {
|
for (const [category, gear] of Object.entries(request)) {
|
||||||
for (const clientItem of gear) {
|
for (const clientItem of gear) {
|
||||||
const dbItem = inventory[category as TEquipmentKey].id(clientItem.ItemId.$oid);
|
const dbItem = inventory[category as TEquipmentKey].id((clientItem.ItemId as IOid).$oid);
|
||||||
if (dbItem) {
|
if (dbItem) {
|
||||||
if (dbItem.ItemType in ExportMisc.uniqueLevelCaps) {
|
if (dbItem.ItemType in ExportMisc.uniqueLevelCaps) {
|
||||||
if ((dbItem.Polarized ?? 0) < 5) {
|
if ((dbItem.Polarized ?? 0) < 5) {
|
||||||
@ -20,7 +21,7 @@ export const addXpController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addGearExpByCategory(inventory, gear, category as TEquipmentKey);
|
applyClientEquipmentUpdates(inventory, gear, category as TEquipmentKey);
|
||||||
}
|
}
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
@ -10,6 +10,7 @@ import { Stats } from "@/src/models/statsModel";
|
|||||||
import { GuildMember } from "@/src/models/guildModel";
|
import { GuildMember } from "@/src/models/guildModel";
|
||||||
import { Leaderboard } from "@/src/models/leaderboardModel";
|
import { Leaderboard } from "@/src/models/leaderboardModel";
|
||||||
import { deleteGuild } from "@/src/services/guildService";
|
import { deleteGuild } from "@/src/services/guildService";
|
||||||
|
import { Friendship } from "@/src/models/friendModel";
|
||||||
|
|
||||||
export const deleteAccountController: RequestHandler = async (req, res) => {
|
export const deleteAccountController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -22,6 +23,8 @@ export const deleteAccountController: RequestHandler = async (req, res) => {
|
|||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
Account.deleteOne({ _id: accountId }),
|
Account.deleteOne({ _id: accountId }),
|
||||||
|
Friendship.deleteMany({ owner: accountId }),
|
||||||
|
Friendship.deleteMany({ friend: accountId }),
|
||||||
GuildMember.deleteMany({ accountId: accountId }),
|
GuildMember.deleteMany({ accountId: accountId }),
|
||||||
Ignore.deleteMany({ ignorer: accountId }),
|
Ignore.deleteMany({ ignorer: accountId }),
|
||||||
Ignore.deleteMany({ ignoree: accountId }),
|
Ignore.deleteMany({ ignoree: accountId }),
|
||||||
|
@ -1,15 +1,18 @@
|
|||||||
import { AllianceMember, Guild, GuildMember } from "@/src/models/guildModel";
|
import { AllianceMember, Guild, GuildMember } from "@/src/models/guildModel";
|
||||||
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
import { getAccountForRequest, isAdministrator } from "@/src/services/loginService";
|
import { getAccountForRequest, isAdministrator } from "@/src/services/loginService";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
export const getAccountInfoController: RequestHandler = async (req, res) => {
|
export const getAccountInfoController: RequestHandler = async (req, res) => {
|
||||||
const account = await getAccountForRequest(req);
|
const account = await getAccountForRequest(req);
|
||||||
|
const inventory = await getInventory(account._id.toString(), "QuestKeys");
|
||||||
const info: IAccountInfo = {
|
const info: IAccountInfo = {
|
||||||
DisplayName: account.DisplayName
|
DisplayName: account.DisplayName,
|
||||||
|
IsAdministrator: isAdministrator(account),
|
||||||
|
CompletedVorsPrize: !!inventory.QuestKeys.find(
|
||||||
|
x => x.ItemType == "/Lotus/Types/Keys/VorsPrize/VorsPrizeQuestKeyChain"
|
||||||
|
)?.Completed
|
||||||
};
|
};
|
||||||
if (isAdministrator(account)) {
|
|
||||||
info.IsAdministrator = true;
|
|
||||||
}
|
|
||||||
const guildMember = await GuildMember.findOne({ accountId: account._id, status: 0 }, "guildId rank");
|
const guildMember = await GuildMember.findOne({ accountId: account._id, status: 0 }, "guildId rank");
|
||||||
if (guildMember) {
|
if (guildMember) {
|
||||||
const guild = (await Guild.findById(guildMember.guildId, "Ranks AllianceId"))!;
|
const guild = (await Guild.findById(guildMember.guildId, "Ranks AllianceId"))!;
|
||||||
@ -31,7 +34,8 @@ export const getAccountInfoController: RequestHandler = async (req, res) => {
|
|||||||
|
|
||||||
interface IAccountInfo {
|
interface IAccountInfo {
|
||||||
DisplayName: string;
|
DisplayName: string;
|
||||||
IsAdministrator?: boolean;
|
IsAdministrator: boolean;
|
||||||
|
CompletedVorsPrize: boolean;
|
||||||
GuildId?: string;
|
GuildId?: string;
|
||||||
GuildPermissions?: number;
|
GuildPermissions?: number;
|
||||||
GuildRank?: number;
|
GuildRank?: number;
|
||||||
|
@ -3,6 +3,7 @@ import { getDict, getItemName, getString } from "@/src/services/itemDataService"
|
|||||||
import {
|
import {
|
||||||
ExportArcanes,
|
ExportArcanes,
|
||||||
ExportAvionics,
|
ExportAvionics,
|
||||||
|
ExportBoosters,
|
||||||
ExportCustoms,
|
ExportCustoms,
|
||||||
ExportDrones,
|
ExportDrones,
|
||||||
ExportGear,
|
ExportGear,
|
||||||
@ -19,11 +20,12 @@ import {
|
|||||||
ExportWeapons,
|
ExportWeapons,
|
||||||
TRelicQuality
|
TRelicQuality
|
||||||
} from "warframe-public-export-plus";
|
} from "warframe-public-export-plus";
|
||||||
import archonCrystalUpgrades from "@/static/fixed_responses/webuiArchonCrystalUpgrades.json";
|
import allIncarnons from "@/static/fixed_responses/allIncarnonList.json";
|
||||||
|
|
||||||
interface ListedItem {
|
interface ListedItem {
|
||||||
uniqueName: string;
|
uniqueName: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
subtype?: string;
|
||||||
fusionLimit?: number;
|
fusionLimit?: number;
|
||||||
exalted?: string[];
|
exalted?: string[];
|
||||||
badReason?: "starter" | "frivolous" | "notraw";
|
badReason?: "starter" | "frivolous" | "notraw";
|
||||||
@ -32,6 +34,29 @@ interface ListedItem {
|
|||||||
parazon?: boolean;
|
parazon?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ItemLists {
|
||||||
|
uniqueLevelCaps: Record<string, number>;
|
||||||
|
Suits: ListedItem[];
|
||||||
|
LongGuns: ListedItem[];
|
||||||
|
Melee: ListedItem[];
|
||||||
|
ModularParts: ListedItem[];
|
||||||
|
Pistols: ListedItem[];
|
||||||
|
Sentinels: ListedItem[];
|
||||||
|
SentinelWeapons: ListedItem[];
|
||||||
|
SpaceGuns: ListedItem[];
|
||||||
|
SpaceMelee: ListedItem[];
|
||||||
|
SpaceSuits: ListedItem[];
|
||||||
|
MechSuits: ListedItem[];
|
||||||
|
miscitems: ListedItem[];
|
||||||
|
Syndicates: ListedItem[];
|
||||||
|
OperatorAmps: ListedItem[];
|
||||||
|
QuestKeys: ListedItem[];
|
||||||
|
KubrowPets: ListedItem[];
|
||||||
|
EvolutionProgress: ListedItem[];
|
||||||
|
mods: ListedItem[];
|
||||||
|
Boosters: ListedItem[];
|
||||||
|
}
|
||||||
|
|
||||||
const relicQualitySuffixes: Record<TRelicQuality, string> = {
|
const relicQualitySuffixes: Record<TRelicQuality, string> = {
|
||||||
VPQ_BRONZE: "",
|
VPQ_BRONZE: "",
|
||||||
VPQ_SILVER: " [Flawless]",
|
VPQ_SILVER: " [Flawless]",
|
||||||
@ -41,23 +66,28 @@ const relicQualitySuffixes: Record<TRelicQuality, string> = {
|
|||||||
|
|
||||||
const getItemListsController: RequestHandler = (req, response) => {
|
const getItemListsController: RequestHandler = (req, response) => {
|
||||||
const lang = getDict(typeof req.query.lang == "string" ? req.query.lang : "en");
|
const lang = getDict(typeof req.query.lang == "string" ? req.query.lang : "en");
|
||||||
const res: Record<string, ListedItem[]> = {};
|
const res: ItemLists = {
|
||||||
res.Suits = [];
|
uniqueLevelCaps: ExportMisc.uniqueLevelCaps,
|
||||||
res.LongGuns = [];
|
Suits: [],
|
||||||
res.Melee = [];
|
LongGuns: [],
|
||||||
res.ModularParts = [];
|
Melee: [],
|
||||||
res.Pistols = [];
|
ModularParts: [],
|
||||||
res.Sentinels = [];
|
Pistols: [],
|
||||||
res.SentinelWeapons = [];
|
Sentinels: [],
|
||||||
res.SpaceGuns = [];
|
SentinelWeapons: [],
|
||||||
res.SpaceMelee = [];
|
SpaceGuns: [],
|
||||||
res.SpaceSuits = [];
|
SpaceMelee: [],
|
||||||
res.MechSuits = [];
|
SpaceSuits: [],
|
||||||
res.miscitems = [];
|
MechSuits: [],
|
||||||
res.Syndicates = [];
|
miscitems: [],
|
||||||
res.OperatorAmps = [];
|
Syndicates: [],
|
||||||
res.QuestKeys = [];
|
OperatorAmps: [],
|
||||||
res.KubrowPets = [];
|
QuestKeys: [],
|
||||||
|
KubrowPets: [],
|
||||||
|
EvolutionProgress: [],
|
||||||
|
mods: [],
|
||||||
|
Boosters: []
|
||||||
|
};
|
||||||
for (const [uniqueName, item] of Object.entries(ExportWarframes)) {
|
for (const [uniqueName, item] of Object.entries(ExportWarframes)) {
|
||||||
res[item.productCategory].push({
|
res[item.productCategory].push({
|
||||||
uniqueName,
|
uniqueName,
|
||||||
@ -66,7 +96,7 @@ const getItemListsController: RequestHandler = (req, response) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
for (const [uniqueName, item] of Object.entries(ExportSentinels)) {
|
for (const [uniqueName, item] of Object.entries(ExportSentinels)) {
|
||||||
if (item.productCategory != "SpecialItems") {
|
if (item.productCategory == "Sentinels" || item.productCategory == "KubrowPets") {
|
||||||
res[item.productCategory].push({
|
res[item.productCategory].push({
|
||||||
uniqueName,
|
uniqueName,
|
||||||
name: getString(item.name, lang),
|
name: getString(item.name, lang),
|
||||||
@ -115,12 +145,28 @@ const getItemListsController: RequestHandler = (req, response) => {
|
|||||||
let name = getString(item.name, lang);
|
let name = getString(item.name, lang);
|
||||||
if ("dissectionParts" in item) {
|
if ("dissectionParts" in item) {
|
||||||
name = getString("/Lotus/Language/Fish/FishDisplayName", lang).split("|FISH_NAME|").join(name);
|
name = getString("/Lotus/Language/Fish/FishDisplayName", lang).split("|FISH_NAME|").join(name);
|
||||||
if (uniqueName.indexOf("Large") != -1) {
|
if (item.syndicateTag == "CetusSyndicate") {
|
||||||
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeLargeAbbrev", lang));
|
if (uniqueName.indexOf("Large") != -1) {
|
||||||
} else if (uniqueName.indexOf("Medium") != -1) {
|
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeLargeAbbrev", lang));
|
||||||
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeMediumAbbrev", lang));
|
} else if (uniqueName.indexOf("Medium") != -1) {
|
||||||
|
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeMediumAbbrev", lang));
|
||||||
|
} else {
|
||||||
|
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeSmallAbbrev", lang));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeSmallAbbrev", lang));
|
if (uniqueName.indexOf("Large") != -1) {
|
||||||
|
name = name
|
||||||
|
.split("|FISH_SIZE|")
|
||||||
|
.join(getString("/Lotus/Language/SolarisVenus/RobofishAgeCategoryElderAbbrev", lang));
|
||||||
|
} else if (uniqueName.indexOf("Medium") != -1) {
|
||||||
|
name = name
|
||||||
|
.split("|FISH_SIZE|")
|
||||||
|
.join(getString("/Lotus/Language/SolarisVenus/RobofishAgeCategoryMatureAbbrev", lang));
|
||||||
|
} else {
|
||||||
|
name = name
|
||||||
|
.split("|FISH_SIZE|")
|
||||||
|
.join(getString("/Lotus/Language/SolarisVenus/RobofishAgeCategoryYoungAbbrev", lang));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
@ -130,7 +176,8 @@ const getItemListsController: RequestHandler = (req, response) => {
|
|||||||
) {
|
) {
|
||||||
res.miscitems.push({
|
res.miscitems.push({
|
||||||
uniqueName: uniqueName,
|
uniqueName: uniqueName,
|
||||||
name: name
|
name: name,
|
||||||
|
subtype: "Resource"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -148,7 +195,8 @@ const getItemListsController: RequestHandler = (req, response) => {
|
|||||||
for (const [uniqueName, item] of Object.entries(ExportGear)) {
|
for (const [uniqueName, item] of Object.entries(ExportGear)) {
|
||||||
res.miscitems.push({
|
res.miscitems.push({
|
||||||
uniqueName: uniqueName,
|
uniqueName: uniqueName,
|
||||||
name: getString(item.name, lang)
|
name: getString(item.name, lang),
|
||||||
|
subtype: "Gear"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const recipeNameTemplate = getString("/Lotus/Language/Items/BlueprintAndItem", lang);
|
const recipeNameTemplate = getString("/Lotus/Language/Items/BlueprintAndItem", lang);
|
||||||
@ -184,7 +232,6 @@ const getItemListsController: RequestHandler = (req, response) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
res.mods = [];
|
|
||||||
for (const [uniqueName, upgrade] of Object.entries(ExportUpgrades)) {
|
for (const [uniqueName, upgrade] of Object.entries(ExportUpgrades)) {
|
||||||
const mod: ListedItem = {
|
const mod: ListedItem = {
|
||||||
uniqueName,
|
uniqueName,
|
||||||
@ -242,12 +289,21 @@ const getItemListsController: RequestHandler = (req, response) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (const uniqueName of allIncarnons) {
|
||||||
|
res.EvolutionProgress.push({
|
||||||
|
uniqueName,
|
||||||
|
name: getString(getItemName(uniqueName) || "", lang)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
response.json({
|
for (const item of Object.values(ExportBoosters)) {
|
||||||
archonCrystalUpgrades,
|
res.Boosters.push({
|
||||||
uniqueLevelCaps: ExportMisc.uniqueLevelCaps,
|
uniqueName: item.typeName,
|
||||||
...res
|
name: getString(item.name, lang)
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
response.json(res);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { getItemListsController };
|
export { getItemListsController };
|
||||||
|
45
src/controllers/custom/setBoosterController.ts
Normal file
45
src/controllers/custom/setBoosterController.ts
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
|
import { RequestHandler } from "express";
|
||||||
|
import { ExportBoosters } from "warframe-public-export-plus";
|
||||||
|
|
||||||
|
const I32_MAX = 0x7fffffff;
|
||||||
|
|
||||||
|
export const setBoosterController: RequestHandler = async (req, res) => {
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
const requests = req.body as { ItemType: string; ExpiryDate: number }[];
|
||||||
|
const inventory = await getInventory(accountId, "Boosters");
|
||||||
|
const boosters = inventory.Boosters;
|
||||||
|
if (
|
||||||
|
requests.some(request => {
|
||||||
|
if (typeof request.ItemType !== "string") return true;
|
||||||
|
if (Object.entries(ExportBoosters).find(([_, item]) => item.typeName === request.ItemType) === undefined)
|
||||||
|
return true;
|
||||||
|
if (typeof request.ExpiryDate !== "number") return true;
|
||||||
|
if (request.ExpiryDate < 0 || request.ExpiryDate > I32_MAX) return true;
|
||||||
|
return false;
|
||||||
|
})
|
||||||
|
) {
|
||||||
|
res.status(400).send("Invalid ItemType provided.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const now = Math.floor(Date.now() / 1000);
|
||||||
|
for (const { ItemType, ExpiryDate } of requests) {
|
||||||
|
if (ExpiryDate < now) {
|
||||||
|
// remove expired boosters
|
||||||
|
const index = boosters.findIndex(item => item.ItemType === ItemType);
|
||||||
|
if (index !== -1) {
|
||||||
|
boosters.splice(index, 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const boosterItem = boosters.find(item => item.ItemType === ItemType);
|
||||||
|
if (boosterItem) {
|
||||||
|
boosterItem.ExpiryDate = ExpiryDate;
|
||||||
|
} else {
|
||||||
|
boosters.push({ ItemType, ExpiryDate });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await inventory.save();
|
||||||
|
res.end();
|
||||||
|
};
|
33
src/controllers/custom/setEvolutionProgressController.ts
Normal file
33
src/controllers/custom/setEvolutionProgressController.ts
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
|
export const setEvolutionProgressController: RequestHandler = async (req, res) => {
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
const inventory = await getInventory(accountId);
|
||||||
|
const payload = req.body as ISetEvolutionProgressRequest;
|
||||||
|
|
||||||
|
inventory.EvolutionProgress ??= [];
|
||||||
|
payload.forEach(element => {
|
||||||
|
const entry = inventory.EvolutionProgress!.find(entry => entry.ItemType === element.ItemType);
|
||||||
|
|
||||||
|
if (entry) {
|
||||||
|
entry.Progress = 0;
|
||||||
|
entry.Rank = element.Rank;
|
||||||
|
} else {
|
||||||
|
inventory.EvolutionProgress!.push({
|
||||||
|
Progress: 0,
|
||||||
|
Rank: element.Rank,
|
||||||
|
ItemType: element.ItemType
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await inventory.save();
|
||||||
|
res.end();
|
||||||
|
};
|
||||||
|
|
||||||
|
type ISetEvolutionProgressRequest = {
|
||||||
|
ItemType: string;
|
||||||
|
Rank: number;
|
||||||
|
}[];
|
@ -18,64 +18,76 @@ import {
|
|||||||
ITypeXPItem
|
ITypeXPItem
|
||||||
} from "@/src/types/inventoryTypes/inventoryTypes";
|
} from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { catBreadHash } from "@/src/helpers/stringHelpers";
|
import { catBreadHash, getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { ExportCustoms, ExportDojoRecipes } from "warframe-public-export-plus";
|
import { ExportCustoms, ExportDojoRecipes } from "warframe-public-export-plus";
|
||||||
import { IStatsClient } from "@/src/types/statTypes";
|
import { IStatsClient } from "@/src/types/statTypes";
|
||||||
import { toStoreItem } from "@/src/services/itemDataService";
|
import { toStoreItem } from "@/src/services/itemDataService";
|
||||||
|
import { FlattenMaps } from "mongoose";
|
||||||
|
|
||||||
export const getProfileViewingDataController: RequestHandler = async (req, res) => {
|
const getProfileViewingDataByPlayerIdImpl = async (playerId: string): Promise<IProfileViewingData | undefined> => {
|
||||||
|
const account = await Account.findById(playerId, "DisplayName");
|
||||||
|
if (!account) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const inventory = (await Inventory.findOne({ accountOwnerId: account._id }))!;
|
||||||
|
|
||||||
|
const result: IPlayerProfileViewingDataResult = {
|
||||||
|
AccountId: toOid(account._id),
|
||||||
|
DisplayName: account.DisplayName,
|
||||||
|
PlayerLevel: inventory.PlayerLevel,
|
||||||
|
LoadOutInventory: {
|
||||||
|
WeaponSkins: [],
|
||||||
|
XPInfo: inventory.XPInfo
|
||||||
|
},
|
||||||
|
PlayerSkills: inventory.PlayerSkills,
|
||||||
|
ChallengeProgress: inventory.ChallengeProgress,
|
||||||
|
DeathMarks: inventory.DeathMarks,
|
||||||
|
Harvestable: inventory.Harvestable,
|
||||||
|
DeathSquadable: inventory.DeathSquadable,
|
||||||
|
Created: toMongoDate(inventory.Created),
|
||||||
|
MigratedToConsole: false,
|
||||||
|
Missions: inventory.Missions,
|
||||||
|
Affiliations: inventory.Affiliations,
|
||||||
|
DailyFocus: inventory.DailyFocus,
|
||||||
|
Wishlist: inventory.Wishlist,
|
||||||
|
Alignment: inventory.Alignment
|
||||||
|
};
|
||||||
|
await populateLoadout(inventory, result);
|
||||||
|
if (inventory.GuildId) {
|
||||||
|
const guild = (await Guild.findById(inventory.GuildId, "Name Tier XP Class Emblem"))!;
|
||||||
|
populateGuild(guild, result);
|
||||||
|
}
|
||||||
|
for (const key of allDailyAffiliationKeys) {
|
||||||
|
result[key] = inventory[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
const stats = (await Stats.findOne({ accountOwnerId: account._id }))!.toJSON<Partial<TStatsDatabaseDocument>>();
|
||||||
|
delete stats._id;
|
||||||
|
delete stats.__v;
|
||||||
|
delete stats.accountOwnerId;
|
||||||
|
|
||||||
|
return {
|
||||||
|
Results: [result],
|
||||||
|
TechProjects: [],
|
||||||
|
XpComponents: [],
|
||||||
|
//XpCacheExpiryDate, some IMongoDate in the future, no clue what it's for
|
||||||
|
Stats: stats
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getProfileViewingDataGetController: RequestHandler = async (req, res) => {
|
||||||
if (req.query.playerId) {
|
if (req.query.playerId) {
|
||||||
const account = await Account.findById(req.query.playerId as string, "DisplayName");
|
const data = await getProfileViewingDataByPlayerIdImpl(req.query.playerId as string);
|
||||||
if (!account) {
|
if (data) {
|
||||||
|
res.json(data);
|
||||||
|
} else {
|
||||||
res.status(409).send("Could not find requested account");
|
res.status(409).send("Could not find requested account");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
const inventory = (await Inventory.findOne({ accountOwnerId: account._id }))!;
|
|
||||||
|
|
||||||
const result: IPlayerProfileViewingDataResult = {
|
|
||||||
AccountId: toOid(account._id),
|
|
||||||
DisplayName: account.DisplayName,
|
|
||||||
PlayerLevel: inventory.PlayerLevel,
|
|
||||||
LoadOutInventory: {
|
|
||||||
WeaponSkins: [],
|
|
||||||
XPInfo: inventory.XPInfo
|
|
||||||
},
|
|
||||||
PlayerSkills: inventory.PlayerSkills,
|
|
||||||
ChallengeProgress: inventory.ChallengeProgress,
|
|
||||||
DeathMarks: inventory.DeathMarks,
|
|
||||||
Harvestable: inventory.Harvestable,
|
|
||||||
DeathSquadable: inventory.DeathSquadable,
|
|
||||||
Created: toMongoDate(inventory.Created),
|
|
||||||
MigratedToConsole: false,
|
|
||||||
Missions: inventory.Missions,
|
|
||||||
Affiliations: inventory.Affiliations,
|
|
||||||
DailyFocus: inventory.DailyFocus,
|
|
||||||
Wishlist: inventory.Wishlist,
|
|
||||||
Alignment: inventory.Alignment
|
|
||||||
};
|
|
||||||
await populateLoadout(inventory, result);
|
|
||||||
if (inventory.GuildId) {
|
|
||||||
const guild = (await Guild.findById(inventory.GuildId, "Name Tier XP Class Emblem"))!;
|
|
||||||
populateGuild(guild, result);
|
|
||||||
}
|
|
||||||
for (const key of allDailyAffiliationKeys) {
|
|
||||||
result[key] = inventory[key];
|
|
||||||
}
|
|
||||||
|
|
||||||
const stats = (await Stats.findOne({ accountOwnerId: account._id }))!.toJSON<Partial<TStatsDatabaseDocument>>();
|
|
||||||
delete stats._id;
|
|
||||||
delete stats.__v;
|
|
||||||
delete stats.accountOwnerId;
|
|
||||||
|
|
||||||
res.json({
|
|
||||||
Results: [result],
|
|
||||||
TechProjects: [],
|
|
||||||
XpComponents: [],
|
|
||||||
//XpCacheExpiryDate, some IMongoDate in the future, no clue what it's for
|
|
||||||
Stats: stats
|
|
||||||
});
|
|
||||||
} else if (req.query.guildId) {
|
} else if (req.query.guildId) {
|
||||||
const guild = await Guild.findById(req.query.guildId, "Name Tier XP Class Emblem TechProjects ClaimedXP");
|
const guild = await Guild.findById(
|
||||||
|
req.query.guildId as string,
|
||||||
|
"Name Tier XP Class Emblem TechProjects ClaimedXP"
|
||||||
|
);
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
res.status(409).send("Could not find guild");
|
res.status(409).send("Could not find guild");
|
||||||
return;
|
return;
|
||||||
@ -170,6 +182,28 @@ export const getProfileViewingDataController: RequestHandler = async (req, res)
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// For old versions, this was an authenticated POST request.
|
||||||
|
interface IGetProfileViewingDataRequest {
|
||||||
|
AccountId: string;
|
||||||
|
}
|
||||||
|
export const getProfileViewingDataPostController: RequestHandler = async (req, res) => {
|
||||||
|
const payload = getJSONfromString<IGetProfileViewingDataRequest>(String(req.body));
|
||||||
|
const data = await getProfileViewingDataByPlayerIdImpl(payload.AccountId);
|
||||||
|
if (data) {
|
||||||
|
res.json(data);
|
||||||
|
} else {
|
||||||
|
res.status(409).send("Could not find requested account");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
interface IProfileViewingData {
|
||||||
|
Results: IPlayerProfileViewingDataResult[];
|
||||||
|
TechProjects: [];
|
||||||
|
XpComponents: [];
|
||||||
|
//XpCacheExpiryDate, some IMongoDate in the future, no clue what it's for
|
||||||
|
Stats: FlattenMaps<Partial<TStatsDatabaseDocument>>;
|
||||||
|
}
|
||||||
|
|
||||||
interface IPlayerProfileViewingDataResult extends Partial<IDailyAffiliations> {
|
interface IPlayerProfileViewingDataResult extends Partial<IDailyAffiliations> {
|
||||||
AccountId: IOid;
|
AccountId: IOid;
|
||||||
DisplayName: string;
|
DisplayName: string;
|
||||||
|
@ -27,7 +27,15 @@ const viewController: RequestHandler = async (req, res) => {
|
|||||||
for (const type of Object.keys(ExportEnemies.avatars)) {
|
for (const type of Object.keys(ExportEnemies.avatars)) {
|
||||||
if (!scans.has(type)) scans.add(type);
|
if (!scans.has(type)) scans.add(type);
|
||||||
}
|
}
|
||||||
responseJson.Scans ??= [];
|
|
||||||
|
// Take any existing scans and also set them to 9999
|
||||||
|
if (responseJson.Scans) {
|
||||||
|
for (const scan of responseJson.Scans) {
|
||||||
|
scans.add(scan.type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
responseJson.Scans = [];
|
||||||
|
|
||||||
for (const type of scans) {
|
for (const type of scans) {
|
||||||
responseJson.Scans.push({ type: type, scans: 9999 });
|
responseJson.Scans.push({ type: type, scans: 9999 });
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,8 @@ const toDatabaseAccount = (createAccount: IAccountCreation): IDatabaseAccountReq
|
|||||||
CrossPlatformAllowed: true,
|
CrossPlatformAllowed: true,
|
||||||
ForceLogoutVersion: 0,
|
ForceLogoutVersion: 0,
|
||||||
TrackedSettings: [],
|
TrackedSettings: [],
|
||||||
Nonce: 0
|
Nonce: 0,
|
||||||
|
LastLogin: new Date()
|
||||||
} satisfies IDatabaseAccountRequiredFields;
|
} satisfies IDatabaseAccountRequiredFields;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,15 +1,56 @@
|
|||||||
import { IMongoDate, IOid } from "@/src/types/commonTypes";
|
import { IMongoDate, IOid, IOidWithLegacySupport } from "@/src/types/commonTypes";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { TRarity } from "warframe-public-export-plus";
|
import { TRarity } from "warframe-public-export-plus";
|
||||||
|
|
||||||
|
export const version_compare = (a: string, b: string): number => {
|
||||||
|
const a_digits = a
|
||||||
|
.split("/")[0]
|
||||||
|
.split(".")
|
||||||
|
.map(x => parseInt(x));
|
||||||
|
const b_digits = b
|
||||||
|
.split("/")[0]
|
||||||
|
.split(".")
|
||||||
|
.map(x => parseInt(x));
|
||||||
|
for (let i = 0; i != a_digits.length; ++i) {
|
||||||
|
if (a_digits[i] != b_digits[i]) {
|
||||||
|
return a_digits[i] > b_digits[i] ? 1 : -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
||||||
export const toOid = (objectId: Types.ObjectId): IOid => {
|
export const toOid = (objectId: Types.ObjectId): IOid => {
|
||||||
return { $oid: objectId.toString() } satisfies IOid;
|
return { $oid: objectId.toString() };
|
||||||
|
};
|
||||||
|
|
||||||
|
export function toOid2(objectId: Types.ObjectId, buildLabel: undefined): IOid;
|
||||||
|
export function toOid2(objectId: Types.ObjectId, buildLabel: string | undefined): IOidWithLegacySupport;
|
||||||
|
export function toOid2(objectId: Types.ObjectId, buildLabel: string | undefined): IOidWithLegacySupport {
|
||||||
|
if (buildLabel && version_compare(buildLabel, "2016.12.21.19.13") <= 0) {
|
||||||
|
return { $id: objectId.toString() };
|
||||||
|
}
|
||||||
|
return { $oid: objectId.toString() };
|
||||||
|
}
|
||||||
|
|
||||||
|
export const toLegacyOid = (oid: IOidWithLegacySupport): void => {
|
||||||
|
if (!("$id" in oid)) {
|
||||||
|
oid.$id = oid.$oid;
|
||||||
|
delete oid.$oid;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const fromOid = (oid: IOidWithLegacySupport): string => {
|
||||||
|
return (oid.$oid ?? oid.$id)!;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const toMongoDate = (date: Date): IMongoDate => {
|
export const toMongoDate = (date: Date): IMongoDate => {
|
||||||
return { $date: { $numberLong: date.getTime().toString() } };
|
return { $date: { $numberLong: date.getTime().toString() } };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const fromMongoDate = (date: IMongoDate): Date => {
|
||||||
|
return new Date(parseInt(date.$date.$numberLong));
|
||||||
|
};
|
||||||
|
|
||||||
export const kubrowWeights: Record<TRarity, number> = {
|
export const kubrowWeights: Record<TRarity, number> = {
|
||||||
COMMON: 6,
|
COMMON: 6,
|
||||||
UNCOMMON: 4,
|
UNCOMMON: 4,
|
||||||
|
@ -1,15 +1,203 @@
|
|||||||
import { ExportRegions } from "warframe-public-export-plus";
|
import { ExportRegions, ExportWarframes } from "warframe-public-export-plus";
|
||||||
import { IInfNode } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IInfNode, TNemesisFaction } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { SRng } from "@/src/services/rngService";
|
import { getRewardAtPercentage, SRng } from "@/src/services/rngService";
|
||||||
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
|
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
|
||||||
import { logger } from "../utils/logger";
|
import { logger } from "../utils/logger";
|
||||||
import { IOid } from "../types/commonTypes";
|
import { IOid } from "../types/commonTypes";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { addMods } from "../services/inventoryService";
|
import { addMods, generateRewardSeed } from "../services/inventoryService";
|
||||||
|
import { isArchwingMission } from "../services/worldStateService";
|
||||||
|
|
||||||
export const getInfNodes = (faction: string, rank: number): IInfNode[] => {
|
type TInnateDamageTag =
|
||||||
|
| "InnateElectricityDamage"
|
||||||
|
| "InnateHeatDamage"
|
||||||
|
| "InnateFreezeDamage"
|
||||||
|
| "InnateToxinDamage"
|
||||||
|
| "InnateMagDamage"
|
||||||
|
| "InnateRadDamage"
|
||||||
|
| "InnateImpactDamage";
|
||||||
|
|
||||||
|
export interface INemesisManifest {
|
||||||
|
weapons: readonly string[];
|
||||||
|
systemIndexes: readonly number[];
|
||||||
|
showdownNode: string;
|
||||||
|
ephemeraChance: number;
|
||||||
|
ephemeraTypes?: Record<TInnateDamageTag, string>;
|
||||||
|
firstKillReward: string;
|
||||||
|
firstConvertReward: string;
|
||||||
|
messageTitle: string;
|
||||||
|
messageBody: string;
|
||||||
|
minBuild: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
class KuvaLichManifest implements INemesisManifest {
|
||||||
|
weapons = [
|
||||||
|
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Drakgoon/KuvaDrakgoon",
|
||||||
|
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Karak/KuvaKarak",
|
||||||
|
"/Lotus/Weapons/Grineer/Melee/GrnKuvaLichScythe/GrnKuvaLichScytheWeapon",
|
||||||
|
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Kohm/KuvaKohm",
|
||||||
|
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Ogris/KuvaOgris",
|
||||||
|
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Quartakk/KuvaQuartakk",
|
||||||
|
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Tonkor/KuvaTonkor",
|
||||||
|
"/Lotus/Weapons/Grineer/KuvaLich/Secondaries/Brakk/KuvaBrakk",
|
||||||
|
"/Lotus/Weapons/Grineer/KuvaLich/Secondaries/Kraken/KuvaKraken",
|
||||||
|
"/Lotus/Weapons/Grineer/KuvaLich/Secondaries/Seer/KuvaSeer",
|
||||||
|
"/Lotus/Weapons/Grineer/KuvaLich/Secondaries/Stubba/KuvaStubba",
|
||||||
|
"/Lotus/Weapons/Grineer/HeavyWeapons/GrnHeavyGrenadeLauncher",
|
||||||
|
"/Lotus/Weapons/Grineer/LongGuns/GrnKuvaLichRifle/GrnKuvaLichRifleWeapon"
|
||||||
|
];
|
||||||
|
systemIndexes = [2, 3, 9, 11, 18];
|
||||||
|
showdownNode = "CrewBattleNode557";
|
||||||
|
ephemeraChance = 0.05;
|
||||||
|
ephemeraTypes = {
|
||||||
|
InnateElectricityDamage: "/Lotus/Upgrades/Skins/Effects/Kuva/KuvaLightningEphemera",
|
||||||
|
InnateHeatDamage: "/Lotus/Upgrades/Skins/Effects/Kuva/KuvaFireEphemera",
|
||||||
|
InnateFreezeDamage: "/Lotus/Upgrades/Skins/Effects/Kuva/KuvaIceEphemera",
|
||||||
|
InnateToxinDamage: "/Lotus/Upgrades/Skins/Effects/Kuva/KuvaToxinEphemera",
|
||||||
|
InnateMagDamage: "/Lotus/Upgrades/Skins/Effects/Kuva/KuvaMagneticEphemera",
|
||||||
|
InnateRadDamage: "/Lotus/Upgrades/Skins/Effects/Kuva/KuvaTricksterEphemera",
|
||||||
|
InnateImpactDamage: "/Lotus/Upgrades/Skins/Effects/Kuva/KuvaImpactEphemera"
|
||||||
|
};
|
||||||
|
firstKillReward = "/Lotus/StoreItems/Upgrades/Skins/Clan/LichKillerBadgeItem";
|
||||||
|
firstConvertReward = "/Lotus/StoreItems/Upgrades/Skins/Sigils/KuvaLichSigil";
|
||||||
|
messageTitle = "/Lotus/Language/Inbox/VanquishKuvaMsgTitle";
|
||||||
|
messageBody = "/Lotus/Language/Inbox/VanquishLichMsgBody";
|
||||||
|
minBuild = "2019.10.31.22.42"; // 26.0.0
|
||||||
|
}
|
||||||
|
|
||||||
|
class KuvaLichManifestVersionTwo extends KuvaLichManifest {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.ephemeraChance = 0.1;
|
||||||
|
this.minBuild = "2020.03.05.16.06"; // Unsure about this one, so using the same value as in version three.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class KuvaLichManifestVersionThree extends KuvaLichManifestVersionTwo {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.weapons.push("/Lotus/Weapons/Grineer/Bows/GrnBow/GrnBowWeapon");
|
||||||
|
this.weapons.push("/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Hind/KuvaHind");
|
||||||
|
this.weapons.push("/Lotus/Weapons/Grineer/KuvaLich/Secondaries/Nukor/KuvaNukor");
|
||||||
|
this.ephemeraChance = 0.2;
|
||||||
|
this.minBuild = "2020.03.05.16.06"; // This is 27.2.0, tho 27.1.0 should also recognise this.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class KuvaLichManifestVersionFour extends KuvaLichManifestVersionThree {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.minBuild = "2021.07.05.17.03"; // Unsure about this one, so using the same value as in version five.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class KuvaLichManifestVersionFive extends KuvaLichManifestVersionFour {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.weapons.push("/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Hek/KuvaHekWeapon");
|
||||||
|
this.weapons.push("/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Zarr/KuvaZarr");
|
||||||
|
this.weapons.push("/Lotus/Weapons/Grineer/KuvaLich/HeavyWeapons/Grattler/KuvaGrattler");
|
||||||
|
this.minBuild = "2021.07.05.17.03"; // 30.5.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class KuvaLichManifestVersionSix extends KuvaLichManifestVersionFive {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.weapons.push("/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Sobek/KuvaSobek");
|
||||||
|
this.minBuild = "2024.05.15.11.07"; // 35.6.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class LawyerManifest implements INemesisManifest {
|
||||||
|
weapons = [
|
||||||
|
"/Lotus/Weapons/Corpus/LongGuns/CrpBriefcaseLauncher/CrpBriefcaseLauncher",
|
||||||
|
"/Lotus/Weapons/Corpus/BoardExec/Primary/CrpBEArcaPlasmor/CrpBEArcaPlasmor",
|
||||||
|
"/Lotus/Weapons/Corpus/BoardExec/Primary/CrpBEFluxRifle/CrpBEFluxRifle",
|
||||||
|
"/Lotus/Weapons/Corpus/BoardExec/Primary/CrpBETetra/CrpBETetra",
|
||||||
|
"/Lotus/Weapons/Corpus/BoardExec/Secondary/CrpBECycron/CrpBECycron",
|
||||||
|
"/Lotus/Weapons/Corpus/BoardExec/Secondary/CrpBEDetron/CrpBEDetron",
|
||||||
|
"/Lotus/Weapons/Corpus/Pistols/CrpIgniterPistol/CrpIgniterPistol",
|
||||||
|
"/Lotus/Weapons/Corpus/Pistols/CrpBriefcaseAkimbo/CrpBriefcaseAkimboPistol"
|
||||||
|
];
|
||||||
|
systemIndexes = [1, 15, 4, 7, 8];
|
||||||
|
showdownNode = "CrewBattleNode558";
|
||||||
|
ephemeraChance = 0.2;
|
||||||
|
ephemeraTypes = {
|
||||||
|
InnateElectricityDamage: "/Lotus/Upgrades/Skins/Effects/CorpusLichEphemeraA",
|
||||||
|
InnateHeatDamage: "/Lotus/Upgrades/Skins/Effects/CorpusLichEphemeraB",
|
||||||
|
InnateFreezeDamage: "/Lotus/Upgrades/Skins/Effects/CorpusLichEphemeraC",
|
||||||
|
InnateToxinDamage: "/Lotus/Upgrades/Skins/Effects/CorpusLichEphemeraD",
|
||||||
|
InnateMagDamage: "/Lotus/Upgrades/Skins/Effects/CorpusLichEphemeraE",
|
||||||
|
InnateRadDamage: "/Lotus/Upgrades/Skins/Effects/CorpusLichEphemeraF",
|
||||||
|
InnateImpactDamage: "/Lotus/Upgrades/Skins/Effects/CorpusLichEphemeraG"
|
||||||
|
};
|
||||||
|
firstKillReward = "/Lotus/StoreItems/Upgrades/Skins/Clan/CorpusLichBadgeItem";
|
||||||
|
firstConvertReward = "/Lotus/StoreItems/Upgrades/Skins/Sigils/CorpusLichSigil";
|
||||||
|
messageTitle = "/Lotus/Language/Inbox/VanquishLawyerMsgTitle";
|
||||||
|
messageBody = "/Lotus/Language/Inbox/VanquishLichMsgBody";
|
||||||
|
minBuild = "2021.07.05.17.03"; // 30.5.0
|
||||||
|
}
|
||||||
|
|
||||||
|
class LawyerManifestVersionTwo extends LawyerManifest {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.weapons.push("/Lotus/Weapons/Corpus/BoardExec/Secondary/CrpBEPlinx/CrpBEPlinxWeapon");
|
||||||
|
this.minBuild = "2022.11.30.08.13"; // 32.2.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class LawyerManifestVersionThree extends LawyerManifestVersionTwo {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.weapons.push("/Lotus/Weapons/Corpus/BoardExec/Primary/CrpBEGlaxion/CrpBEGlaxion");
|
||||||
|
this.minBuild = "2024.05.15.11.07"; // 35.6.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class LawyerManifestVersionFour extends LawyerManifestVersionThree {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.minBuild = "2024.10.01.11.03"; // 37.0.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class InfestedLichManfest implements INemesisManifest {
|
||||||
|
weapons = [];
|
||||||
|
systemIndexes = [23];
|
||||||
|
showdownNode = "CrewBattleNode559";
|
||||||
|
ephemeraChance = 0;
|
||||||
|
firstKillReward = "/Lotus/StoreItems/Upgrades/Skins/Sigils/InfLichVanquishedSigil";
|
||||||
|
firstConvertReward = "/Lotus/StoreItems/Upgrades/Skins/Sigils/InfLichConvertedSigil";
|
||||||
|
messageTitle = "/Lotus/Language/Inbox/VanquishBandMsgTitle";
|
||||||
|
messageBody = "/Lotus/Language/Inbox/VanquishBandMsgBody";
|
||||||
|
minBuild = "2025.03.18.09.51"; // 38.5.0
|
||||||
|
}
|
||||||
|
|
||||||
|
const nemesisManifests: Record<string, INemesisManifest> = {
|
||||||
|
"/Lotus/Types/Game/Nemesis/KuvaLich/KuvaLichManifest": new KuvaLichManifest(),
|
||||||
|
"/Lotus/Types/Game/Nemesis/KuvaLich/KuvaLichManifestVersionTwo": new KuvaLichManifestVersionTwo(),
|
||||||
|
"/Lotus/Types/Game/Nemesis/KuvaLich/KuvaLichManifestVersionThree": new KuvaLichManifestVersionThree(),
|
||||||
|
"/Lotus/Types/Game/Nemesis/KuvaLich/KuvaLichManifestVersionFour": new KuvaLichManifestVersionFour(),
|
||||||
|
"/Lotus/Types/Game/Nemesis/KuvaLich/KuvaLichManifestVersionFive": new KuvaLichManifestVersionFive(),
|
||||||
|
"/Lotus/Types/Game/Nemesis/KuvaLich/KuvaLichManifestVersionSix": new KuvaLichManifestVersionSix(),
|
||||||
|
"/Lotus/Types/Enemies/Corpus/Lawyers/LawyerManifest": new LawyerManifest(),
|
||||||
|
"/Lotus/Types/Enemies/Corpus/Lawyers/LawyerManifestVersionTwo": new LawyerManifestVersionTwo(),
|
||||||
|
"/Lotus/Types/Enemies/Corpus/Lawyers/LawyerManifestVersionThree": new LawyerManifestVersionThree(),
|
||||||
|
"/Lotus/Types/Enemies/Corpus/Lawyers/LawyerManifestVersionFour": new LawyerManifestVersionFour(),
|
||||||
|
"/Lotus/Types/Enemies/InfestedLich/InfestedLichManifest": new InfestedLichManfest()
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getNemesisManifest = (manifest: string): INemesisManifest => {
|
||||||
|
if (manifest in nemesisManifests) {
|
||||||
|
return nemesisManifests[manifest];
|
||||||
|
}
|
||||||
|
throw new Error(`unknown nemesis manifest: ${manifest}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getInfNodes = (manifest: INemesisManifest, rank: number): IInfNode[] => {
|
||||||
const infNodes = [];
|
const infNodes = [];
|
||||||
const systemIndex = systemIndexes[faction][rank];
|
const systemIndex = manifest.systemIndexes[rank];
|
||||||
for (const [key, value] of Object.entries(ExportRegions)) {
|
for (const [key, value] of Object.entries(ExportRegions)) {
|
||||||
if (
|
if (
|
||||||
value.systemIndex === systemIndex &&
|
value.systemIndex === systemIndex &&
|
||||||
@ -22,7 +210,7 @@ export const getInfNodes = (faction: string, rank: number): IInfNode[] => {
|
|||||||
value.missionIndex != 42 && // not face off
|
value.missionIndex != 42 && // not face off
|
||||||
value.name.indexOf("1999NodeI") == -1 && // not stage defence
|
value.name.indexOf("1999NodeI") == -1 && // not stage defence
|
||||||
value.name.indexOf("1999NodeJ") == -1 && // not lich bounty
|
value.name.indexOf("1999NodeJ") == -1 && // not lich bounty
|
||||||
value.name.indexOf("Archwing") == -1
|
!isArchwingMission(value)
|
||||||
) {
|
) {
|
||||||
//console.log(dict_en[value.name]);
|
//console.log(dict_en[value.name]);
|
||||||
infNodes.push({ Node: key, Influence: 1 });
|
infNodes.push({ Node: key, Influence: 1 });
|
||||||
@ -31,43 +219,95 @@ export const getInfNodes = (faction: string, rank: number): IInfNode[] => {
|
|||||||
return infNodes;
|
return infNodes;
|
||||||
};
|
};
|
||||||
|
|
||||||
const systemIndexes: Record<string, number[]> = {
|
|
||||||
FC_GRINEER: [2, 3, 9, 11, 18],
|
|
||||||
FC_CORPUS: [1, 15, 4, 7, 8],
|
|
||||||
FC_INFESTATION: [23]
|
|
||||||
};
|
|
||||||
|
|
||||||
// Get a parazon 'passcode' based on the nemesis fingerprint so it's always the same for the same nemesis.
|
// Get a parazon 'passcode' based on the nemesis fingerprint so it's always the same for the same nemesis.
|
||||||
export const getNemesisPasscode = (nemesis: { fp: bigint; Faction: string }): number[] => {
|
export const getNemesisPasscode = (nemesis: { fp: bigint; Faction: TNemesisFaction }): number[] => {
|
||||||
const rng = new SRng(nemesis.fp);
|
const rng = new SRng(nemesis.fp);
|
||||||
const passcode = [rng.randomInt(0, 7)];
|
const choices = [0, 1, 2, 3, 5, 6, 7];
|
||||||
|
let choiceIndex = rng.randomInt(0, choices.length - 1);
|
||||||
|
const passcode = [choices[choiceIndex]];
|
||||||
if (nemesis.Faction != "FC_INFESTATION") {
|
if (nemesis.Faction != "FC_INFESTATION") {
|
||||||
passcode.push(rng.randomInt(0, 7));
|
choices.splice(choiceIndex, 1);
|
||||||
passcode.push(rng.randomInt(0, 7));
|
choiceIndex = rng.randomInt(0, choices.length - 1);
|
||||||
|
passcode.push(choices[choiceIndex]);
|
||||||
|
|
||||||
|
choices.splice(choiceIndex, 1);
|
||||||
|
choiceIndex = rng.randomInt(0, choices.length - 1);
|
||||||
|
passcode.push(choices[choiceIndex]);
|
||||||
}
|
}
|
||||||
return passcode;
|
return passcode;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const encodeNemesisGuess = (
|
const requiemMods: readonly string[] = [
|
||||||
symbol1: number,
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalOneMod",
|
||||||
result1: number,
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalTwoMod",
|
||||||
symbol2: number,
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalThreeMod",
|
||||||
result2: number,
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalFourMod",
|
||||||
symbol3: number,
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalFiveMod",
|
||||||
result3: number
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalSixMod",
|
||||||
): number => {
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalSevenMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalEightMod"
|
||||||
|
];
|
||||||
|
|
||||||
|
const antivirusMods: readonly string[] = [
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusOneMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusTwoMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusThreeMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusFourMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusFiveMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusSixMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusSevenMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusEightMod"
|
||||||
|
];
|
||||||
|
|
||||||
|
export const getNemesisPasscodeModTypes = (nemesis: { fp: bigint; Faction: TNemesisFaction }): string[] => {
|
||||||
|
const passcode = getNemesisPasscode(nemesis);
|
||||||
|
return nemesis.Faction == "FC_INFESTATION"
|
||||||
|
? passcode.map(i => antivirusMods[i])
|
||||||
|
: passcode.map(i => requiemMods[i]);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Symbols; 0-7 are the normal requiem mods.
|
||||||
|
export const GUESS_NONE = 8;
|
||||||
|
export const GUESS_WILDCARD = 9;
|
||||||
|
|
||||||
|
// Results; there are 3, 4, 5 as well which are more muted versions but unused afaik.
|
||||||
|
export const GUESS_NEUTRAL = 0;
|
||||||
|
export const GUESS_INCORRECT = 1;
|
||||||
|
export const GUESS_CORRECT = 2;
|
||||||
|
|
||||||
|
interface NemesisPositionGuess {
|
||||||
|
symbol: number;
|
||||||
|
result: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type NemesisGuess = [NemesisPositionGuess, NemesisPositionGuess, NemesisPositionGuess];
|
||||||
|
|
||||||
|
export const encodeNemesisGuess = (guess: NemesisGuess): number => {
|
||||||
return (
|
return (
|
||||||
(symbol1 & 0xf) |
|
(guess[0].symbol & 0xf) |
|
||||||
((result1 & 3) << 12) |
|
((guess[0].result & 3) << 12) |
|
||||||
((symbol2 << 4) & 0xff) |
|
((guess[1].symbol << 4) & 0xff) |
|
||||||
((result2 << 14) & 0xffff) |
|
((guess[1].result << 14) & 0xffff) |
|
||||||
((symbol3 & 0xf) << 8) |
|
((guess[2].symbol & 0xf) << 8) |
|
||||||
((result3 & 3) << 16)
|
((guess[2].result & 3) << 16)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeNemesisGuess = (val: number): number[] => {
|
export const decodeNemesisGuess = (val: number): NemesisGuess => {
|
||||||
return [val & 0xf, (val >> 12) & 3, (val & 0xff) >> 4, (val & 0xffff) >> 14, (val >> 8) & 0xf, (val >> 16) & 3];
|
return [
|
||||||
|
{
|
||||||
|
symbol: val & 0xf,
|
||||||
|
result: (val >> 12) & 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
symbol: (val & 0xff) >> 4,
|
||||||
|
result: (val & 0xffff) >> 14
|
||||||
|
},
|
||||||
|
{
|
||||||
|
symbol: (val >> 8) & 0xf,
|
||||||
|
result: (val >> 16) & 3
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IKnifeResponse {
|
export interface IKnifeResponse {
|
||||||
@ -78,6 +318,31 @@ export interface IKnifeResponse {
|
|||||||
HasKnife?: boolean;
|
HasKnife?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getKnifeUpgrade = (
|
||||||
|
inventory: TInventoryDatabaseDocument,
|
||||||
|
dataknifeUpgrades: string[],
|
||||||
|
type: string
|
||||||
|
): { ItemId: IOid; ItemType: string } => {
|
||||||
|
if (dataknifeUpgrades.indexOf(type) != -1) {
|
||||||
|
return {
|
||||||
|
ItemId: { $oid: "000000000000000000000000" },
|
||||||
|
ItemType: type
|
||||||
|
};
|
||||||
|
}
|
||||||
|
for (const upgradeId of dataknifeUpgrades) {
|
||||||
|
if (upgradeId.length == 24) {
|
||||||
|
const upgrade = inventory.Upgrades.id(upgradeId);
|
||||||
|
if (upgrade && upgrade.ItemType == type) {
|
||||||
|
return {
|
||||||
|
ItemId: { $oid: upgradeId },
|
||||||
|
ItemType: type
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Error(`${type} does not seem to be installed on parazon?!`);
|
||||||
|
};
|
||||||
|
|
||||||
export const consumeModCharge = (
|
export const consumeModCharge = (
|
||||||
response: IKnifeResponse,
|
response: IKnifeResponse,
|
||||||
inventory: TInventoryDatabaseDocument,
|
inventory: TInventoryDatabaseDocument,
|
||||||
@ -128,3 +393,121 @@ export const consumeModCharge = (
|
|||||||
response.UpgradeNew.push(true);
|
response.UpgradeNew.push(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getInnateDamageTag = (KillingSuit: string): TInnateDamageTag => {
|
||||||
|
return ExportWarframes[KillingSuit].nemesisUpgradeTag!;
|
||||||
|
};
|
||||||
|
|
||||||
|
const petHeads = [
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetParts/ZanukaPetPartHeadA",
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetParts/ZanukaPetPartHeadB",
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetParts/ZanukaPetPartHeadC"
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
export interface INemesisProfile {
|
||||||
|
innateDamageTag: TInnateDamageTag;
|
||||||
|
innateDamageValue: number;
|
||||||
|
ephemera?: string;
|
||||||
|
petHead?: (typeof petHeads)[number];
|
||||||
|
petBody?: string;
|
||||||
|
petLegs?: string;
|
||||||
|
petTail?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const generateNemesisProfile = (
|
||||||
|
fp: bigint = generateRewardSeed(),
|
||||||
|
manifest: INemesisManifest = new LawyerManifest(),
|
||||||
|
killingSuit: string = "/Lotus/Powersuits/Ember/Ember"
|
||||||
|
): INemesisProfile => {
|
||||||
|
const rng = new SRng(fp);
|
||||||
|
rng.randomFloat(); // used for the weapon index
|
||||||
|
const WeaponUpgradeValueAttenuationExponent = 2.25;
|
||||||
|
let value = Math.pow(rng.randomFloat(), WeaponUpgradeValueAttenuationExponent);
|
||||||
|
if (value >= 0.941428) {
|
||||||
|
value = 1;
|
||||||
|
}
|
||||||
|
const profile: INemesisProfile = {
|
||||||
|
innateDamageTag: getInnateDamageTag(killingSuit),
|
||||||
|
innateDamageValue: Math.trunc(value * 0x40000000) // TODO: For -1399275245665749231n, the value should be 75306944, but we're off by 59 with 75307003.
|
||||||
|
};
|
||||||
|
if (rng.randomFloat() <= manifest.ephemeraChance && manifest.ephemeraTypes) {
|
||||||
|
profile.ephemera = manifest.ephemeraTypes[profile.innateDamageTag];
|
||||||
|
}
|
||||||
|
rng.randomFloat(); // something related to sentinel agent maybe
|
||||||
|
if (manifest instanceof LawyerManifest) {
|
||||||
|
profile.petHead = rng.randomElement(petHeads)!;
|
||||||
|
profile.petBody = rng.randomElement([
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetParts/ZanukaPetPartBodyA",
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetParts/ZanukaPetPartBodyB",
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetParts/ZanukaPetPartBodyC"
|
||||||
|
])!;
|
||||||
|
profile.petLegs = rng.randomElement([
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetParts/ZanukaPetPartLegsA",
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetParts/ZanukaPetPartLegsB",
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetParts/ZanukaPetPartLegsC"
|
||||||
|
])!;
|
||||||
|
profile.petTail = rng.randomElement([
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetParts/ZanukaPetPartTailA",
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetParts/ZanukaPetPartTailB",
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetParts/ZanukaPetPartTailC"
|
||||||
|
])!;
|
||||||
|
}
|
||||||
|
return profile;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getKillTokenRewardCount = (fp: bigint): number => {
|
||||||
|
const rng = new SRng(fp);
|
||||||
|
return rng.randomInt(10, 15);
|
||||||
|
};
|
||||||
|
|
||||||
|
// /Lotus/Types/Enemies/InfestedLich/InfestedLichRewardManifest
|
||||||
|
const infestedLichRotA = [
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/Plushies/PlushyDJRomHuman", probability: 0.046 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/Plushies/PlushyDJRomInfested", probability: 0.045 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/Plushies/PlushyDrillbitHuman", probability: 0.046 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/Plushies/PlushyDrillbitInfested", probability: 0.045 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/Plushies/PlushyHarddriveHuman", probability: 0.046 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/Plushies/PlushyHarddriveInfested", probability: 0.045 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/Plushies/PlushyPacketHuman", probability: 0.046 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/Plushies/PlushyPacketInfested", probability: 0.045 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/Plushies/PlushyZekeHuman", probability: 0.046 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/Plushies/PlushyZekeInfested", probability: 0.045 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/BoybandPosters/BoybandBillboardPosterA", probability: 0.045 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/BoybandPosters/BoybandBillboardPosterB", probability: 0.046 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/BoybandPosters/BoybandDespairPoster", probability: 0.045 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/BoybandPosters/BoybandGridPoster", probability: 0.046 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/BoybandPosters/BoybandHuddlePoster", probability: 0.045 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/BoybandPosters/BoybandJumpPoster", probability: 0.046 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/BoybandPosters/BoybandLimoPoster", probability: 0.045 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/BoybandPosters/BoybandLookingDownPosterDay", probability: 0.046 },
|
||||||
|
{
|
||||||
|
type: "/Lotus/StoreItems/Types/Items/ShipDecos/BoybandPosters/BoybandLookingDownPosterNight",
|
||||||
|
probability: 0.045
|
||||||
|
},
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/BoybandPosters/BoybandSillyPoster", probability: 0.046 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/BoybandPosters/BoybandWhiteBluePoster", probability: 0.045 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/ShipDecos/BoybandPosters/BoybandWhitePinkPoster", probability: 0.045 }
|
||||||
|
];
|
||||||
|
const infestedLichRotB = [
|
||||||
|
{ type: "/Lotus/StoreItems/Upgrades/Skins/Effects/InfestedLichEphemeraA", probability: 0.072 },
|
||||||
|
{ type: "/Lotus/StoreItems/Upgrades/Skins/Effects/InfestedLichEphemeraB", probability: 0.071 },
|
||||||
|
{ type: "/Lotus/StoreItems/Upgrades/Skins/Effects/InfestedLichEphemeraC", probability: 0.072 },
|
||||||
|
{ type: "/Lotus/StoreItems/Upgrades/Skins/Effects/InfestedLichEphemeraD", probability: 0.071 },
|
||||||
|
{ type: "/Lotus/StoreItems/Upgrades/Skins/Effects/InfestedLichEphemeraE", probability: 0.072 },
|
||||||
|
{ type: "/Lotus/StoreItems/Upgrades/Skins/Effects/InfestedLichEphemeraF", probability: 0.071 },
|
||||||
|
{ type: "/Lotus/StoreItems/Upgrades/Skins/Effects/InfestedLichEphemeraG", probability: 0.071 },
|
||||||
|
{ type: "/Lotus/StoreItems/Upgrades/Skins/Effects/InfestedLichEphemeraH", probability: 0.072 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/Emotes/DanceDJRomHype", probability: 0.071 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/Emotes/DancePacketWindmillShuffle", probability: 0.072 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/Emotes/DanceHarddrivePony", probability: 0.071 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/Emotes/DanceDrillbitCrisscross", probability: 0.072 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/Emotes/DanceZekeCanthavethis", probability: 0.071 },
|
||||||
|
{ type: "/Lotus/StoreItems/Types/Items/PhotoBooth/PhotoboothTileRJLasXStadiumBossArena", probability: 0.071 }
|
||||||
|
];
|
||||||
|
export const getInfestedLichItemRewards = (fp: bigint): string[] => {
|
||||||
|
const rng = new SRng(fp);
|
||||||
|
const rotAReward = getRewardAtPercentage(infestedLichRotA, rng.randomFloat())!.type;
|
||||||
|
rng.randomFloat(); // unused afaict
|
||||||
|
const rotBReward = getRewardAtPercentage(infestedLichRotB, rng.randomFloat())!.type;
|
||||||
|
return [rotAReward, rotBReward];
|
||||||
|
};
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
export const rootDir = path.join(__dirname, "../..");
|
export const rootDir = path.join(__dirname, "../..");
|
||||||
export const repoDir = path.basename(rootDir) == "build" ? path.join(rootDir, "..") : rootDir;
|
export const isDev = path.basename(rootDir) != "build";
|
||||||
|
export const repoDir = isDev ? rootDir : path.join(rootDir, "..");
|
||||||
|
@ -31,7 +31,7 @@ export interface IFingerprintStat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const createVeiledRivenFingerprint = (meta: IUpgrade): IVeiledRivenFingerprint => {
|
export const createVeiledRivenFingerprint = (meta: IUpgrade): IVeiledRivenFingerprint => {
|
||||||
const challenge = getRandomElement(meta.availableChallenges!);
|
const challenge = getRandomElement(meta.availableChallenges!)!;
|
||||||
const fingerprintChallenge: IRivenChallenge = {
|
const fingerprintChallenge: IRivenChallenge = {
|
||||||
Type: challenge.fullName,
|
Type: challenge.fullName,
|
||||||
Progress: 0,
|
Progress: 0,
|
||||||
@ -54,11 +54,11 @@ export const createVeiledRivenFingerprint = (meta: IUpgrade): IVeiledRivenFinger
|
|||||||
|
|
||||||
export const createUnveiledRivenFingerprint = (meta: IUpgrade): IUnveiledRivenFingerprint => {
|
export const createUnveiledRivenFingerprint = (meta: IUpgrade): IUnveiledRivenFingerprint => {
|
||||||
const fingerprint: IUnveiledRivenFingerprint = {
|
const fingerprint: IUnveiledRivenFingerprint = {
|
||||||
compat: getRandomElement(meta.compatibleItems!),
|
compat: getRandomElement(meta.compatibleItems!)!,
|
||||||
lim: 0,
|
lim: 0,
|
||||||
lvl: 0,
|
lvl: 0,
|
||||||
lvlReq: getRandomInt(8, 16),
|
lvlReq: getRandomInt(8, 16),
|
||||||
pol: getRandomElement(["AP_ATTACK", "AP_DEFENSE", "AP_TACTIC"]),
|
pol: getRandomElement(["AP_ATTACK", "AP_DEFENSE", "AP_TACTIC"])!,
|
||||||
buffs: [],
|
buffs: [],
|
||||||
curses: []
|
curses: []
|
||||||
};
|
};
|
||||||
@ -81,7 +81,7 @@ export const randomiseRivenStats = (meta: IUpgrade, fingerprint: IUnveiledRivenF
|
|||||||
if (Math.random() < 0.5) {
|
if (Math.random() < 0.5) {
|
||||||
const entry = getRandomElement(
|
const entry = getRandomElement(
|
||||||
meta.upgradeEntries!.filter(x => x.canBeCurse && !fingerprint.buffs.find(y => y.Tag == x.tag))
|
meta.upgradeEntries!.filter(x => x.canBeCurse && !fingerprint.buffs.find(y => y.Tag == x.tag))
|
||||||
);
|
)!;
|
||||||
fingerprint.curses.push({ Tag: entry.tag, Value: Math.trunc(Math.random() * 0x40000000) });
|
fingerprint.curses.push({ Tag: entry.tag, Value: Math.trunc(Math.random() * 0x40000000) });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@ import { JSONParse } from "json-with-bigint";
|
|||||||
|
|
||||||
export const getJSONfromString = <T>(str: string): T => {
|
export const getJSONfromString = <T>(str: string): T => {
|
||||||
const jsonSubstring = str.substring(0, str.lastIndexOf("}") + 1);
|
const jsonSubstring = str.substring(0, str.lastIndexOf("}") + 1);
|
||||||
return JSONParse<T>(jsonSubstring);
|
return JSONParse(jsonSubstring) as T;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getSubstringFromKeyword = (str: string, keyword: string): string => {
|
export const getSubstringFromKeyword = (str: string, keyword: string): string => {
|
||||||
|
@ -10,3 +10,14 @@ export const getMaxStanding = (syndicate: ISyndicate, title: number): number =>
|
|||||||
}
|
}
|
||||||
return syndicate.titles.find(x => x.level == title)!.maxStanding;
|
return syndicate.titles.find(x => x.level == title)!.maxStanding;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getMinStanding = (syndicate: ISyndicate, title: number): number => {
|
||||||
|
if (!syndicate.titles) {
|
||||||
|
// LibrarySyndicate
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (title == 0) {
|
||||||
|
return syndicate.titles.find(x => x.level == -1)!.maxStanding;
|
||||||
|
}
|
||||||
|
return syndicate.titles.find(x => x.level == title)!.minStanding;
|
||||||
|
};
|
||||||
|
33
src/index.ts
33
src/index.ts
@ -12,18 +12,14 @@ import { logger } from "@/src/utils/logger";
|
|||||||
logger.info("Starting up...");
|
logger.info("Starting up...");
|
||||||
|
|
||||||
// Proceed with normal startup: bring up config watcher service, validate config, connect to MongoDB, and finally start listening for HTTP.
|
// Proceed with normal startup: bring up config watcher service, validate config, connect to MongoDB, and finally start listening for HTTP.
|
||||||
import http from "http";
|
|
||||||
import https from "https";
|
|
||||||
import fs from "node:fs";
|
|
||||||
import { app } from "./app";
|
|
||||||
import mongoose from "mongoose";
|
import mongoose from "mongoose";
|
||||||
import { Json, JSONStringify } from "json-with-bigint";
|
import { JSONStringify } from "json-with-bigint";
|
||||||
|
import { startWebServer } from "./services/webService";
|
||||||
|
|
||||||
import { validateConfig } from "@/src/services/configWatcherService";
|
import { validateConfig } from "@/src/services/configWatcherService";
|
||||||
|
|
||||||
// Patch JSON.stringify to work flawlessly with Bigints.
|
// Patch JSON.stringify to work flawlessly with Bigints.
|
||||||
JSON.stringify = (obj: Exclude<Json, undefined>, _replacer?: unknown, space?: string | number): string => {
|
JSON.stringify = JSONStringify;
|
||||||
return JSONStringify(obj, space);
|
|
||||||
};
|
|
||||||
|
|
||||||
validateConfig();
|
validateConfig();
|
||||||
|
|
||||||
@ -31,26 +27,7 @@ mongoose
|
|||||||
.connect(config.mongodbUrl)
|
.connect(config.mongodbUrl)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
logger.info("Connected to MongoDB");
|
logger.info("Connected to MongoDB");
|
||||||
|
startWebServer();
|
||||||
const httpPort = config.httpPort || 80;
|
|
||||||
const httpsPort = config.httpsPort || 443;
|
|
||||||
const options = {
|
|
||||||
key: fs.readFileSync("static/certs/key.pem"),
|
|
||||||
cert: fs.readFileSync("static/certs/cert.pem")
|
|
||||||
};
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
||||||
http.createServer(app).listen(httpPort, () => {
|
|
||||||
logger.info("HTTP server started on port " + httpPort);
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
||||||
https.createServer(options, app).listen(httpsPort, () => {
|
|
||||||
logger.info("HTTPS server started on port " + httpsPort);
|
|
||||||
|
|
||||||
logger.info(
|
|
||||||
"Access the WebUI in your browser at http://localhost" + (httpPort == 80 ? "" : ":" + httpPort)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import { ISession, IFindSessionRequest } from "@/src/types/session";
|
import { ISession, IFindSessionRequest } from "@/src/types/session";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
|
import { JSONParse } from "json-with-bigint";
|
||||||
|
import { Types } from "mongoose";
|
||||||
|
|
||||||
const sessions: ISession[] = [];
|
const sessions: ISession[] = [];
|
||||||
|
|
||||||
function createNewSession(sessionData: ISession, Creator: string): ISession {
|
function createNewSession(sessionData: ISession, Creator: Types.ObjectId): ISession {
|
||||||
const sessionId = getNewSessionID();
|
const sessionId = new Types.ObjectId();
|
||||||
const newSession: ISession = {
|
const newSession: ISession = {
|
||||||
sessionId,
|
sessionId,
|
||||||
creatorId: Creator,
|
creatorId: Creator,
|
||||||
@ -25,7 +27,7 @@ function createNewSession(sessionData: ISession, Creator: string): ISession {
|
|||||||
customSettings: sessionData.customSettings || "",
|
customSettings: sessionData.customSettings || "",
|
||||||
rewardSeed: sessionData.rewardSeed || -1,
|
rewardSeed: sessionData.rewardSeed || -1,
|
||||||
guildId: sessionData.guildId || "",
|
guildId: sessionData.guildId || "",
|
||||||
buildId: sessionData.buildId || 4920386201513015989,
|
buildId: sessionData.buildId || 4920386201513015989n,
|
||||||
platform: sessionData.platform || 0,
|
platform: sessionData.platform || 0,
|
||||||
xplatform: sessionData.xplatform || true,
|
xplatform: sessionData.xplatform || true,
|
||||||
freePublic: sessionData.freePublic || 3,
|
freePublic: sessionData.freePublic || 3,
|
||||||
@ -40,13 +42,15 @@ function getAllSessions(): ISession[] {
|
|||||||
return sessions;
|
return sessions;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSessionByID(sessionId: string): ISession | undefined {
|
function getSessionByID(sessionId: string | Types.ObjectId): ISession | undefined {
|
||||||
return sessions.find(session => session.sessionId === sessionId);
|
return sessions.find(session => session.sessionId.equals(sessionId));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSession(sessionIdOrRequest: string | IFindSessionRequest): { createdBy: string; id: string }[] {
|
function getSession(
|
||||||
if (typeof sessionIdOrRequest === "string") {
|
sessionIdOrRequest: string | Types.ObjectId | IFindSessionRequest
|
||||||
const session = sessions.find(session => session.sessionId === sessionIdOrRequest);
|
): { createdBy: Types.ObjectId; id: Types.ObjectId }[] {
|
||||||
|
if (typeof sessionIdOrRequest === "string" || sessionIdOrRequest instanceof Types.ObjectId) {
|
||||||
|
const session = sessions.find(session => session.sessionId.equals(sessionIdOrRequest));
|
||||||
if (session) {
|
if (session) {
|
||||||
logger.debug("Found Sessions:", { session });
|
logger.debug("Found Sessions:", { session });
|
||||||
return [
|
return [
|
||||||
@ -79,35 +83,15 @@ function getSession(sessionIdOrRequest: string | IFindSessionRequest): { created
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSessionByCreatorID(creatorId: string): ISession | undefined {
|
function getSessionByCreatorID(creatorId: string | Types.ObjectId): ISession | undefined {
|
||||||
return sessions.find(session => session.creatorId === creatorId);
|
return sessions.find(session => session.creatorId.equals(creatorId));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNewSessionID(): string {
|
function updateSession(sessionId: string | Types.ObjectId, sessionData: string): boolean {
|
||||||
const characters = "0123456789abcdef";
|
const session = sessions.find(session => session.sessionId.equals(sessionId));
|
||||||
const maxAttempts = 100;
|
|
||||||
let sessionId = "";
|
|
||||||
|
|
||||||
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
||||||
sessionId = "64";
|
|
||||||
for (let i = 0; i < 22; i++) {
|
|
||||||
const randomIndex = Math.floor(Math.random() * characters.length);
|
|
||||||
sessionId += characters[randomIndex];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!sessions.some(session => session.sessionId === sessionId)) {
|
|
||||||
return sessionId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Error("Failed to generate a unique session ID");
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateSession(sessionId: string, sessionData: string): boolean {
|
|
||||||
const session = sessions.find(session => session.sessionId === sessionId);
|
|
||||||
if (!session) return false;
|
if (!session) return false;
|
||||||
try {
|
try {
|
||||||
Object.assign(session, JSON.parse(sessionData));
|
Object.assign(session, JSONParse(sessionData));
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Invalid JSON string for session update.");
|
console.error("Invalid JSON string for session update.");
|
||||||
@ -115,8 +99,8 @@ function updateSession(sessionId: string, sessionData: string): boolean {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteSession(sessionId: string): boolean {
|
function deleteSession(sessionId: string | Types.ObjectId): boolean {
|
||||||
const index = sessions.findIndex(session => session.sessionId === sessionId);
|
const index = sessions.findIndex(session => session.sessionId.equals(sessionId));
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
sessions.splice(index, 1);
|
sessions.splice(index, 1);
|
||||||
return true;
|
return true;
|
||||||
@ -129,7 +113,6 @@ export {
|
|||||||
getAllSessions,
|
getAllSessions,
|
||||||
getSessionByID,
|
getSessionByID,
|
||||||
getSessionByCreatorID,
|
getSessionByCreatorID,
|
||||||
getNewSessionID,
|
|
||||||
updateSession,
|
updateSession,
|
||||||
deleteSession,
|
deleteSession,
|
||||||
getSession
|
getSession
|
||||||
|
15
src/models/friendModel.ts
Normal file
15
src/models/friendModel.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { IFriendship } from "@/src/types/friendTypes";
|
||||||
|
import { model, Schema } from "mongoose";
|
||||||
|
|
||||||
|
const friendshipSchema = new Schema<IFriendship>({
|
||||||
|
owner: { type: Schema.Types.ObjectId, required: true },
|
||||||
|
friend: { type: Schema.Types.ObjectId, required: true },
|
||||||
|
Note: String,
|
||||||
|
Favorite: Boolean
|
||||||
|
});
|
||||||
|
|
||||||
|
friendshipSchema.index({ owner: 1 });
|
||||||
|
friendshipSchema.index({ friend: 1 });
|
||||||
|
friendshipSchema.index({ owner: 1, friend: 1 }, { unique: true });
|
||||||
|
|
||||||
|
export const Friendship = model<IFriendship>("Friendship", friendshipSchema);
|
@ -13,7 +13,8 @@ import {
|
|||||||
IDojoLeaderboardEntry,
|
IDojoLeaderboardEntry,
|
||||||
IGuildAdDatabase,
|
IGuildAdDatabase,
|
||||||
IAllianceDatabase,
|
IAllianceDatabase,
|
||||||
IAllianceMemberDatabase
|
IAllianceMemberDatabase,
|
||||||
|
GuildPermission
|
||||||
} from "@/src/types/guildTypes";
|
} from "@/src/types/guildTypes";
|
||||||
import { Document, Model, model, Schema, Types } from "mongoose";
|
import { Document, Model, model, Schema, Types } from "mongoose";
|
||||||
import { fusionTreasuresSchema, typeCountSchema } from "./inventoryModels/inventoryModel";
|
import { fusionTreasuresSchema, typeCountSchema } from "./inventoryModels/inventoryModel";
|
||||||
@ -23,6 +24,7 @@ const dojoDecoSchema = new Schema<IDojoDecoDatabase>({
|
|||||||
Type: String,
|
Type: String,
|
||||||
Pos: [Number],
|
Pos: [Number],
|
||||||
Rot: [Number],
|
Rot: [Number],
|
||||||
|
Scale: Number,
|
||||||
Name: String,
|
Name: String,
|
||||||
Sockets: Number,
|
Sockets: Number,
|
||||||
RegularCredits: Number,
|
RegularCredits: Number,
|
||||||
@ -107,31 +109,31 @@ const defaultRanks: IGuildRank[] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "/Lotus/Language/Game/Rank_General",
|
Name: "/Lotus/Language/Game/Rank_General",
|
||||||
Permissions: 4318
|
Permissions: GuildPermission.Host | 4318
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "/Lotus/Language/Game/Rank_Officer",
|
Name: "/Lotus/Language/Game/Rank_Officer",
|
||||||
Permissions: 4314
|
Permissions: GuildPermission.Host | 4314
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "/Lotus/Language/Game/Rank_Leader",
|
Name: "/Lotus/Language/Game/Rank_Leader",
|
||||||
Permissions: 4106
|
Permissions: GuildPermission.Host | 4106
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "/Lotus/Language/Game/Rank_Sage",
|
Name: "/Lotus/Language/Game/Rank_Sage",
|
||||||
Permissions: 4304
|
Permissions: GuildPermission.Host | 4304
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "/Lotus/Language/Game/Rank_Soldier",
|
Name: "/Lotus/Language/Game/Rank_Soldier",
|
||||||
Permissions: 4098
|
Permissions: GuildPermission.Host | 4098
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "/Lotus/Language/Game/Rank_Initiate",
|
Name: "/Lotus/Language/Game/Rank_Initiate",
|
||||||
Permissions: 4096
|
Permissions: GuildPermission.Host | GuildPermission.Fabricator
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "/Lotus/Language/Game/Rank_Utility",
|
Name: "/Lotus/Language/Game/Rank_Utility",
|
||||||
Permissions: 4096
|
Permissions: GuildPermission.Host | GuildPermission.Fabricator
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -38,7 +38,8 @@ import {
|
|||||||
IPeriodicMissionCompletionResponse,
|
IPeriodicMissionCompletionResponse,
|
||||||
ILoreFragmentScan,
|
ILoreFragmentScan,
|
||||||
IEvolutionProgress,
|
IEvolutionProgress,
|
||||||
IEndlessXpProgress,
|
IEndlessXpProgressDatabase,
|
||||||
|
IEndlessXpProgressClient,
|
||||||
ICrewShipCustomization,
|
ICrewShipCustomization,
|
||||||
ICrewShipWeapon,
|
ICrewShipWeapon,
|
||||||
ICrewShipWeaponEmplacements,
|
ICrewShipWeaponEmplacements,
|
||||||
@ -96,7 +97,9 @@ import {
|
|||||||
IInvasionProgressDatabase,
|
IInvasionProgressDatabase,
|
||||||
IInvasionProgressClient,
|
IInvasionProgressClient,
|
||||||
IAccolades,
|
IAccolades,
|
||||||
IHubNpcCustomization
|
IHubNpcCustomization,
|
||||||
|
ILotusCustomization,
|
||||||
|
IEndlessXpReward
|
||||||
} from "../../types/inventoryTypes/inventoryTypes";
|
} from "../../types/inventoryTypes/inventoryTypes";
|
||||||
import { IOid } from "../../types/commonTypes";
|
import { IOid } from "../../types/commonTypes";
|
||||||
import {
|
import {
|
||||||
@ -111,6 +114,7 @@ import {
|
|||||||
} from "@/src/types/inventoryTypes/commonInventoryTypes";
|
} from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { EquipmentSelectionSchema, oidSchema } from "./loadoutModel";
|
import { EquipmentSelectionSchema, oidSchema } from "./loadoutModel";
|
||||||
|
import { ICountedStoreItem } from "warframe-public-export-plus";
|
||||||
|
|
||||||
export const typeCountSchema = new Schema<ITypeCount>({ ItemType: String, ItemCount: Number }, { _id: false });
|
export const typeCountSchema = new Schema<ITypeCount>({ ItemType: String, ItemCount: Number }, { _id: false });
|
||||||
|
|
||||||
@ -390,8 +394,8 @@ MailboxSchema.set("toJSON", {
|
|||||||
|
|
||||||
const DuviriInfoSchema = new Schema<IDuviriInfo>(
|
const DuviriInfoSchema = new Schema<IDuviriInfo>(
|
||||||
{
|
{
|
||||||
Seed: Number,
|
Seed: { type: BigInt, required: true },
|
||||||
NumCompletions: { type: Number, default: 0 }
|
NumCompletions: { type: Number, required: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
_id: false,
|
_id: false,
|
||||||
@ -780,6 +784,26 @@ const loreFragmentScansSchema = new Schema<ILoreFragmentScan>(
|
|||||||
{ _id: false }
|
{ _id: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// const lotusCustomizationSchema = new Schema<ILotusCustomization>().add(ItemConfigSchema).add({
|
||||||
|
// Persona: String
|
||||||
|
// });
|
||||||
|
|
||||||
|
// Laxer schema for cleanupInventory
|
||||||
|
const lotusCustomizationSchema = new Schema<ILotusCustomization>(
|
||||||
|
{
|
||||||
|
Skins: [String],
|
||||||
|
pricol: colorSchema,
|
||||||
|
attcol: Schema.Types.Mixed,
|
||||||
|
sigcol: Schema.Types.Mixed,
|
||||||
|
eyecol: Schema.Types.Mixed,
|
||||||
|
facial: Schema.Types.Mixed,
|
||||||
|
cloth: Schema.Types.Mixed,
|
||||||
|
syancol: Schema.Types.Mixed,
|
||||||
|
Persona: String
|
||||||
|
},
|
||||||
|
{ _id: false }
|
||||||
|
);
|
||||||
|
|
||||||
const evolutionProgressSchema = new Schema<IEvolutionProgress>(
|
const evolutionProgressSchema = new Schema<IEvolutionProgress>(
|
||||||
{
|
{
|
||||||
Progress: Number,
|
Progress: Number,
|
||||||
@ -789,14 +813,48 @@ const evolutionProgressSchema = new Schema<IEvolutionProgress>(
|
|||||||
{ _id: false }
|
{ _id: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
const endlessXpProgressSchema = new Schema<IEndlessXpProgress>(
|
const countedStoreItemSchema = new Schema<ICountedStoreItem>(
|
||||||
{
|
{
|
||||||
Category: String,
|
StoreItem: String,
|
||||||
Choices: [String]
|
ItemCount: Number
|
||||||
},
|
},
|
||||||
{ _id: false }
|
{ _id: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const endlessXpRewardSchema = new Schema<IEndlessXpReward>(
|
||||||
|
{
|
||||||
|
RequiredTotalXp: Number,
|
||||||
|
Rewards: [countedStoreItemSchema]
|
||||||
|
},
|
||||||
|
{ _id: false }
|
||||||
|
);
|
||||||
|
|
||||||
|
const endlessXpProgressSchema = new Schema<IEndlessXpProgressDatabase>(
|
||||||
|
{
|
||||||
|
Category: { type: String, required: true },
|
||||||
|
Earn: { type: Number, default: 0 },
|
||||||
|
Claim: { type: Number, default: 0 },
|
||||||
|
BonusAvailable: Date,
|
||||||
|
Expiry: Date,
|
||||||
|
Choices: { type: [String], required: true },
|
||||||
|
PendingRewards: { type: [endlessXpRewardSchema], default: [] }
|
||||||
|
},
|
||||||
|
{ _id: false }
|
||||||
|
);
|
||||||
|
|
||||||
|
endlessXpProgressSchema.set("toJSON", {
|
||||||
|
transform(_doc, ret) {
|
||||||
|
const db = ret as IEndlessXpProgressDatabase;
|
||||||
|
const client = ret as IEndlessXpProgressClient;
|
||||||
|
|
||||||
|
if (db.BonusAvailable) {
|
||||||
|
client.BonusAvailable = toMongoDate(db.BonusAvailable);
|
||||||
|
}
|
||||||
|
if (db.Expiry) {
|
||||||
|
client.Expiry = toMongoDate(db.Expiry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
const crewShipWeaponEmplacementsSchema = new Schema<ICrewShipWeaponEmplacements>(
|
const crewShipWeaponEmplacementsSchema = new Schema<ICrewShipWeaponEmplacements>(
|
||||||
{
|
{
|
||||||
PRIMARY_A: EquipmentSelectionSchema,
|
PRIMARY_A: EquipmentSelectionSchema,
|
||||||
@ -1034,10 +1092,13 @@ const pendingRecipeSchema = new Schema<IPendingRecipeDatabase>(
|
|||||||
{
|
{
|
||||||
ItemType: String,
|
ItemType: String,
|
||||||
CompletionDate: Date,
|
CompletionDate: Date,
|
||||||
|
TargetItemId: String,
|
||||||
|
TargetFingerprint: String,
|
||||||
LongGuns: { type: [EquipmentSchema], default: undefined },
|
LongGuns: { type: [EquipmentSchema], default: undefined },
|
||||||
Pistols: { type: [EquipmentSchema], default: undefined },
|
Pistols: { type: [EquipmentSchema], default: undefined },
|
||||||
Melee: { type: [EquipmentSchema], default: undefined },
|
Melee: { type: [EquipmentSchema], default: undefined },
|
||||||
SuitToUnbrand: { type: Schema.Types.ObjectId, default: undefined }
|
SuitToUnbrand: { type: Schema.Types.ObjectId, default: undefined },
|
||||||
|
KubrowPet: { type: Schema.Types.ObjectId, default: undefined }
|
||||||
},
|
},
|
||||||
{ id: false }
|
{ id: false }
|
||||||
);
|
);
|
||||||
@ -1055,6 +1116,7 @@ pendingRecipeSchema.set("toJSON", {
|
|||||||
delete returnedObject.Pistols;
|
delete returnedObject.Pistols;
|
||||||
delete returnedObject.Melees;
|
delete returnedObject.Melees;
|
||||||
delete returnedObject.SuitToUnbrand;
|
delete returnedObject.SuitToUnbrand;
|
||||||
|
delete returnedObject.KubrowPet;
|
||||||
(returnedObject as IPendingRecipeClient).CompletionDate = {
|
(returnedObject as IPendingRecipeClient).CompletionDate = {
|
||||||
$date: { $numberLong: (returnedObject as IPendingRecipeDatabase).CompletionDate.getTime().toString() }
|
$date: { $numberLong: (returnedObject as IPendingRecipeDatabase).CompletionDate.getTime().toString() }
|
||||||
};
|
};
|
||||||
@ -1125,15 +1187,15 @@ const CustomMarkersSchema = new Schema<ICustomMarkers>(
|
|||||||
const calenderProgressSchema = new Schema<ICalendarProgress>(
|
const calenderProgressSchema = new Schema<ICalendarProgress>(
|
||||||
{
|
{
|
||||||
Version: { type: Number, default: 19 },
|
Version: { type: Number, default: 19 },
|
||||||
Iteration: { type: Number, default: 2 },
|
Iteration: { type: Number, required: true },
|
||||||
YearProgress: {
|
YearProgress: {
|
||||||
Upgrades: { type: [] }
|
Upgrades: { type: [String], default: [] }
|
||||||
},
|
},
|
||||||
SeasonProgress: {
|
SeasonProgress: {
|
||||||
SeasonType: String,
|
SeasonType: { type: String, required: true },
|
||||||
LastCompletedDayIdx: { type: Number, default: -1 },
|
LastCompletedDayIdx: { type: Number, default: 0 },
|
||||||
LastCompletedChallengeDayIdx: { type: Number, default: -1 },
|
LastCompletedChallengeDayIdx: { type: Number, default: 0 },
|
||||||
ActivatedChallenges: []
|
ActivatedChallenges: { type: [String], default: [] }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ _id: false }
|
{ _id: false }
|
||||||
@ -1255,11 +1317,11 @@ const nemesisSchema = new Schema<INemesisDatabase>(
|
|||||||
PrevOwners: Number,
|
PrevOwners: Number,
|
||||||
SecondInCommand: Boolean,
|
SecondInCommand: Boolean,
|
||||||
Weakened: Boolean,
|
Weakened: Boolean,
|
||||||
InfNodes: [infNodeSchema],
|
InfNodes: { type: [infNodeSchema], default: undefined },
|
||||||
HenchmenKilled: Number,
|
HenchmenKilled: Number,
|
||||||
HintProgress: Number,
|
HintProgress: Number,
|
||||||
Hints: [Number],
|
Hints: { type: [Number], default: [] },
|
||||||
GuessHistory: [Number],
|
GuessHistory: { type: [Number], default: undefined },
|
||||||
MissionCount: Number,
|
MissionCount: Number,
|
||||||
LastEnc: Number
|
LastEnc: Number
|
||||||
},
|
},
|
||||||
@ -1376,7 +1438,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
|||||||
//How many Gift do you have left*(gift spends the trade)
|
//How many Gift do you have left*(gift spends the trade)
|
||||||
GiftsRemaining: { type: Number, default: 8 },
|
GiftsRemaining: { type: Number, default: 8 },
|
||||||
//Curent trade info Giving or Getting items
|
//Curent trade info Giving or Getting items
|
||||||
PendingTrades: [Schema.Types.Mixed],
|
//PendingTrades: [Schema.Types.Mixed],
|
||||||
|
|
||||||
//Syndicate currently being pledged to.
|
//Syndicate currently being pledged to.
|
||||||
SupportedSyndicate: String,
|
SupportedSyndicate: String,
|
||||||
@ -1426,7 +1488,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
|||||||
|
|
||||||
KubrowPetEggs: [kubrowPetEggSchema],
|
KubrowPetEggs: [kubrowPetEggSchema],
|
||||||
//Prints Cat(3 Prints)\Kubrow(2 Prints) Pets
|
//Prints Cat(3 Prints)\Kubrow(2 Prints) Pets
|
||||||
KubrowPetPrints: [Schema.Types.Mixed],
|
//KubrowPetPrints: [Schema.Types.Mixed],
|
||||||
|
|
||||||
//Item for EquippedGear example:Scaner,LoadoutTechSummon etc
|
//Item for EquippedGear example:Scaner,LoadoutTechSummon etc
|
||||||
Consumables: [typeCountSchema],
|
Consumables: [typeCountSchema],
|
||||||
@ -1472,7 +1534,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
|||||||
//item like DojoKey or Boss missions key
|
//item like DojoKey or Boss missions key
|
||||||
LevelKeys: [typeCountSchema],
|
LevelKeys: [typeCountSchema],
|
||||||
//Active quests
|
//Active quests
|
||||||
Quests: [Schema.Types.Mixed],
|
//Quests: [Schema.Types.Mixed],
|
||||||
|
|
||||||
//Cosmetics like profile glyphs\Kavasa Prime Kubrow Collar\Game Theme etc
|
//Cosmetics like profile glyphs\Kavasa Prime Kubrow Collar\Game Theme etc
|
||||||
FlavourItems: [FlavourItemSchema],
|
FlavourItems: [FlavourItemSchema],
|
||||||
@ -1511,7 +1573,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
|||||||
TauntHistory: { type: [tauntSchema], default: undefined },
|
TauntHistory: { type: [tauntSchema], default: undefined },
|
||||||
|
|
||||||
//noShow2FA,VisitPrimeVault etc
|
//noShow2FA,VisitPrimeVault etc
|
||||||
WebFlags: Schema.Types.Mixed,
|
//WebFlags: Schema.Types.Mixed,
|
||||||
//Id CompletedAlerts
|
//Id CompletedAlerts
|
||||||
CompletedAlerts: [String],
|
CompletedAlerts: [String],
|
||||||
|
|
||||||
@ -1531,7 +1593,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
|||||||
//the color your clan requests like Items/Research/DojoColors/DojoColorPlainsB
|
//the color your clan requests like Items/Research/DojoColors/DojoColorPlainsB
|
||||||
ActiveDojoColorResearch: String,
|
ActiveDojoColorResearch: String,
|
||||||
|
|
||||||
SentientSpawnChanceBoosters: Schema.Types.Mixed,
|
//SentientSpawnChanceBoosters: Schema.Types.Mixed,
|
||||||
|
|
||||||
QualifyingInvasions: [invasionProgressSchema],
|
QualifyingInvasions: [invasionProgressSchema],
|
||||||
FactionScores: [Number],
|
FactionScores: [Number],
|
||||||
@ -1561,15 +1623,15 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
|||||||
Drones: [droneSchema],
|
Drones: [droneSchema],
|
||||||
|
|
||||||
//Active profile ico
|
//Active profile ico
|
||||||
ActiveAvatarImageType: { type: String, default: "/Lotus/Types/StoreItems/AvatarImages/AvatarImageDefault" },
|
ActiveAvatarImageType: String,
|
||||||
|
|
||||||
// open location store like EidolonPlainsDiscoverable or OrbVallisCaveDiscoverable
|
// open location store like EidolonPlainsDiscoverable or OrbVallisCaveDiscoverable
|
||||||
DiscoveredMarkers: [discoveredMarkerSchema],
|
DiscoveredMarkers: [discoveredMarkerSchema],
|
||||||
//Open location mission like "JobId" + "StageCompletions"
|
//Open location mission like "JobId" + "StageCompletions"
|
||||||
CompletedJobs: [Schema.Types.Mixed],
|
//CompletedJobs: [Schema.Types.Mixed],
|
||||||
|
|
||||||
//Game mission\ivent score example "Tag": "WaterFight", "Best": 170, "Count": 1258,
|
//Game mission\ivent score example "Tag": "WaterFight", "Best": 170, "Count": 1258,
|
||||||
PersonalGoalProgress: [Schema.Types.Mixed],
|
//PersonalGoalProgress: [Schema.Types.Mixed],
|
||||||
|
|
||||||
//Setting interface Style
|
//Setting interface Style
|
||||||
ThemeStyle: String,
|
ThemeStyle: String,
|
||||||
@ -1599,13 +1661,13 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
|||||||
LibraryActiveDailyTaskInfo: libraryDailyTaskInfoSchema,
|
LibraryActiveDailyTaskInfo: libraryDailyTaskInfoSchema,
|
||||||
|
|
||||||
//https://warframe.fandom.com/wiki/Invasion
|
//https://warframe.fandom.com/wiki/Invasion
|
||||||
InvasionChainProgress: [Schema.Types.Mixed],
|
//InvasionChainProgress: [Schema.Types.Mixed],
|
||||||
|
|
||||||
//CorpusLich or GrineerLich
|
//CorpusLich or GrineerLich
|
||||||
NemesisAbandonedRewards: { type: [String], default: [] },
|
NemesisAbandonedRewards: { type: [String], default: [] },
|
||||||
Nemesis: nemesisSchema,
|
Nemesis: nemesisSchema,
|
||||||
NemesisHistory: [Schema.Types.Mixed],
|
NemesisHistory: { type: [nemesisSchema], default: undefined },
|
||||||
LastNemesisAllySpawnTime: Schema.Types.Mixed,
|
//LastNemesisAllySpawnTime: Schema.Types.Mixed,
|
||||||
|
|
||||||
//TradingRulesConfirmed,ShowFriendInvNotifications(Option->Social)
|
//TradingRulesConfirmed,ShowFriendInvNotifications(Option->Social)
|
||||||
Settings: settingsSchema,
|
Settings: settingsSchema,
|
||||||
@ -1619,7 +1681,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
|||||||
PlayerSkills: { type: playerSkillsSchema, default: {} },
|
PlayerSkills: { type: playerSkillsSchema, default: {} },
|
||||||
|
|
||||||
//TradeBannedUntil data
|
//TradeBannedUntil data
|
||||||
TradeBannedUntil: Schema.Types.Mixed,
|
//TradeBannedUntil: Schema.Types.Mixed,
|
||||||
|
|
||||||
//https://warframe.fandom.com/wiki/Helminth
|
//https://warframe.fandom.com/wiki/Helminth
|
||||||
InfestedFoundry: infestedFoundrySchema,
|
InfestedFoundry: infestedFoundrySchema,
|
||||||
@ -1628,7 +1690,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
|||||||
|
|
||||||
//Purchase this new permanent skin from the Lotus customization options in Personal Quarters located in your Orbiter.
|
//Purchase this new permanent skin from the Lotus customization options in Personal Quarters located in your Orbiter.
|
||||||
//https://warframe.fandom.com/wiki/Lotus#The_New_War
|
//https://warframe.fandom.com/wiki/Lotus#The_New_War
|
||||||
LotusCustomization: Schema.Types.Mixed,
|
LotusCustomization: { type: lotusCustomizationSchema, default: undefined },
|
||||||
|
|
||||||
//Progress+Rank+ItemType(ZarimanPumpShotgun)
|
//Progress+Rank+ItemType(ZarimanPumpShotgun)
|
||||||
//https://warframe.fandom.com/wiki/Incarnon
|
//https://warframe.fandom.com/wiki/Incarnon
|
||||||
@ -1639,23 +1701,24 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
|||||||
|
|
||||||
//Unknown and system
|
//Unknown and system
|
||||||
DuviriInfo: DuviriInfoSchema,
|
DuviriInfo: DuviriInfoSchema,
|
||||||
|
LastInventorySync: Schema.Types.ObjectId,
|
||||||
Mailbox: MailboxSchema,
|
Mailbox: MailboxSchema,
|
||||||
HandlerPoints: Number,
|
HandlerPoints: Number,
|
||||||
ChallengesFixVersion: { type: Number, default: 6 },
|
ChallengesFixVersion: { type: Number, default: 6 },
|
||||||
PlayedParkourTutorial: Boolean,
|
PlayedParkourTutorial: Boolean,
|
||||||
ActiveLandscapeTraps: [Schema.Types.Mixed],
|
//ActiveLandscapeTraps: [Schema.Types.Mixed],
|
||||||
RepVotes: [Schema.Types.Mixed],
|
//RepVotes: [Schema.Types.Mixed],
|
||||||
LeagueTickets: [Schema.Types.Mixed],
|
//LeagueTickets: [Schema.Types.Mixed],
|
||||||
HasContributedToDojo: Boolean,
|
HasContributedToDojo: Boolean,
|
||||||
HWIDProtectEnabled: Boolean,
|
HWIDProtectEnabled: Boolean,
|
||||||
LoadOutPresets: { type: Schema.Types.ObjectId, ref: "Loadout" },
|
LoadOutPresets: { type: Schema.Types.ObjectId, ref: "Loadout" },
|
||||||
CurrentLoadOutIds: [oidSchema],
|
CurrentLoadOutIds: [oidSchema],
|
||||||
RandomUpgradesIdentified: Number,
|
RandomUpgradesIdentified: Number,
|
||||||
BountyScore: Number,
|
BountyScore: Number,
|
||||||
ChallengeInstanceStates: [Schema.Types.Mixed],
|
//ChallengeInstanceStates: [Schema.Types.Mixed],
|
||||||
RecentVendorPurchases: { type: [recentVendorPurchaseSchema], default: undefined },
|
RecentVendorPurchases: { type: [recentVendorPurchaseSchema], default: undefined },
|
||||||
Robotics: [Schema.Types.Mixed],
|
//Robotics: [Schema.Types.Mixed],
|
||||||
UsedDailyDeals: [Schema.Types.Mixed],
|
//UsedDailyDeals: [Schema.Types.Mixed],
|
||||||
CollectibleSeries: { type: [collectibleEntrySchema], default: undefined },
|
CollectibleSeries: { type: [collectibleEntrySchema], default: undefined },
|
||||||
HasResetAccount: { type: Boolean, default: false },
|
HasResetAccount: { type: Boolean, default: false },
|
||||||
|
|
||||||
@ -1736,6 +1799,9 @@ inventorySchema.set("toJSON", {
|
|||||||
sn: inventoryDatabase.LockedWeaponGroup.sn ? toOid(inventoryDatabase.LockedWeaponGroup.sn) : undefined
|
sn: inventoryDatabase.LockedWeaponGroup.sn ? toOid(inventoryDatabase.LockedWeaponGroup.sn) : undefined
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
if (inventoryDatabase.LastInventorySync) {
|
||||||
|
inventoryResponse.LastInventorySync = toOid(inventoryDatabase.LastInventorySync);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -20,7 +20,9 @@ const databaseAccountSchema = new Schema<IDatabaseAccountJson>(
|
|||||||
ConsentNeeded: { type: Boolean, required: true },
|
ConsentNeeded: { type: Boolean, required: true },
|
||||||
TrackedSettings: { type: [String], default: [] },
|
TrackedSettings: { type: [String], default: [] },
|
||||||
Nonce: { type: Number, default: 0 },
|
Nonce: { type: Number, default: 0 },
|
||||||
|
BuildLabel: String,
|
||||||
Dropped: Boolean,
|
Dropped: Boolean,
|
||||||
|
LastLogin: { type: Date, default: 0 },
|
||||||
LatestEventMessageDate: { type: Date, default: 0 },
|
LatestEventMessageDate: { type: Date, default: 0 },
|
||||||
LastLoginRewardDate: { type: Number, default: 0 },
|
LastLoginRewardDate: { type: Number, default: 0 },
|
||||||
LoginDays: { type: Number, default: 1 }
|
LoginDays: { type: Number, default: 1 }
|
||||||
|
@ -1,16 +1,19 @@
|
|||||||
import { toOid } from "@/src/helpers/inventoryHelpers";
|
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { colorSchema } from "@/src/models/inventoryModels/inventoryModel";
|
import { colorSchema } from "@/src/models/inventoryModels/inventoryModel";
|
||||||
import { IOrbiter, IPersonalRoomsDatabase, PersonalRoomsModelType } from "@/src/types/personalRoomsTypes";
|
import { IOrbiter, IPersonalRoomsDatabase, PersonalRoomsModelType } from "@/src/types/personalRoomsTypes";
|
||||||
import {
|
import {
|
||||||
IFavouriteLoadoutDatabase,
|
IFavouriteLoadoutDatabase,
|
||||||
IGardening,
|
IGardeningDatabase,
|
||||||
IPlacedDecosDatabase,
|
IPlacedDecosDatabase,
|
||||||
IPictureFrameInfo,
|
IPictureFrameInfo,
|
||||||
IRoom,
|
IRoom,
|
||||||
ITailorShopDatabase,
|
ITailorShopDatabase,
|
||||||
IApartmentDatabase
|
IApartmentDatabase,
|
||||||
|
IPlanterDatabase,
|
||||||
|
IPlantDatabase,
|
||||||
|
IPlantClient
|
||||||
} from "@/src/types/shipTypes";
|
} from "@/src/types/shipTypes";
|
||||||
import { Schema, model } from "mongoose";
|
import { Schema, Types, model } from "mongoose";
|
||||||
|
|
||||||
export const pictureFrameInfoSchema = new Schema<IPictureFrameInfo>(
|
export const pictureFrameInfoSchema = new Schema<IPictureFrameInfo>(
|
||||||
{
|
{
|
||||||
@ -77,15 +80,45 @@ favouriteLoadoutSchema.set("toJSON", {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const gardeningSchema = new Schema<IGardening>({
|
const plantSchema = new Schema<IPlantDatabase>(
|
||||||
Planters: [Schema.Types.Mixed] //TODO: add when implementing gardening
|
{
|
||||||
|
PlantType: String,
|
||||||
|
EndTime: Date,
|
||||||
|
PlotIndex: Number
|
||||||
|
},
|
||||||
|
{ _id: false }
|
||||||
|
);
|
||||||
|
|
||||||
|
plantSchema.set("toJSON", {
|
||||||
|
virtuals: true,
|
||||||
|
transform(_doc, obj) {
|
||||||
|
const client = obj as IPlantClient;
|
||||||
|
const db = obj as IPlantDatabase;
|
||||||
|
|
||||||
|
client.EndTime = toMongoDate(db.EndTime);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const planterSchema = new Schema<IPlanterDatabase>(
|
||||||
|
{
|
||||||
|
Name: { type: String, required: true },
|
||||||
|
Plants: { type: [plantSchema], default: [] }
|
||||||
|
},
|
||||||
|
{ _id: false }
|
||||||
|
);
|
||||||
|
|
||||||
|
const gardeningSchema = new Schema<IGardeningDatabase>(
|
||||||
|
{
|
||||||
|
Planters: { type: [planterSchema], default: [] }
|
||||||
|
},
|
||||||
|
{ _id: false }
|
||||||
|
);
|
||||||
|
|
||||||
const apartmentSchema = new Schema<IApartmentDatabase>(
|
const apartmentSchema = new Schema<IApartmentDatabase>(
|
||||||
{
|
{
|
||||||
Rooms: [roomSchema],
|
Rooms: [roomSchema],
|
||||||
FavouriteLoadouts: [favouriteLoadoutSchema],
|
FavouriteLoadouts: [favouriteLoadoutSchema],
|
||||||
Gardening: gardeningSchema // TODO: ensure this is correct
|
Gardening: gardeningSchema
|
||||||
},
|
},
|
||||||
{ _id: false }
|
{ _id: false }
|
||||||
);
|
);
|
||||||
@ -98,7 +131,9 @@ const apartmentDefault: IApartmentDatabase = {
|
|||||||
{ Name: "DuviriHallway", MaxCapacity: 1600 }
|
{ Name: "DuviriHallway", MaxCapacity: 1600 }
|
||||||
],
|
],
|
||||||
FavouriteLoadouts: [],
|
FavouriteLoadouts: [],
|
||||||
Gardening: {}
|
Gardening: {
|
||||||
|
Planters: []
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const orbiterSchema = new Schema<IOrbiter>(
|
const orbiterSchema = new Schema<IOrbiter>(
|
||||||
@ -118,7 +153,18 @@ const orbiterDefault: IOrbiter = {
|
|||||||
Features: ["/Lotus/Types/Items/ShipFeatureItems/EarthNavigationFeatureItem"], //TODO: potentially remove after missionstarting gear
|
Features: ["/Lotus/Types/Items/ShipFeatureItems/EarthNavigationFeatureItem"], //TODO: potentially remove after missionstarting gear
|
||||||
Rooms: [
|
Rooms: [
|
||||||
{ Name: "AlchemyRoom", MaxCapacity: 1600 },
|
{ Name: "AlchemyRoom", MaxCapacity: 1600 },
|
||||||
{ Name: "BridgeRoom", MaxCapacity: 1600 },
|
{
|
||||||
|
Name: "BridgeRoom",
|
||||||
|
MaxCapacity: 1600,
|
||||||
|
PlacedDecos: [
|
||||||
|
{
|
||||||
|
Type: "/Lotus/Objects/Tenno/Props/Ships/LandCraftPlayerProps/ConclaveConsolePlayerShipDeco",
|
||||||
|
Pos: [-30.082, -3.95954, -16.7913],
|
||||||
|
Rot: [-135, 0, 0],
|
||||||
|
_id: undefined as unknown as Types.ObjectId
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{ Name: "LisetRoom", MaxCapacity: 1000 },
|
{ Name: "LisetRoom", MaxCapacity: 1000 },
|
||||||
{ Name: "OperatorChamberRoom", MaxCapacity: 1600 },
|
{ Name: "OperatorChamberRoom", MaxCapacity: 1600 },
|
||||||
{ Name: "OutsideRoom", MaxCapacity: 1600 },
|
{ Name: "OutsideRoom", MaxCapacity: 1600 },
|
||||||
|
@ -28,17 +28,15 @@ shipSchema.set("toJSON", {
|
|||||||
delete returnedObject._id;
|
delete returnedObject._id;
|
||||||
delete returnedObject.__v;
|
delete returnedObject.__v;
|
||||||
delete returnedObject.ShipOwnerId;
|
delete returnedObject.ShipOwnerId;
|
||||||
if (shipDatabase.ShipExteriorColors) {
|
|
||||||
shipResponse.ShipExterior = {
|
|
||||||
Colors: shipDatabase.ShipExteriorColors,
|
|
||||||
ShipAttachments: shipDatabase.ShipAttachments,
|
|
||||||
SkinFlavourItem: shipDatabase.SkinFlavourItem
|
|
||||||
};
|
|
||||||
|
|
||||||
delete shipDatabase.ShipExteriorColors;
|
shipResponse.ShipExterior = {
|
||||||
delete shipDatabase.ShipAttachments;
|
Colors: shipDatabase.ShipExteriorColors,
|
||||||
delete shipDatabase.SkinFlavourItem;
|
ShipAttachments: shipDatabase.ShipAttachments,
|
||||||
}
|
SkinFlavourItem: shipDatabase.SkinFlavourItem
|
||||||
|
};
|
||||||
|
delete shipDatabase.ShipExteriorColors;
|
||||||
|
delete shipDatabase.ShipAttachments;
|
||||||
|
delete shipDatabase.SkinFlavourItem;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3,10 +3,13 @@ import { abandonLibraryDailyTaskController } from "@/src/controllers/api/abandon
|
|||||||
import { abortDojoComponentController } from "@/src/controllers/api/abortDojoComponentController";
|
import { abortDojoComponentController } from "@/src/controllers/api/abortDojoComponentController";
|
||||||
import { abortDojoComponentDestructionController } from "@/src/controllers/api/abortDojoComponentDestructionController";
|
import { abortDojoComponentDestructionController } from "@/src/controllers/api/abortDojoComponentDestructionController";
|
||||||
import { activateRandomModController } from "@/src/controllers/api/activateRandomModController";
|
import { activateRandomModController } from "@/src/controllers/api/activateRandomModController";
|
||||||
|
import { addFriendController } from "@/src/controllers/api/addFriendController";
|
||||||
import { addFriendImageController } from "@/src/controllers/api/addFriendImageController";
|
import { addFriendImageController } from "@/src/controllers/api/addFriendImageController";
|
||||||
import { addIgnoredUserController } from "@/src/controllers/api/addIgnoredUserController";
|
import { addIgnoredUserController } from "@/src/controllers/api/addIgnoredUserController";
|
||||||
|
import { addPendingFriendController } from "@/src/controllers/api/addPendingFriendController";
|
||||||
import { addToAllianceController } from "@/src/controllers/api/addToAllianceController";
|
import { addToAllianceController } from "@/src/controllers/api/addToAllianceController";
|
||||||
import { addToGuildController } from "@/src/controllers/api/addToGuildController";
|
import { addToGuildController } from "@/src/controllers/api/addToGuildController";
|
||||||
|
import { adoptPetController } from "@/src/controllers/api/adoptPetController";
|
||||||
import { arcaneCommonController } from "@/src/controllers/api/arcaneCommonController";
|
import { arcaneCommonController } from "@/src/controllers/api/arcaneCommonController";
|
||||||
import { archonFusionController } from "@/src/controllers/api/archonFusionController";
|
import { archonFusionController } from "@/src/controllers/api/archonFusionController";
|
||||||
import { artifactsController } from "@/src/controllers/api/artifactsController";
|
import { artifactsController } from "@/src/controllers/api/artifactsController";
|
||||||
@ -19,6 +22,7 @@ import { claimCompletedRecipeController } from "@/src/controllers/api/claimCompl
|
|||||||
import { claimLibraryDailyTaskRewardController } from "@/src/controllers/api/claimLibraryDailyTaskRewardController";
|
import { claimLibraryDailyTaskRewardController } from "@/src/controllers/api/claimLibraryDailyTaskRewardController";
|
||||||
import { clearDialogueHistoryController } from "@/src/controllers/api/clearDialogueHistoryController";
|
import { clearDialogueHistoryController } from "@/src/controllers/api/clearDialogueHistoryController";
|
||||||
import { clearNewEpisodeRewardController } from "@/src/controllers/api/clearNewEpisodeRewardController";
|
import { clearNewEpisodeRewardController } from "@/src/controllers/api/clearNewEpisodeRewardController";
|
||||||
|
import { completeCalendarEventController } from "@/src/controllers/api/completeCalendarEventController";
|
||||||
import { completeRandomModChallengeController } from "@/src/controllers/api/completeRandomModChallengeController";
|
import { completeRandomModChallengeController } from "@/src/controllers/api/completeRandomModChallengeController";
|
||||||
import { confirmAllianceInvitationController } from "@/src/controllers/api/confirmAllianceInvitationController";
|
import { confirmAllianceInvitationController } from "@/src/controllers/api/confirmAllianceInvitationController";
|
||||||
import { confirmGuildInvitationGetController, confirmGuildInvitationPostController } from "@/src/controllers/api/confirmGuildInvitationController";
|
import { confirmGuildInvitationGetController, confirmGuildInvitationPostController } from "@/src/controllers/api/confirmGuildInvitationController";
|
||||||
@ -47,6 +51,7 @@ import { findSessionsController } from "@/src/controllers/api/findSessionsContro
|
|||||||
import { fishmongerController } from "@/src/controllers/api/fishmongerController";
|
import { fishmongerController } from "@/src/controllers/api/fishmongerController";
|
||||||
import { focusController } from "@/src/controllers/api/focusController";
|
import { focusController } from "@/src/controllers/api/focusController";
|
||||||
import { fusionTreasuresController } from "@/src/controllers/api/fusionTreasuresController";
|
import { fusionTreasuresController } from "@/src/controllers/api/fusionTreasuresController";
|
||||||
|
import { gardeningController } from "@/src/controllers/api/gardeningController";
|
||||||
import { genericUpdateController } from "@/src/controllers/api/genericUpdateController";
|
import { genericUpdateController } from "@/src/controllers/api/genericUpdateController";
|
||||||
import { getAllianceController } from "@/src/controllers/api/getAllianceController";
|
import { getAllianceController } from "@/src/controllers/api/getAllianceController";
|
||||||
import { getDailyDealStockLevelsController } from "@/src/controllers/api/getDailyDealStockLevelsController";
|
import { getDailyDealStockLevelsController } from "@/src/controllers/api/getDailyDealStockLevelsController";
|
||||||
@ -57,6 +62,7 @@ import { getGuildDojoController } from "@/src/controllers/api/getGuildDojoContro
|
|||||||
import { getGuildLogController } from "@/src/controllers/api/getGuildLogController";
|
import { getGuildLogController } from "@/src/controllers/api/getGuildLogController";
|
||||||
import { getIgnoredUsersController } from "@/src/controllers/api/getIgnoredUsersController";
|
import { getIgnoredUsersController } from "@/src/controllers/api/getIgnoredUsersController";
|
||||||
import { getNewRewardSeedController } from "@/src/controllers/api/getNewRewardSeedController";
|
import { getNewRewardSeedController } from "@/src/controllers/api/getNewRewardSeedController";
|
||||||
|
import { getProfileViewingDataPostController } from "@/src/controllers/dynamic/getProfileViewingDataController";
|
||||||
import { getShipController } from "@/src/controllers/api/getShipController";
|
import { getShipController } from "@/src/controllers/api/getShipController";
|
||||||
import { getVendorInfoController } from "@/src/controllers/api/getVendorInfoController";
|
import { getVendorInfoController } from "@/src/controllers/api/getVendorInfoController";
|
||||||
import { getVoidProjectionRewardsController } from "@/src/controllers/api/getVoidProjectionRewardsController";
|
import { getVoidProjectionRewardsController } from "@/src/controllers/api/getVoidProjectionRewardsController";
|
||||||
@ -94,12 +100,15 @@ import { playerSkillsController } from "@/src/controllers/api/playerSkillsContro
|
|||||||
import { postGuildAdvertisementController } from "@/src/controllers/api/postGuildAdvertisementController";
|
import { postGuildAdvertisementController } from "@/src/controllers/api/postGuildAdvertisementController";
|
||||||
import { projectionManagerController } from "@/src/controllers/api/projectionManagerController";
|
import { projectionManagerController } from "@/src/controllers/api/projectionManagerController";
|
||||||
import { purchaseController } from "@/src/controllers/api/purchaseController";
|
import { purchaseController } from "@/src/controllers/api/purchaseController";
|
||||||
|
import { questControlController } from "@/src/controllers/api/questControlController";
|
||||||
import { queueDojoComponentDestructionController } from "@/src/controllers/api/queueDojoComponentDestructionController";
|
import { queueDojoComponentDestructionController } from "@/src/controllers/api/queueDojoComponentDestructionController";
|
||||||
import { redeemPromoCodeController } from "@/src/controllers/api/redeemPromoCodeController";
|
import { redeemPromoCodeController } from "@/src/controllers/api/redeemPromoCodeController";
|
||||||
import { releasePetController } from "@/src/controllers/api/releasePetController";
|
import { releasePetController } from "@/src/controllers/api/releasePetController";
|
||||||
|
import { removeFriendGetController, removeFriendPostController } from "@/src/controllers/api/removeFriendController";
|
||||||
import { removeFromAllianceController } from "@/src/controllers/api/removeFromAllianceController";
|
import { removeFromAllianceController } from "@/src/controllers/api/removeFromAllianceController";
|
||||||
import { removeFromGuildController } from "@/src/controllers/api/removeFromGuildController";
|
import { removeFromGuildController } from "@/src/controllers/api/removeFromGuildController";
|
||||||
import { removeIgnoredUserController } from "@/src/controllers/api/removeIgnoredUserController";
|
import { removeIgnoredUserController } from "@/src/controllers/api/removeIgnoredUserController";
|
||||||
|
import { renamePetController } from "@/src/controllers/api/renamePetController";
|
||||||
import { rerollRandomModController } from "@/src/controllers/api/rerollRandomModController";
|
import { rerollRandomModController } from "@/src/controllers/api/rerollRandomModController";
|
||||||
import { retrievePetFromStasisController } from "@/src/controllers/api/retrievePetFromStasisController";
|
import { retrievePetFromStasisController } from "@/src/controllers/api/retrievePetFromStasisController";
|
||||||
import { saveDialogueController } from "@/src/controllers/api/saveDialogueController";
|
import { saveDialogueController } from "@/src/controllers/api/saveDialogueController";
|
||||||
@ -116,6 +125,7 @@ import { setDojoComponentColorsController } from "@/src/controllers/api/setDojoC
|
|||||||
import { setDojoComponentMessageController } from "@/src/controllers/api/setDojoComponentMessageController";
|
import { setDojoComponentMessageController } from "@/src/controllers/api/setDojoComponentMessageController";
|
||||||
import { setDojoComponentSettingsController } from "@/src/controllers/api/setDojoComponentSettingsController";
|
import { setDojoComponentSettingsController } from "@/src/controllers/api/setDojoComponentSettingsController";
|
||||||
import { setEquippedInstrumentController } from "@/src/controllers/api/setEquippedInstrumentController";
|
import { setEquippedInstrumentController } from "@/src/controllers/api/setEquippedInstrumentController";
|
||||||
|
import { setFriendNoteController } from "@/src/controllers/api/setFriendNoteController";
|
||||||
import { setGuildMotdController } from "@/src/controllers/api/setGuildMotdController";
|
import { setGuildMotdController } from "@/src/controllers/api/setGuildMotdController";
|
||||||
import { setHubNpcCustomizationsController } from "@/src/controllers/api/setHubNpcCustomizationsController";
|
import { setHubNpcCustomizationsController } from "@/src/controllers/api/setHubNpcCustomizationsController";
|
||||||
import { setPlacedDecoInfoController } from "@/src/controllers/api/setPlacedDecoInfoController";
|
import { setPlacedDecoInfoController } from "@/src/controllers/api/setPlacedDecoInfoController";
|
||||||
@ -158,6 +168,7 @@ apiRouter.get("/changeDojoRoot.php", changeDojoRootController);
|
|||||||
apiRouter.get("/changeGuildRank.php", changeGuildRankController);
|
apiRouter.get("/changeGuildRank.php", changeGuildRankController);
|
||||||
apiRouter.get("/checkDailyMissionBonus.php", checkDailyMissionBonusController);
|
apiRouter.get("/checkDailyMissionBonus.php", checkDailyMissionBonusController);
|
||||||
apiRouter.get("/claimLibraryDailyTaskReward.php", claimLibraryDailyTaskRewardController);
|
apiRouter.get("/claimLibraryDailyTaskReward.php", claimLibraryDailyTaskRewardController);
|
||||||
|
apiRouter.get("/completeCalendarEvent.php", completeCalendarEventController);
|
||||||
apiRouter.get("/confirmAllianceInvitation.php", confirmAllianceInvitationController);
|
apiRouter.get("/confirmAllianceInvitation.php", confirmAllianceInvitationController);
|
||||||
apiRouter.get("/confirmGuildInvitation.php", confirmGuildInvitationGetController);
|
apiRouter.get("/confirmGuildInvitation.php", confirmGuildInvitationGetController);
|
||||||
apiRouter.get("/credits.php", creditsController);
|
apiRouter.get("/credits.php", creditsController);
|
||||||
@ -167,6 +178,7 @@ apiRouter.get("/deleteSession.php", deleteSessionController);
|
|||||||
apiRouter.get("/divvyAllianceVault.php", divvyAllianceVaultController);
|
apiRouter.get("/divvyAllianceVault.php", divvyAllianceVaultController);
|
||||||
apiRouter.get("/dojo", dojoController);
|
apiRouter.get("/dojo", dojoController);
|
||||||
apiRouter.get("/drones.php", dronesController);
|
apiRouter.get("/drones.php", dronesController);
|
||||||
|
apiRouter.get("/getAlliance.php", getAllianceController);
|
||||||
apiRouter.get("/getDailyDealStockLevels.php", getDailyDealStockLevelsController);
|
apiRouter.get("/getDailyDealStockLevels.php", getDailyDealStockLevelsController);
|
||||||
apiRouter.get("/getFriends.php", getFriendsController);
|
apiRouter.get("/getFriends.php", getFriendsController);
|
||||||
apiRouter.get("/getGuild.php", getGuildController);
|
apiRouter.get("/getGuild.php", getGuildController);
|
||||||
@ -174,8 +186,10 @@ apiRouter.get("/getGuildContributions.php", getGuildContributionsController);
|
|||||||
apiRouter.get("/getGuildDojo.php", getGuildDojoController);
|
apiRouter.get("/getGuildDojo.php", getGuildDojoController);
|
||||||
apiRouter.get("/getGuildLog.php", getGuildLogController);
|
apiRouter.get("/getGuildLog.php", getGuildLogController);
|
||||||
apiRouter.get("/getIgnoredUsers.php", getIgnoredUsersController);
|
apiRouter.get("/getIgnoredUsers.php", getIgnoredUsersController);
|
||||||
|
apiRouter.get("/getMessages.php", inboxController); // unsure if this is correct, but needed for U17
|
||||||
apiRouter.get("/getNewRewardSeed.php", getNewRewardSeedController);
|
apiRouter.get("/getNewRewardSeed.php", getNewRewardSeedController);
|
||||||
apiRouter.get("/getShip.php", getShipController);
|
apiRouter.get("/getShip.php", getShipController);
|
||||||
|
apiRouter.get("/getShipDecos.php", (_req, res) => { res.end(); }); // needed to log in on U22.8
|
||||||
apiRouter.get("/getVendorInfo.php", getVendorInfoController);
|
apiRouter.get("/getVendorInfo.php", getVendorInfoController);
|
||||||
apiRouter.get("/hub", hubController);
|
apiRouter.get("/hub", hubController);
|
||||||
apiRouter.get("/hubInstances", hubInstancesController);
|
apiRouter.get("/hubInstances", hubInstancesController);
|
||||||
@ -187,7 +201,9 @@ apiRouter.get("/marketRecommendations.php", marketRecommendationsController);
|
|||||||
apiRouter.get("/marketSearchRecommendations.php", marketRecommendationsController);
|
apiRouter.get("/marketSearchRecommendations.php", marketRecommendationsController);
|
||||||
apiRouter.get("/modularWeaponSale.php", modularWeaponSaleController);
|
apiRouter.get("/modularWeaponSale.php", modularWeaponSaleController);
|
||||||
apiRouter.get("/playedParkourTutorial.php", playedParkourTutorialController);
|
apiRouter.get("/playedParkourTutorial.php", playedParkourTutorialController);
|
||||||
|
apiRouter.get("/questControl.php", questControlController);
|
||||||
apiRouter.get("/queueDojoComponentDestruction.php", queueDojoComponentDestructionController);
|
apiRouter.get("/queueDojoComponentDestruction.php", queueDojoComponentDestructionController);
|
||||||
|
apiRouter.get("/removeFriend.php", removeFriendGetController);
|
||||||
apiRouter.get("/removeFromAlliance.php", removeFromAllianceController);
|
apiRouter.get("/removeFromAlliance.php", removeFromAllianceController);
|
||||||
apiRouter.get("/setActiveQuest.php", setActiveQuestController);
|
apiRouter.get("/setActiveQuest.php", setActiveQuestController);
|
||||||
apiRouter.get("/setActiveShip.php", setActiveShipController);
|
apiRouter.get("/setActiveShip.php", setActiveShipController);
|
||||||
@ -205,10 +221,13 @@ apiRouter.get("/updateSession.php", updateSessionGetController);
|
|||||||
// post
|
// post
|
||||||
apiRouter.post("/abortDojoComponent.php", abortDojoComponentController);
|
apiRouter.post("/abortDojoComponent.php", abortDojoComponentController);
|
||||||
apiRouter.post("/activateRandomMod.php", activateRandomModController);
|
apiRouter.post("/activateRandomMod.php", activateRandomModController);
|
||||||
|
apiRouter.post("/addFriend.php", addFriendController);
|
||||||
apiRouter.post("/addFriendImage.php", addFriendImageController);
|
apiRouter.post("/addFriendImage.php", addFriendImageController);
|
||||||
apiRouter.post("/addIgnoredUser.php", addIgnoredUserController);
|
apiRouter.post("/addIgnoredUser.php", addIgnoredUserController);
|
||||||
|
apiRouter.post("/addPendingFriend.php", addPendingFriendController);
|
||||||
apiRouter.post("/addToAlliance.php", addToAllianceController);
|
apiRouter.post("/addToAlliance.php", addToAllianceController);
|
||||||
apiRouter.post("/addToGuild.php", addToGuildController);
|
apiRouter.post("/addToGuild.php", addToGuildController);
|
||||||
|
apiRouter.post("/adoptPet.php", adoptPetController);
|
||||||
apiRouter.post("/arcaneCommon.php", arcaneCommonController);
|
apiRouter.post("/arcaneCommon.php", arcaneCommonController);
|
||||||
apiRouter.post("/archonFusion.php", archonFusionController);
|
apiRouter.post("/archonFusion.php", archonFusionController);
|
||||||
apiRouter.post("/artifacts.php", artifactsController);
|
apiRouter.post("/artifacts.php", artifactsController);
|
||||||
@ -217,6 +236,7 @@ apiRouter.post("/changeDojoRoot.php", changeDojoRootController);
|
|||||||
apiRouter.post("/claimCompletedRecipe.php", claimCompletedRecipeController);
|
apiRouter.post("/claimCompletedRecipe.php", claimCompletedRecipeController);
|
||||||
apiRouter.post("/clearDialogueHistory.php", clearDialogueHistoryController);
|
apiRouter.post("/clearDialogueHistory.php", clearDialogueHistoryController);
|
||||||
apiRouter.post("/clearNewEpisodeReward.php", clearNewEpisodeRewardController);
|
apiRouter.post("/clearNewEpisodeReward.php", clearNewEpisodeRewardController);
|
||||||
|
apiRouter.post("/commitStoryModeDecision.php", (_req, res) => { res.end(); }); // U14 (maybe wanna actually unlock the ship features?)
|
||||||
apiRouter.post("/completeRandomModChallenge.php", completeRandomModChallengeController);
|
apiRouter.post("/completeRandomModChallenge.php", completeRandomModChallengeController);
|
||||||
apiRouter.post("/confirmGuildInvitation.php", confirmGuildInvitationPostController);
|
apiRouter.post("/confirmGuildInvitation.php", confirmGuildInvitationPostController);
|
||||||
apiRouter.post("/contributeGuildClass.php", contributeGuildClassController);
|
apiRouter.post("/contributeGuildClass.php", contributeGuildClassController);
|
||||||
@ -238,10 +258,12 @@ apiRouter.post("/findSessions.php", findSessionsController);
|
|||||||
apiRouter.post("/fishmonger.php", fishmongerController);
|
apiRouter.post("/fishmonger.php", fishmongerController);
|
||||||
apiRouter.post("/focus.php", focusController);
|
apiRouter.post("/focus.php", focusController);
|
||||||
apiRouter.post("/fusionTreasures.php", fusionTreasuresController);
|
apiRouter.post("/fusionTreasures.php", fusionTreasuresController);
|
||||||
|
apiRouter.post("/gardening.php", gardeningController);
|
||||||
apiRouter.post("/genericUpdate.php", genericUpdateController);
|
apiRouter.post("/genericUpdate.php", genericUpdateController);
|
||||||
apiRouter.post("/getAlliance.php", getAllianceController);
|
apiRouter.post("/getAlliance.php", getAllianceController);
|
||||||
apiRouter.post("/getFriends.php", getFriendsController);
|
apiRouter.post("/getFriends.php", getFriendsController);
|
||||||
apiRouter.post("/getGuildDojo.php", getGuildDojoController);
|
apiRouter.post("/getGuildDojo.php", getGuildDojoController);
|
||||||
|
apiRouter.post("/getProfileViewingData.php", getProfileViewingDataPostController);
|
||||||
apiRouter.post("/getVoidProjectionRewards.php", getVoidProjectionRewardsController);
|
apiRouter.post("/getVoidProjectionRewards.php", getVoidProjectionRewardsController);
|
||||||
apiRouter.post("/gifting.php", giftingController);
|
apiRouter.post("/gifting.php", giftingController);
|
||||||
apiRouter.post("/gildWeapon.php", gildWeaponController);
|
apiRouter.post("/gildWeapon.php", gildWeaponController);
|
||||||
@ -269,10 +291,13 @@ apiRouter.post("/playerSkills.php", playerSkillsController);
|
|||||||
apiRouter.post("/postGuildAdvertisement.php", postGuildAdvertisementController);
|
apiRouter.post("/postGuildAdvertisement.php", postGuildAdvertisementController);
|
||||||
apiRouter.post("/projectionManager.php", projectionManagerController);
|
apiRouter.post("/projectionManager.php", projectionManagerController);
|
||||||
apiRouter.post("/purchase.php", purchaseController);
|
apiRouter.post("/purchase.php", purchaseController);
|
||||||
|
apiRouter.post("/questControl.php", questControlController); // U17
|
||||||
apiRouter.post("/redeemPromoCode.php", redeemPromoCodeController);
|
apiRouter.post("/redeemPromoCode.php", redeemPromoCodeController);
|
||||||
apiRouter.post("/releasePet.php", releasePetController);
|
apiRouter.post("/releasePet.php", releasePetController);
|
||||||
|
apiRouter.post("/removeFriend.php", removeFriendPostController);
|
||||||
apiRouter.post("/removeFromGuild.php", removeFromGuildController);
|
apiRouter.post("/removeFromGuild.php", removeFromGuildController);
|
||||||
apiRouter.post("/removeIgnoredUser.php", removeIgnoredUserController);
|
apiRouter.post("/removeIgnoredUser.php", removeIgnoredUserController);
|
||||||
|
apiRouter.post("/renamePet.php", renamePetController);
|
||||||
apiRouter.post("/rerollRandomMod.php", rerollRandomModController);
|
apiRouter.post("/rerollRandomMod.php", rerollRandomModController);
|
||||||
apiRouter.post("/retrievePetFromStasis.php", retrievePetFromStasisController);
|
apiRouter.post("/retrievePetFromStasis.php", retrievePetFromStasisController);
|
||||||
apiRouter.post("/saveDialogue.php", saveDialogueController);
|
apiRouter.post("/saveDialogue.php", saveDialogueController);
|
||||||
@ -285,6 +310,7 @@ apiRouter.post("/setDojoComponentColors.php", setDojoComponentColorsController);
|
|||||||
apiRouter.post("/setDojoComponentMessage.php", setDojoComponentMessageController);
|
apiRouter.post("/setDojoComponentMessage.php", setDojoComponentMessageController);
|
||||||
apiRouter.post("/setDojoComponentSettings.php", setDojoComponentSettingsController);
|
apiRouter.post("/setDojoComponentSettings.php", setDojoComponentSettingsController);
|
||||||
apiRouter.post("/setEquippedInstrument.php", setEquippedInstrumentController);
|
apiRouter.post("/setEquippedInstrument.php", setEquippedInstrumentController);
|
||||||
|
apiRouter.post("/setFriendNote.php", setFriendNoteController);
|
||||||
apiRouter.post("/setGuildMotd.php", setGuildMotdController);
|
apiRouter.post("/setGuildMotd.php", setGuildMotdController);
|
||||||
apiRouter.post("/setHubNpcCustomizations.php", setHubNpcCustomizationsController);
|
apiRouter.post("/setHubNpcCustomizations.php", setHubNpcCustomizationsController);
|
||||||
apiRouter.post("/setPlacedDecoInfo.php", setPlacedDecoInfoController);
|
apiRouter.post("/setPlacedDecoInfo.php", setPlacedDecoInfoController);
|
||||||
@ -304,6 +330,7 @@ apiRouter.post("/trainingResult.php", trainingResultController);
|
|||||||
apiRouter.post("/unlockShipFeature.php", unlockShipFeatureController);
|
apiRouter.post("/unlockShipFeature.php", unlockShipFeatureController);
|
||||||
apiRouter.post("/updateAlignment.php", updateAlignmentController);
|
apiRouter.post("/updateAlignment.php", updateAlignmentController);
|
||||||
apiRouter.post("/updateChallengeProgress.php", updateChallengeProgressController);
|
apiRouter.post("/updateChallengeProgress.php", updateChallengeProgressController);
|
||||||
|
apiRouter.post("/updateInventory.php", missionInventoryUpdateController); // U26 and below
|
||||||
apiRouter.post("/updateNodeIntros.php", genericUpdateController);
|
apiRouter.post("/updateNodeIntros.php", genericUpdateController);
|
||||||
apiRouter.post("/updateQuest.php", updateQuestController);
|
apiRouter.post("/updateQuest.php", updateQuestController);
|
||||||
apiRouter.post("/updateSession.php", updateSessionPostController);
|
apiRouter.post("/updateSession.php", updateSessionPostController);
|
||||||
|
@ -10,6 +10,7 @@ import { getAccountInfoController } from "@/src/controllers/custom/getAccountInf
|
|||||||
import { renameAccountController } from "@/src/controllers/custom/renameAccountController";
|
import { renameAccountController } from "@/src/controllers/custom/renameAccountController";
|
||||||
import { ircDroppedController } from "@/src/controllers/custom/ircDroppedController";
|
import { ircDroppedController } from "@/src/controllers/custom/ircDroppedController";
|
||||||
import { unlockAllIntrinsicsController } from "@/src/controllers/custom/unlockAllIntrinsicsController";
|
import { unlockAllIntrinsicsController } from "@/src/controllers/custom/unlockAllIntrinsicsController";
|
||||||
|
import { addMissingMaxRankModsController } from "@/src/controllers/custom/addMissingMaxRankModsController";
|
||||||
|
|
||||||
import { createAccountController } from "@/src/controllers/custom/createAccountController";
|
import { createAccountController } from "@/src/controllers/custom/createAccountController";
|
||||||
import { createMessageController } from "@/src/controllers/custom/createMessageController";
|
import { createMessageController } from "@/src/controllers/custom/createMessageController";
|
||||||
@ -17,10 +18,12 @@ import { addCurrencyController } from "@/src/controllers/custom/addCurrencyContr
|
|||||||
import { addItemsController } from "@/src/controllers/custom/addItemsController";
|
import { addItemsController } from "@/src/controllers/custom/addItemsController";
|
||||||
import { addXpController } from "@/src/controllers/custom/addXpController";
|
import { addXpController } from "@/src/controllers/custom/addXpController";
|
||||||
import { importController } from "@/src/controllers/custom/importController";
|
import { importController } from "@/src/controllers/custom/importController";
|
||||||
|
import { manageQuestsController } from "@/src/controllers/custom/manageQuestsController";
|
||||||
|
import { setEvolutionProgressController } from "@/src/controllers/custom/setEvolutionProgressController";
|
||||||
|
|
||||||
import { getConfigDataController } from "@/src/controllers/custom/getConfigDataController";
|
import { getConfigDataController } from "@/src/controllers/custom/getConfigDataController";
|
||||||
import { updateConfigDataController } from "@/src/controllers/custom/updateConfigDataController";
|
import { updateConfigDataController } from "@/src/controllers/custom/updateConfigDataController";
|
||||||
import { manageQuestsController } from "@/src/controllers/custom/manageQuestsController";
|
import { setBoosterController } from "../controllers/custom/setBoosterController";
|
||||||
|
|
||||||
const customRouter = express.Router();
|
const customRouter = express.Router();
|
||||||
|
|
||||||
@ -34,6 +37,7 @@ customRouter.get("/getAccountInfo", getAccountInfoController);
|
|||||||
customRouter.get("/renameAccount", renameAccountController);
|
customRouter.get("/renameAccount", renameAccountController);
|
||||||
customRouter.get("/ircDropped", ircDroppedController);
|
customRouter.get("/ircDropped", ircDroppedController);
|
||||||
customRouter.get("/unlockAllIntrinsics", unlockAllIntrinsicsController);
|
customRouter.get("/unlockAllIntrinsics", unlockAllIntrinsicsController);
|
||||||
|
customRouter.get("/addMissingMaxRankMods", addMissingMaxRankModsController);
|
||||||
|
|
||||||
customRouter.post("/createAccount", createAccountController);
|
customRouter.post("/createAccount", createAccountController);
|
||||||
customRouter.post("/createMessage", createMessageController);
|
customRouter.post("/createMessage", createMessageController);
|
||||||
@ -42,6 +46,8 @@ customRouter.post("/addItems", addItemsController);
|
|||||||
customRouter.post("/addXp", addXpController);
|
customRouter.post("/addXp", addXpController);
|
||||||
customRouter.post("/import", importController);
|
customRouter.post("/import", importController);
|
||||||
customRouter.post("/manageQuests", manageQuestsController);
|
customRouter.post("/manageQuests", manageQuestsController);
|
||||||
|
customRouter.post("/setEvolutionProgress", setEvolutionProgressController);
|
||||||
|
customRouter.post("/setBooster", setBoosterController);
|
||||||
|
|
||||||
customRouter.get("/config", getConfigDataController);
|
customRouter.get("/config", getConfigDataController);
|
||||||
customRouter.post("/config", updateConfigDataController);
|
customRouter.post("/config", updateConfigDataController);
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import express from "express";
|
import express from "express";
|
||||||
import { aggregateSessionsController } from "@/src/controllers/dynamic/aggregateSessionsController";
|
import { aggregateSessionsController } from "@/src/controllers/dynamic/aggregateSessionsController";
|
||||||
import { getGuildAdsController } from "@/src/controllers/dynamic/getGuildAdsController";
|
import { getGuildAdsController } from "@/src/controllers/dynamic/getGuildAdsController";
|
||||||
import { getProfileViewingDataController } from "@/src/controllers/dynamic/getProfileViewingDataController";
|
import { getProfileViewingDataGetController } from "@/src/controllers/dynamic/getProfileViewingDataController";
|
||||||
import { worldStateController } from "@/src/controllers/dynamic/worldStateController";
|
import { worldStateController } from "@/src/controllers/dynamic/worldStateController";
|
||||||
|
|
||||||
const dynamicController = express.Router();
|
const dynamicController = express.Router();
|
||||||
|
|
||||||
dynamicController.get("/aggregateSessions.php", aggregateSessionsController);
|
dynamicController.get("/aggregateSessions.php", aggregateSessionsController);
|
||||||
dynamicController.get("/getGuildAds.php", getGuildAdsController);
|
dynamicController.get("/getGuildAds.php", getGuildAdsController);
|
||||||
dynamicController.get("/getProfileViewingData.php", getProfileViewingDataController);
|
dynamicController.get("/getProfileViewingData.php", getProfileViewingDataGetController);
|
||||||
dynamicController.get("/worldState.php", worldStateController);
|
dynamicController.get("/worldState.php", worldStateController);
|
||||||
|
|
||||||
export { dynamicController };
|
export { dynamicController };
|
||||||
|
@ -24,6 +24,9 @@ interface IConfig {
|
|||||||
infiniteEndo?: boolean;
|
infiniteEndo?: boolean;
|
||||||
infiniteRegalAya?: boolean;
|
infiniteRegalAya?: boolean;
|
||||||
infiniteHelminthMaterials?: boolean;
|
infiniteHelminthMaterials?: boolean;
|
||||||
|
claimingBlueprintRefundsIngredients?: boolean;
|
||||||
|
dontSubtractVoidTraces?: boolean;
|
||||||
|
dontSubtractConsumables?: boolean;
|
||||||
unlockAllShipFeatures?: boolean;
|
unlockAllShipFeatures?: boolean;
|
||||||
unlockAllShipDecorations?: boolean;
|
unlockAllShipDecorations?: boolean;
|
||||||
unlockAllFlavourItems?: boolean;
|
unlockAllFlavourItems?: boolean;
|
||||||
@ -41,8 +44,11 @@ interface IConfig {
|
|||||||
noVendorPurchaseLimits?: boolean;
|
noVendorPurchaseLimits?: boolean;
|
||||||
noDeathMarks?: boolean;
|
noDeathMarks?: boolean;
|
||||||
noKimCooldowns?: boolean;
|
noKimCooldowns?: boolean;
|
||||||
|
syndicateMissionsRepeatable?: boolean;
|
||||||
|
instantFinishRivenChallenge?: boolean;
|
||||||
instantResourceExtractorDrones?: boolean;
|
instantResourceExtractorDrones?: boolean;
|
||||||
noResourceExtractorDronesDamage?: boolean;
|
noResourceExtractorDronesDamage?: boolean;
|
||||||
|
skipClanKeyCrafting?: boolean;
|
||||||
noDojoRoomBuildStage?: boolean;
|
noDojoRoomBuildStage?: boolean;
|
||||||
noDojoDecoBuildStage?: boolean;
|
noDojoDecoBuildStage?: boolean;
|
||||||
fastDojoRoomDestruction?: boolean;
|
fastDojoRoomDestruction?: boolean;
|
||||||
@ -50,12 +56,18 @@ interface IConfig {
|
|||||||
noDojoResearchTime?: boolean;
|
noDojoResearchTime?: boolean;
|
||||||
fastClanAscension?: boolean;
|
fastClanAscension?: boolean;
|
||||||
spoofMasteryRank?: number;
|
spoofMasteryRank?: number;
|
||||||
|
nightwaveStandingMultiplier?: number;
|
||||||
worldState?: {
|
worldState?: {
|
||||||
creditBoost?: boolean;
|
creditBoost?: boolean;
|
||||||
affinityBoost?: boolean;
|
affinityBoost?: boolean;
|
||||||
resourceBoost?: boolean;
|
resourceBoost?: boolean;
|
||||||
starDays?: boolean;
|
starDays?: boolean;
|
||||||
lockTime?: number;
|
eidolonOverride?: string;
|
||||||
|
vallisOverride?: string;
|
||||||
|
nightwaveOverride?: string;
|
||||||
|
};
|
||||||
|
dev?: {
|
||||||
|
keepVendorsExpired?: boolean;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user