Commit Graph

1417 Commits

Author SHA1 Message Date
Refringe
4a0d3c3487
Test - BotGenerator - Refactored
- Made the sessionId parameter for generateBotNickname optional and marked it as deprecated, to be removed in v3.9. It wasn't being used.
- Refactored the tests for the generateBotNickname method in the BotGenerator class. Mostly to bring it inline with v3.8 changes to the structure of botGenerationDetails.
2024-04-11 21:18:37 -04:00
Refringe
5aebbb9c86
Test - ItemHelper - 3.8 Refactor
- Removes unused code from getRepairableItemQualityValue in itemHelper
- Updated tests for getRepairableItemQualityValue to no longer assume a special calculation for armour
- Added tests for adoptOrphanedItems (moved from insuranceController)
2024-04-11 21:18:36 -04:00
Dev
fe7ef06c6c Dont force regen stims into PMC secures, may cause problems 2024-04-11 16:29:52 +01:00
Refringe
1cd4b055eb
Test - Updates ItemBaseClassService tests to inline with recent code changes 2024-04-10 23:16:04 -04:00
Dev
e48362ae6e Added setting to allow/deny player wiping a profile via launcher - default true 2024-04-10 22:49:26 +01:00
Dev
885205c742 Fixed fence slowly losing assorts over time 2024-04-10 18:47:51 +01:00
Refringe
3d77ed8595
Seperates ragfair pricing into seperate method
This changes the `RagfairPriceService.getDynamicOfferPriceForOffer()` method to handle the logic surrounding collecting prices for items in offers, while offloading the individual price generation to a new method. The new method, `RagfairPriceService.getDynamicItemPrice()`, is responsible for generating a price for either an item template, or optionally an offerItems collection. This change also allows `getDynamicItemPrice()` to be used elsewhere in the code-base to gather more "realistic" pricing for specific item templates.

Fixes an edge-case where unreasonable prices would only be adjusted on the first item within an offer.

Includes some tests.

Related to #618. This will allow the insurance system to use this method to get better pricing for items.
2024-04-10 12:23:28 -04:00
Refringe
834a2e3ef5 Expanded give command logic (!283)
This change was originally made in master branch, between the time v3.7.6 and v3.8.0 were released. Due to the way that v3.8.0 was merged into master, and the fact that this change was never merged into v3.8.0, it had to be cherry-picked and have some conflicts resolved. I gave it my best and I would love some help testing it before it's merged for v3.8.1.

Conflicts:
- project/package.json
- project/src/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.ts

Resolved by Refringe <me@refringe.com>

Original PR: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/182
Original Commit: 9846adc68b

Original Message:

- Added give by name
- Refactored Commando so its abstracted, that way modders can use it too! :)

Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/182
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>

Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-authored-by: chomp <chomp@noreply.dev.sp-tarkov.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/283
Co-authored-by: Refringe <refringe@noreply.dev.sp-tarkov.com>
Co-committed-by: Refringe <refringe@noreply.dev.sp-tarkov.com>
2024-04-10 09:48:28 +00:00
Dev
9cae27c37e Refactor of isAmmoAbovePenetrationLimit() to separate concerns 2024-04-09 10:39:01 +01:00
Dev
46d48c7531 Added system to filter out ammos from fence by its penetration value
Removed redundant hard-coded ammos from blacklist
2024-04-09 10:29:12 +01:00
DrakiaXYZ
db6ef9bddb Fix bitcoin production time being incorrect (!284)
- Don't apply crafting skill cooldown reduction to bitcoin farm
- Adjust profile bitcoin production time on login to be the correct production time (takes into account dev profile)

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/284
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-04-09 07:48:18 +00:00
Dev
64ddca4124 Improved handling of fence assort item refresh. Duplicate stacks should be much less common
Stacked items can now be partially reduced instead of all or nothing
2024-04-08 20:01:51 +01:00
DrakiaXYZ
8e91842d4c Resolve ItemBaseClassService cache error when iterating all items (!281)
The ItemBaseClassCache is only generated for items with a _type of 'Items', so before trying to look up an item in itemHasBaseClass, make sure the item also has a _type of 'Item'
Move `allDbItems` to a class variable since we need it for looking up the _type of the given template Id

