0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 09:50:43 -05:00

168 Commits

Author SHA1 Message Date
1d1104a1e8
Refactor SaveServer and the things that interact with it to be async (#1064)
Changes:

- Adds a map for `profiles`
- Changes `onBeforeSaveCallbacks` to be Promises
- Changes `SaveMD5` into `saveSHA1` as the async method for `saveSHA1`
isn't blocking
- Changes all routes and callbacks directly interacting with SaveServer
to be async

---------

Co-authored-by: Chomp <27521899+chompDev@users.noreply.github.com>
2025-01-10 09:15:14 +00:00
Chomp
ae0e271957 Log file errors when performing imageRoute lookup 2025-01-09 11:41:47 +00:00
Chomp
f5600fe215 Stub out get Prestige endpoint 2025-01-09 10:52:09 +00:00
9c17464ae3
File System (#1050)
This adds the `FileSystem` and `FileSystemSync` classes to replace the
VFS class. These classes handle file system operations using `fs-extra`
for most tasks, except where the `atomically` package can be used to
improve reads and writes. The goal is to ensure that file operations are
as safe as possible while still providing a comfortable API. File
operation atomicity is focused on single files, as there's no trivial,
strict way to ensure atomicity for directory operations.

## Changes
- Adds `FileSystem` class for asynchronous file operations
- Adds `FileSystemSync` class for synchronous file operations
- Updates `atomically` to `2.0.3`
- Updates build script to transpiles ESM modules
- Resolves `AbstractWinstonLogger` bug that could cause a log file to be
overwritten
- Removes `VFS` class
- Removes `AsyncQueue` class
- Removes `proper-lockfile` package

## TODO

- Test anything that touches a file.

I'm leaving this in a draft state until I can test this further. Help is
more than welcome at this point. The classes are pretty solid, but
ensuring that they're being used properly throughout the existing code
still needs work.

---------

Co-authored-by: Chomp <dev@dev.sp-tarkov.com>
2025-01-09 10:50:39 +00:00
Chomp
57a56440f7 Implemented hideoutCustomizationSetMannequinPose endpoint 2025-01-07 11:19:19 +00:00
ed2b90fa0a
Various fixes so biome is happy (#1032)
- Changes to import typing for ILogger and ICloner
- Targets es2022 in compilerOptions (Matching the target in .swcrc)
because otherwise Biome doesn't seem to find a proper target.
- Fixes up the seasonal event typing
- fixes run:debug to target the correct file
2025-01-06 17:09:33 +00:00
Chomp
43a0950e5b Removed unused code from getHandledRoutes 2024-12-30 16:56:35 +00:00
Chomp
d5f9c1f253 Implemented updated endpoint for applying clothing to a players character
Fixed dogtag customisation choice not being saved to the correct parameter

Removed dead endpoint
2024-12-30 16:55:32 +00:00
Chomp
987137c38f Fixed return type errors 2024-12-28 09:49:40 +00:00
Chomp
b8bb6b921f
Expanded new endpoints
# Conflicts:
#	project/src/callbacks/CustomizationCallbacks.ts
#	project/src/callbacks/HideoutCallbacks.ts
#	project/src/controllers/CustomizationController.ts
#	project/src/controllers/HideoutController.ts
2024-12-27 20:42:08 -05:00
Chomp
5d08bd501c
Stubbed out hideoutCustomizationApply event 2024-12-27 20:40:03 -05:00
CWX
5864f81b1e
Merge branch 'bun' of https://github.com/sp-tarkov/server into bun 2024-12-27 20:31:22 -05:00
Chomp
912a718e43
Added new client/customization/storage endpoint 2024-12-27 20:15:37 -05:00
Chomp
6ff1916653
Updated JSONS and matching interfaces
updated ragman clothing

Updated quests

Updated trader assorts

Updated location servcies

Added new prestige data + new classes to handle new endpoints

Added new hideout customisation endpoint

# Conflicts:
#	project/src/models/eft/common/IGlobals.ts
#	project/src/models/eft/common/ILocationBase.ts
#	project/src/models/spt/config/IInventoryConfig.ts
#	project/src/models/spt/hideout/IHideout.ts
#	project/src/models/spt/templates/ITemplates.ts
2024-12-27 20:15:03 -05:00
21939dcf38
Biome Format
Ran the `npm run style:fix` command. These are the code-formatting fixes.
2024-12-07 13:50:09 -05:00
Chomp
45d55ff307 Renamed function to match endpoint 2024-11-25 13:49:35 +00:00
Dev
0c5ecefc41 Refactored scavcase reward code to use correct data and interfaces 2024-11-20 09:48:42 +00:00
Dev
eafa390c72 Fixed survey not implemented errors 2024-11-18 10:13:47 +00:00
b841addd78 Handle serializers asynchronously (!428)
In combination with my other PR handle all the serializers asynchronously too, this should almost result in a fully asynchronous sending of responses.

Reviewed-on: SPT/Server#428
Co-authored-by: Archangel <jesse@archangel.wtf>
Co-committed-by: Archangel <jesse@archangel.wtf>
2024-11-14 17:30:22 +00:00
78a3fcaca0 Properly fix metrics call, oops (!423)
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT/Server#423
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-11-03 23:26:03 +00:00
Dev
922adcfb5c Implemented pin/lock/free on inventory items 2024-11-01 10:01:26 +00:00
Dev
17215ba9d8 Stubbed out item pinning 2024-10-31 21:38:56 +00:00
Dev
62c64b7480 Removed unused endpoint 2024-10-24 12:20:46 +01:00
Dev
776f925d91 Updated interfaces to follow correct naming scheme 2024-10-19 12:43:38 +01:00
Dev
454a71213f Updated JSONs and interfaces to match new patch 2024-09-26 17:28:23 +01:00
Dev
ab1422bc40 Updated interfaces to follow correct naming convention
Removed some interface duplication
2024-09-24 12:47:29 +01:00
Dev
5fd9271491 Updated various interfaces to use correct naming scheme
Added `IGroupPostion`
2024-09-24 11:26:45 +01:00
Dev
10c436cd7d made use of resetInterval inside of resetMoneyTransferLimit() calculation 2024-09-23 10:22:26 +01:00
Dev
c1526a4ad3 Reset money transfer limit of player when they have reached/passed the nextResetTime value 2024-09-22 11:49:55 +01:00
Dev
ff6746ebe9 Now include money transfer limits of server>client response 2024-09-22 10:56:39 +01:00
Cj
4139e85f1f Clothing service fix (!407)
Server implementation of my `TraderServiceFix` mod.

Since 3.9 trader services were refactored by BSG. Resulting in them hard coding service ID's. This PR allows modders to push their trader ID to the `TraderConfig.moddedTraders.clothingService` array. It is then sent to the client where it adds it to the dictionary. I made this modular with its own interface in-case it needs expanded on in the future. So the this acts as both a fix and a groundwork for similar future fixes if need be as well.

Needs merged with SPT/Modules#165

Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com>
Reviewed-on: SPT/Server#407
Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com>
Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
2024-09-04 08:31:15 +00:00
Dev
8d9a396914 Added back missing singleplayer/settings/raid/menu endpoint 2024-08-23 17:08:14 +01:00
Dev
3d1aa5e4fc Removed unused singleplayer/settings/raid/endstate endpoint 2024-08-23 10:19:23 +01:00
Dev
6d7c4d95b6 Added further progress on cultist circle - now rewards items upon completion
Now handles `HideoutDeleteProductionCommand` event, Deletes sacrificed items on craft start
Set craft time to 30 secs for debugging
2024-08-22 17:48:39 +01:00
Dev
c6877f998b Updated StartTimestamp to be stored as a string 2024-08-22 12:34:54 +01:00
Dev
471c606e12 Updated production recipe interface to match live 2024-08-21 14:43:19 +01:00
Dev
726e4f4b2c Stubbed out HIDEOUT_CIRCLE_OF_CULTIST_PRODUCTION_START event 2024-08-21 13:36:51 +01:00
Dev
c45f4c5f4b Added s to Improvement
Updated hideout area enum
2024-08-20 21:19:00 +01:00
Dev
7be6b47e23 Fixed various Biome issues 2024-07-23 17:30:20 +01:00
5740774a46
Apply Biome Formatting
This is the result of running `npm run format` which applies the Biome formatting rules. Rejoice!
2024-07-23 11:12:53 -04:00
ed8dbbd195 Adds Biome - Removes ESLint & Prettier (!383)
Boogidy, boogidy, boogidy. Let's go racing! 🏎️

Removes the over-complicated and super-slow setup we had with ESLint & Prettier in favour of Biome. The largest change with the formatting is moving from Allman braces to 1TBS braces. Other than that, it's *pretty much* the same. Ah, and that Biome runs formatting and linting on the entire project about x10 faster than the old system ran formatting on one file. Seriously, the guy who came up with that last solution should be fired. :runs:

I've kept all of the formatting and linting commands the same as before, with the main mamma-jamma being: `npm run format`, which applies formatting and linting changes to the entire project.

Formatting-on-save works (quickly!) by (1) ensuring that you're working within the VSC workspace (as you should be), and (2) have the recommended Biome VSC extension installed. The link to the Biome extension is in the README.

This limits our options on code formatting going forward; Biome, like prettier, is very opinionated with very few formatting options available. But I see this as a good thing. I'd rather spend my time arguing about which gun in Tarkov is the best, rather than coding brace styles...

...It's the TOZ, and it always will be. Don't DM me.

Co-authored-by: chomp <chomp@noreply.dev.sp-tarkov.com>
Reviewed-on: SPT/Server#383
Co-authored-by: Refringe <me@refringe.com>
Co-committed-by: Refringe <me@refringe.com>
2024-07-22 21:15:57 +00:00
Dev
1298022600 Fixed endpoint casing 2024-07-12 21:16:33 +01:00
CWX
4eeedc4257 Removed unused code and repurposed save endpoint for scav profile saving 2024-07-12 16:29:21 +01:00
Dev
121387aa69 Deleted unused endpoints + code 2024-07-09 14:51:57 +01:00
Dev
1c601cc33e Removed unused endpoint + related service 2024-07-09 14:22:01 +01:00
Dev
872212f651 Removed unused endpoint + config 2024-07-08 15:15:48 +01:00
Dev
57100544c9 Merge branch 'master' of https://dev.sp-tarkov.com/SPT/Server into 310-dev
# Conflicts:
#	project/assets/database/globals.json
2024-07-07 14:13:35 +01:00
fba0f4703a Setup route to allow switching of profile icon. (!369)
Reviewed-on: SPT/Server#369
2024-07-07 13:07:36 +00:00
Dev
ca52f6d549 Created new LocationLifecycleServiceservice. Moved raid start/end code into it.
Created temp `LegacyLocationLifecycleService` class to hold old raid start/end code until we can safely delete it
2024-07-06 14:36:48 +01:00
Dev
494fd66f51 Renamed LocationGenerator to LocationLootGenerator 2024-07-06 13:54:04 +01:00