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 https://dev.sp-tarkov.com/SPT/Modules/pulls/165
Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/407
Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com>
Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
Drakia found a commit adding this, this will bork it till a refresh happens, removing fixes the issue
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/406
Co-authored-by: CWX <cwxdev@outlook.com>
Co-committed-by: CWX <cwxdev@outlook.com>
- The client doesn't expect to receive the player's loyalty level in their profile, so set it to 0 before sending the profile
- Slight refactor of `getCompleteProfile` to always clone, so we can modify the data sent to the client without changing it on the server
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/405
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
The code this was testing has been deleted so these tests were failing, don't see any point to keep the empty file after deleting the tests that are gone.
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/404
Co-authored-by: Alex McAuliffe <alex@romanx.co.uk>
Co-committed-by: Alex McAuliffe <alex@romanx.co.uk>
See #771 for discussion and bug report. Implementation deletes the specific task's completedCondition so as to allow the item to appear again.
Gulp v5 has a known issue that corrupts pngs when copying or moving them, this turns off encoding for the copying assets part of the build task.
Reference was [this stack post](https://stackoverflow.com/questions/78391263/copying-images-with-gulp-are-corrupted-damaged).
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/403
Co-authored-by: crustyselenium <crustyselenium@gmail.com>
Co-committed-by: crustyselenium <crustyselenium@gmail.com>
Added support for weapon/armor rewards
Added support for variable stack sizes (only ammo for now)
Added support for breaking out of reward item while loop if no item is found (5 attempts max)
Added helper function `itemHelper.getRandomisedAmmoStackSize()`
Production resp should be null according to network dumps. Also instead of delete nulled out the recipe, so that it properly overwrites the id.
Co-authored-by: TetrisGG <tetrisggdev@gmail.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/402
Co-authored-by: TetrisGG <tetrisgg@noreply.dev.sp-tarkov.com>
Co-committed-by: TetrisGG <tetrisgg@noreply.dev.sp-tarkov.com>
## Added:
* Config to keep daily quest type
## Changed:
* changeRepeatableQuest to check if the daily quest type should be kept the same
Co-authored-by: W1ngZ <W1ngZ@NoRealMail.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/400
Co-authored-by: W1ngZ <w1ngz@noreply.dev.sp-tarkov.com>
Co-committed-by: W1ngZ <w1ngz@noreply.dev.sp-tarkov.com>
Resolves the issue of incorrect fuel usage by using relative percentages for both the profile bonus and hideout management bonus
Add a sanity check to make sure we never return fuel to the player (No negative fuel consumption)
Adds a type definition for the variables added to the global scope.
Personally i'd probably stick them in an object off the route and drop the G_prefix but didn't want to make any major changes with no reason.
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/398
Co-authored-by: Alex McAuliffe <alex@romanx.co.uk>
Co-committed-by: Alex McAuliffe <alex@romanx.co.uk>
(cherry picked from commit 18d39224a9)
Moved confusing `isValidItem()` check out of `isItemOnCustomFleaBlacklist()` and into main function
Removed redundant blacklist check from flea item generation as its already covered in `isValidItem()`
(cherry picked from commit f46694a169)
Moved code into own function
Expanded force stock check to look for any child items instead of ones for slot `mod_stock`
Expanded check to include additional slot names
This is because the base value doesn't take into account any craft bonuses the profile has
After collecting a product from a continious craft, `ProductionTime` in the profiles craft data will be refreshed, this resolves issues with adjusting the `production.json` craft times not applying to continuous crafts
Refactor to remove legacy code that bloats the `ProfileFixerService` class. Most of which is old profile porting code, some being old profile fixes. Organizes code in the class so that public members are at the top (as they should be). Finally break out some code into their own methods so they're not in the primary method for the class `checkForAndFixPmcProfileIssues`.
I have tested this with a developer profile, an EOD profile and a Standard profile. I've encountered no issues in my own testing.
Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/391
Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com>
Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
Thirsty - Hounds
Circulate
Thirsty - Hounds
Friend among strangers
What's your evidence?
Immunity
Special Offer
Quality Standard
Airmail
The Good Times - Part 2
Minute of Fame
Viewer
Serious Allegations
Camera Action
Proper Comeback
Thirsty - Hounds
Circulate
Thirsty - Hounds
Friend among strangers
What's your evidence?
Immunity
Special Offer
Quality Standard
Airmail
The Good Times - Part 2
Minute of Fame
Viewer
Serious Allegations
Camera Action
Proper Comeback
Got confused when I generated types, this fixes NPM reporting 3.9.0.
Before and after:
![image](/attachments/056fdd66-c98f-4be3-bcb2-c3b4cfc5bd01)
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/392
Co-authored-by: 静穏靄 <seionmoya@noreply.dev.sp-tarkov.com>
Co-committed-by: 静穏靄 <seionmoya@noreply.dev.sp-tarkov.com>
When compiled natively to linux, logfiles are saved in main SPT folder instead of default location. It's caused by file paths being hardcoded as text.
This patch fixes logs location on linux build.
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/390
Co-authored-by: witek <falls-toluene.0q@icloud.com>
Co-committed-by: witek <falls-toluene.0q@icloud.com>
(cherry picked from commit 3edf0f2ff9)
**Before merging: Please test on a real Windows installation if possible!**
I tested this on Linux as well as inside a Windows VM hosted on Linux, but wasn't able to test it on a real Windows installation.
This commit fixes an issue with loading bundles from a native Linux server:
When compiling the server natively for Linux & installing some mods, everything works except for mods trying to load bundles from the server. Reason is a malformed path to the bundle:
```ts
2024-07-30 23:48:16.968 +02:00|0.14.9.1.30626|Error|Default|
EXCEPTION: System.IO.DirectoryNotFoundException: Could not find a part of the path "C:\home\USER\Games\escape-from-tarkov\drive_c\SPTarkov\user\mods\Bloody-Bullet-Wounds\bundles\assets\systems\effects\particlesystems\effects.bundle".
```
`process.cwd()` returns the linux-agnostic path of course, but for some reason it also returns `C:`.
Changing the line to `modpath.slice(0, -1).replace(/\\/g, "/");` seems to work and the bundles seem to get loaded without issues (did a quick test raid), even without passing the absolute path to the mod.
I tried to check why that is, and I think node is able to [get the cwd and resolve the relative path](4d1d88118b/src/path.cc (L101)) by itself..
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/389
Co-authored-by: MadByte <madbyte@noreply.dev.sp-tarkov.com>
Co-committed-by: MadByte <madbyte@noreply.dev.sp-tarkov.com>
(cherry picked from commit 6f010acfca)
Previously `highestValue` could be lower than `lowestValue`, resulting in an exception. These values are now generated in the same method and clamped
Add a catch to the botgen promise await so we get more useful errors if botgen fails
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/388
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
(cherry picked from commit ee1eb7d690)
The httpListeners are promise based but they aren't awaited when handling the request.
I found this while implementing another version of HttpServer in a mod but couldn't actually find where this would cause an issue so feel free to close this if you think it's not worth it.
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/387
Co-authored-by: RomanxTheLast <alex@romanx.co.uk>
Co-committed-by: RomanxTheLast <alex@romanx.co.uk>
(cherry picked from commit 398bf43444)
Added item reward pools for `Unlocked equipment create (x)`
Added support for weapon/armor presets inside `getRandomLootContainerLoot()`
Expanded pool for `Unlocked valuables crate (x)",` by 8 items
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: https://dev.sp-tarkov.com/SPT/Server/pulls/383
Co-authored-by: Refringe <me@refringe.com>
Co-committed-by: Refringe <me@refringe.com>
Now when a profile create a new offer and another profile buy it, it can work correctly(For example profile A create a offer and profile B buy this offer, now A will receive money from profile B)
and set RagfairOfferHelper.completeOffer to public because TradeHelper now use it to resolve trade between 2 profiles on ragfair
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/382
Co-authored-by: HiddenCirno <2301697863@qq.com>
Co-committed-by: HiddenCirno <2301697863@qq.com>
(cherry picked from commit f555c24709)
Now when a profile create a new offer and another profile buy it, it can work correctly(For example profile A create a offer and profile B buy this offer, now A will receive money from profile B)
and set RagfairOfferHelper.completeOffer to public because TradeHelper now use it to resolve trade between 2 profiles on ragfair
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/382
Co-authored-by: HiddenCirno <2301697863@qq.com>
Co-committed-by: HiddenCirno <2301697863@qq.com>
Fix that free change repeatable chance quest still deduct trader standing, now it will deduct when player have no access to free change or have no free change counts
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/379
Co-authored-by: HiddenCirno <2301697863@qq.com>
Co-committed-by: HiddenCirno <2301697863@qq.com>
(cherry picked from commit dcb98f7d1b)
Fix that free change repeatable chance quest still deduct trader standing, now it will deduct when player have no access to free change or have no free change counts
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/379
Co-authored-by: HiddenCirno <2301697863@qq.com>
Co-committed-by: HiddenCirno <2301697863@qq.com>
Trader offers with dogtag barter requirements are currently missing the `level` and `side` properties necessary to qualify them. This data already exists in the assorts, just needed to be sent along with the offer.
I considered updating the `side` property of `Requirement` in `IAddOfferRequestData.ts`, but that field is never used, and the client appears to pass 0 for both (even though 0 is not a valid `side`).
Not sure if this should be going to `master` or `310-dev`?
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/378
Co-authored-by: Tyfon <tyfon7@outlook.com>
Co-committed-by: Tyfon <tyfon7@outlook.com>
(cherry picked from commit ec76a8897f)
Trader offers with dogtag barter requirements are currently missing the `level` and `side` properties necessary to qualify them. This data already exists in the assorts, just needed to be sent along with the offer.
I considered updating the `side` property of `Requirement` in `IAddOfferRequestData.ts`, but that field is never used, and the client appears to pass 0 for both (even though 0 is not a valid `side`).
Not sure if this should be going to `master` or `310-dev`?
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/378
Co-authored-by: Tyfon <tyfon7@outlook.com>
Co-committed-by: Tyfon <tyfon7@outlook.com>