This shouldn't require any changes to mods

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/281
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-04-08 17:40:04 +00:00
DrakiaXYZ
2404e7a5ab Fix issues with incorrectly configured airdrops (!280)
- Don't try to add items to the airdrop if the filtered item list is empty
- If we somehow get into `findAndAddRandomPresetToLoot` with an empty list, don't try to output the id of undefined

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/280
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-04-08 17:39:08 +00:00
Dev
ef2442178a Implement weights for food/drink on bots 2024-04-08 12:31:51 +01:00
Dev
afa5700076 Improved IArmorPlateWeights type 2024-04-08 08:56:05 +01:00
TheSparta
198c7a9720 Workaround swc parsing string as inline sourcemap 2024-04-06 22:36:23 +01:00
Leaves
3be1768672 Make sure trader has enough stock before selling (!278)
Make sure trader has enough stock before selling

Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/278
Co-authored-by: Leaves <mwarciel@gmail.com>
Co-committed-by: Leaves <mwarciel@gmail.com>
2024-04-06 21:22:41 +00:00
Dev
35e48add20 Added ability to override hideout craft times via config 2024-04-06 20:25:57 +01:00
r2go
31641334aa
Issue #246 Reduce server log retention time (!186)
https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/246

Reduces log rotation frequency to 3h.

Co-authored-by: r2go <please@work.now>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/186
Co-authored-by: r2go <r2go@noreply.dev.sp-tarkov.com>
Co-committed-by: r2go <r2go@noreply.dev.sp-tarkov.com>
2024-04-06 12:06:19 -04:00
Dev
13ab57298b Add endpoint to allow getting all bot difficulty data in one call 2024-04-06 16:57:01 +01:00
Dev
da523f2deb
Added clarifying comment 2024-04-06 11:25:09 -04:00
Dev
61dbc2b1d0
Add season handling 2024-04-06 11:25:09 -04:00
Kaeno
0a0cfa39db
Add missing enum to Season 2024-04-06 11:25:08 -04:00
Dev
41391a841d
Add WsReconnectionDelays property 2024-04-06 11:25:08 -04:00
Kaeno
275dc98fdd
Update WildSpawnTypes in server 2024-04-06 11:25:06 -04:00
Dev
6690704208
29577 2024-04-06 11:25:04 -04:00
Dev
18b28a6d0b
Remove unused /singleplayer/settings/weapon/durability endpoint 2024-04-06 11:23:57 -04:00
Dev
798dcfffaa
Prevent nullref when profile is missing the Place of Fame area on game start
variable cleanup in build controller
2024-04-06 11:23:57 -04:00
TheSparta
2dfb5f63f0
Fixed bug in MailSendService.processItemsBeforeAddingToMail
- Fixed bug where some items that were at the root of sent items wouldn't have their slotIds changed to "main", which resulted in people not being able to receive them
2024-04-06 11:23:55 -04:00
Dev
d1e857a408
Fixed issue with items being purged for all bots after a single bot had reached an item limit
(cherry picked from commit f834d14928f5ad3a7d22e6f3d4251d731d203857)
2024-04-06 11:23:55 -04:00
DrakiaXYZ
aabd325804 Fix daily reward budget not being honored when filtering items (!277)
Turns out `Array.filter` returns the filtered array, it doesn't modify the passed in array

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/277
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-04-01 08:38:23 +00:00
Dev
7ccb524eea Fixed refreshed fence assorts being generated at level 2 instead of 1 2024-03-31 16:26:52 +01:00
Refringe
f9d22f409c
Style fixes 2024-03-30 14:29:08 -04:00
Refringe
740ab1e563
Lint fixes 2024-03-30 14:25:46 -04:00
Dev
c05347279b Added variable hideout update() check times when in and out of raid 2024-03-30 15:15:06 +00:00
Dev
df939c693f Fixed Fence assort generation failing when a child item that can be stacked is found, do not allow child items to be stacked. only root items 2024-03-30 15:06:12 +00:00
Dev
467927afeb Further cleanup after removal of persistPurchaseDataInProfile 2024-03-30 13:34:54 +00:00
Dev
f365f979c4 Remove redundant call to incrementAssortBuyCount() 2024-03-30 13:30:36 +00:00
Dev
5595e1d31f FURTHER cleanup of TraderHelper now persistPurchaseDataInProfile was removed 2024-03-30 13:15:28 +00:00
Dev
4e80fa6aae Cleanup of TraderHelper code now persistPurchaseDataInProfile has been removed 2024-03-30 13:11:43 +00:00
Dev
3c96a98a29 Remove persistPurchaseDataInProfile from trader config - causes too many issues when disabled
By default profiles keep track of purchased items
2024-03-30 12:59:56 +00:00
Dev
86bada6194 Fix variable name typo 2024-03-30 12:56:19 +00:00
Leaves
efb69d7148 Actually fixed so that multiple profiles no longer share trader buy limits (!276)
This fixes a bug I found that the server uses partially old logic when using the ``traderConfig.persistPurchaseDataInProfile``

Now it works fine for multiple profiles.

How to test before and after

```
start server
make dev account
buy something trade limited like ASH12 ammo. (Buy all)
make new dev account
try to buy same thing
```

Before it gave the user the error that you've already reached the limit. Even when you had bought nothing on that profile.
Now the trader properly sells you the stuff, with your own profile limit.

Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/276
Co-authored-by: Leaves <mwarciel@gmail.com>
Co-committed-by: Leaves <mwarciel@gmail.com>
2024-03-30 12:55:18 +00:00
Dev
4bb5e3de43 Remove redundant registerProduction() function 2024-03-30 11:33:02 +00:00
Dev
a66b6644a1 Add crafting skill into water filter drain rate calculation
Added small optimisation to only process water filters if a water filter is installed
Added crafting skill bonus to water filter craft time calculation

Various variable/comment renames for clarity
2024-03-30 11:32:14 +00:00
TheSparta
c3e203922e bundle-crc-cache (!274)
This PR is required by SPT-AKI/Modules!104 in order for it to function correctly.

## Overview

- Adds the package `buffer-crc32`, it can generate CRC32 hashes from buffers or strings
- Splits `HashCacheService` into 2 classes `ModHashCacheService` does exactly the same `HashCacheService` used to do, and added a new `BundleHashCacheService`
- `BundleLoader` now generates a CRC32 hash of every bundle file from every loaded mod
- Reworked `BundleInfo` to better represent the data expected by the client when requesting `/singleplayer/bundles`
- Removes all checks on `BundleLoader` that verified if the request was made to a localhost address, this is now addressed by the client.

## Testing

The code has been tested by @Senko-san and me.

Co-authored-by: chomp <chomp@noreply.dev.sp-tarkov.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/274
Co-authored-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
Co-committed-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
2024-03-29 18:43:36 +00:00
Refringe
41ef66298e
Skip Processing Deleted Insurance Attachments
This check simply skips over rolling for insurance for attachment items that have already been deleted due to their main-parent item being previously rolled for deletion.
2024-03-28 00:29:46 -04:00
Refringe
8a20da7e08
Resolves Insurance Attachment Return Issue
This update resolves an issue that was causing items that were not in-raid moddable to be rolled for insurance. We were checking to see if the item is in-raid moddable within the context of the main-parent item (the gun), but not the immediate parent item (upper receiver). This update resolves this by checking to see if the immediate parent is set on the attachment, and if it is, checking within that context instead of the main-parent context.

Thank you to Roselyn Cristal for the report. ♥️
2024-03-28 00:26:40 -04:00
Dev
7939e39945 Improved accuracy of fuel consumption bonus calculation inside updateFuel() 2024-03-27 21:44:58 +00:00
Dev
4e744d3103 Add correct type to cancel-all route + improve comment accouracy of client/match/group/status 2024-03-26 15:44:11 +00:00
Dev
9fca683415 Minor comment changes + use type in place of magic string 2024-03-25 10:38:28 +00:00
Leaves
0bb7d1d350 Fix error when created multiple items with the same unique ID (!269)
Fixes issue #592
https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/592

Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/269
Co-authored-by: Leaves <mwarciel@gmail.com>
Co-committed-by: Leaves <mwarciel@gmail.com>
2024-03-25 08:32:01 +00:00
DrakiaXYZ
757c4506f5 Fix loading bundles from different local folders (!270)
Return a full path to the request for getBundles if running locally

Ran into this while working on updating Gilded Key Storage, looks like bundle files are expected to live in the same local folder as the client any time the server address is `127.0.0.1` or `localhost`.

While working in VSCode for the server, and a different folder for the client, this causes issues trying to work on mods that add bundles, as the server only passes a relative path back to the client

This PR resolves that by returning the full path to bundles when running locally

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/270
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-03-25 08:30:41 +00:00
Kaeno
cd8d6eaecf Update Scav fence rep after using a carextract to keep profiles in sync 2024-03-25 07:28:24 +00:00
Dev
23474bfd67 Remove redundant code 2024-03-24 22:18:05 +00:00
Dev
a35ed657c2 Persist fence standing gain on quest completion into scav profile 2024-03-24 22:16:59 +00:00
Dev
eca6f4bd75 Copy adjusted fence rep value into scav profile 2024-03-24 22:08:32 +00:00
TheSparta
5694af2030 Removed dead code from BundleCallbacks 2024-03-24 17:53:04 +00:00
TheSparta
5e8fb7b303 defered addBundles after PostDBModLoader is run
- defered addBundles after PostDBModLoader is run
- removed unused injected class instances
2024-03-24 17:52:38 +00:00
Dev
fdc6be4dc7 Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2024-03-24 17:17:52 +00:00
Dev
2516354451 Fixed getNewlyAccessibleQuestsWhenStartingQuest() not filtering out quests flagged for non-player side 2024-03-24 17:17:40 +00:00
TheSparta
9de6b19c28 export BundleInfo class 2024-03-24 00:49:53 +00:00
DrakiaXYZ
fdbbc47e59 Fix calculations for the flea min, max and avg to more accurately match live (!268)
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/268
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-03-23 19:18:14 +00:00
Dev
d3fdb08528 Log when profiles save 2024-03-23 17:31:12 +00:00
Dev
f249d7058c Adjust calculateAmmoStackSizeThatFitsBudget() to never let the ammo reward stack go below 1 2024-03-23 11:32:10 +00:00
Dev
cdec8729aa Fixed scav case never giving unarmored rigs as a reward 2024-03-23 11:23:29 +00:00
Dev
7b557a31ad Small formatting changes 2024-03-23 10:59:08 +00:00
Dev
a39d8b8419 Update daily reward system to use global reward item blacklist 2024-03-23 10:50:17 +00:00
Dev
ea18533591 Make use of reward item blacklist in airdrop reward code
Blacklist boss items from airdrop rewards
2024-03-23 10:44:28 +00:00
Dev
580d5b9829 Make use of item reward blacklist in scav case system 2024-03-23 10:43:08 +00:00
Dev
cf490c841e Create centralised reward blacklist 2024-03-23 10:42:43 +00:00
Dev
28d40d9443 Log IP of request when not a local address 2024-03-23 09:41:36 +00:00
Kaeno
d5517d7fdf Remove server calculation of scav rep post raid changes. awaiting Client Calculations 2024-03-21 15:21:02 +00:00
Dev
04aad787d3 Store the fence rep diff after a raid has concluded, add endpoint to allow retreval of this value 2024-03-21 12:23:03 +00:00
Dev
443bc72995 Remove unnecessary code from flagItemsAsInspectedAndRewardXp as issue is now fixed at source 2024-03-20 18:02:19 +00:00
Dev
ecfd6883d0 Init scavs Encyclopedia on generation 2024-03-20 17:58:32 +00:00
Dev
ee7c2aab36 Nullguard inspecting a keycard when scav has no encyclopedia init 2024-03-20 17:47:48 +00:00
Dev
e3b31ed972 Added extra IFAKs to PMCs + replaced morphine with etg regen stims 2024-03-20 15:10:39 +00:00
DrakiaXYZ
a29902b980 Add a new allExtracts property to locations database, and use it for daily quest generation (!266)
- Dumped from the client using an aki-debugging patch
- Contains all extracts according to the map data, with a side indicator
- Cleaned up ILocation vs ILocationData duplication

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/266
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-03-20 09:43:51 +00:00
Kaeno
480683b25b Remove grizzly from PMC secured container to avoid dropping them on the ground. 2024-03-19 12:18:09 +00:00
Dev
28082808a8 Remove unused code 2024-03-18 21:11:00 +00:00
Dev
c879e852ed Fix watermark not displaying correctly for non-english locales 2024-03-18 21:07:47 +00:00
Dev
5d59e4c36e Fix issue with using LogTextColor.GRAY 2024-03-18 20:34:23 +00:00
Dev
dfdf1d22db Ensure fromRUB() never returns value below 1 2024-03-18 16:25:04 +00:00
Dev
b5565f3901 Perform currency conversion at end of getDynamicOfferPriceForOffer() if necessary instead of for each item in loop
linting
2024-03-18 16:23:04 +00:00
Dev
f2254b150a Add funtionality to propigate scav Charisma gains into PMC based on live testing 2024-03-18 12:56:34 +00:00
Dev
4c872a343f Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2024-03-18 09:59:13 +00:00
Dev
067aaae706 Handle edge case in updateFuel() where function can fail due to fuel item lacking a upd object
Lint file
2024-03-18 09:58:59 +00:00
TheSparta
d4c04fc718 Simplified autoInstallDependencies() 2024-03-18 00:06:08 +00:00
TheSparta
e73fea8776 Fixed undefined behaviour
- Would break out of the loop at the first dependency removed from `dependenciesToInstall`.
2024-03-17 23:19:56 +00:00
Dev
6af4126bc8 Resolve issue with PMCs having seasonal items on their person when they shouldn't 2024-03-17 13:33:31 +00:00
Dev
1f16e96ae9 Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2024-03-17 12:27:50 +00:00
Dev
2ffe44d153 Made ragfair run interval time dynamic based on players current location:
Player in raid = longer time between checks (60 secs)
Player out of raid = shorter time between checks (8 secs)

Original value was 45 secs
2024-03-17 12:27:24 +00:00
Cj
0a935651f5 Add mod enabled text for the disclaimer window (!264)
Add another variation stating mods are enabled for the beta disclaimer window

![image](/attachments/af517b44-e613-4fd4-81fd-c2434d6478b5)

Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/264
Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com>
Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
2024-03-17 08:55:02 +00:00
DrakiaXYZ
e497ecc125 Fix flea avg and fee calculations (!265)
Properly calculate the flea average, excluding barter offers for a more live-like result
Prioritize handbook price for the /client/items/prices route to match live

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/265
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-03-17 08:54:34 +00:00
Dev
95f5a49c5c Update trader refresh times to use a min and max value 2024-03-16 22:12:03 +00:00
Cj
be64e897b9 Enable BSG logging (!262)
Needs merged with: https://dev.sp-tarkov.com/SPT-AKI/Modules/pulls/96

Read details there.

Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/262
Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com>
Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
2024-03-16 21:03:52 +00:00
Refringe
72ddbc4192
Adds bleedingmods Build Type 2024-03-16 16:11:24 -04:00
Dev
252d009283 Prevent outdated mods from loading 2024-03-16 19:18:25 +00:00