Commit Graph

1349 Commits

Author SHA1 Message Date
DrakiaXYZ
4b8b62ae83 Utilize the release callback returned by lockFileSync to release the lock file (!239)
The error people are getting about a lock file already existing is due to `checkFileSync` returning false if the lock file is "stale".
The default "stale" timeout is 10 seconds, so if a save takes longer than this, the user will end up in a state where they can no longer save.

The documentation for `proper-lockfile` recommends using the callback returned by `lockFileSync` to remove the lock file, so I've switched to using this, and the error no longer occurs with long running save operations

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/239
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-28 07:56:53 +00:00
DrakiaXYZ
0433308fa8 Fix tools not coming back with the right properties after crafting (!238)
This resolves an issue where FiR tools were coming back as non-FiR. We now just store the whole .upd property, so any stats on the tool should carry over to after the craft is finished

Note: Will break any in-progress crafts that use tools

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/238
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-28 07:55:39 +00:00
phrisk
42782589e0 Return after returning player offers to avoid redundant remove offer following (!237)
#### Summary

> Should fix [Issue 523](https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/523)

Tested a few different scenarios and the items were always correctly removed and returned to the player, however I did see the console warnings reported in the issue.

Both of the following call `this.ragfairOfferHandler.removeOffer(...)`:

 - `this.returnPlayerOffer(...)`
 - `this.removeOfferById(...)`

The latter logs a warning to the console because the offer is already removed when we reach that point.

This fix simply returns after the offer has been returned to the player, letting `returnPlayerOffer` deal with removing from the flea

Co-authored-by: phrisk <phrisk@phrisk.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/237
Co-authored-by: phrisk <phrisk@noreply.dev.sp-tarkov.com>
Co-committed-by: phrisk <phrisk@noreply.dev.sp-tarkov.com>
2024-02-27 23:45:47 +00:00
Dev
a1a5aa356a Add missing medical filter on backpack loot cache builder
remove hard coded 2 stim limit from assault
2024-02-27 23:44:23 +00:00
Dev
bf317b6c2f updated setFindInRaidStatusForItem() to be protected + added return type
Improve comments inside `InventoryHelper`
2024-02-27 12:12:46 +00:00
Dev
3bc9833e57 Update getPlayerStashSize() to take into account bonus STASH_ROWS 2024-02-27 12:02:03 +00:00
Dev
7ec5d89608 Add ability to insert stash rows to profile 2024-02-26 23:51:45 +00:00
Dev
bde364388f Allow enabling snow in raid via SPT friend 2024-02-26 19:35:18 +00:00
Dev
51e1f7734e Add missing standing logging inside getFenceStandingChangeForKillAsScav() 2024-02-26 19:15:26 +00:00
Dev
47882e59d6 only show Found x insurance packages in profile in console, not log file 2024-02-26 18:24:45 +00:00
Kaeno
3c113ddf7f Fixed ammobox breaking client + profile due to ragfair refresh adding extra ammo to ammo boxes 2024-02-26 16:32:56 +00:00
DrakiaXYZ
1deb6d9488 Add trader service requirement support & LKS Service requirements (!235)
Add LightKeeper trader service requirements

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/235
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-25 20:18:54 +00:00
Dev
40b31e1fe0 improved initialize() inside PresetController 2024-02-25 11:54:13 +00:00
Dev
a5450c6552 Moved addItemWithChildrenToEquipmentSlot() from BotWeaponGeneratorHelper to botGeneratorHelper 2024-02-25 11:45:34 +00:00
Dev
5f8b0592cc Updated foldItem() to use a .find() call instead of looping over all inventory items 2024-02-25 11:43:49 +00:00
Dev
2839ce8c77 Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2024-02-25 11:18:01 +00:00
Dev
1dda9efbd7 Move ExhaustableArray into its own file + make it implement interface 2024-02-25 11:17:33 +00:00
DrakiaXYZ
2adbb6a5fe Properly take and return tools when crafting (!234)
When starting a craft, tools are now taken, and the templateId is stored in the production in the user profile
When finishing a craft, space for both the tools and crafted item is verified, then both are added to the player stash correctly flagged as non-FiR and FiR respectively

Included a bit of code cleanup/reorg in areas I was working in

A few assumptions were made:
- Tools are expected to be single items, not stacks of an item (productions.json doesn't include a count property for tools, so this seems safe)
- Tools will never be a preset or have child items
- That the `canPlaceItemsInInventory` method over a concatenation of the tools and crafted item(s) will result in the same result as calling it individually over the two collections of items individually

Will need tested once merged into 380, I did basic testing, but there's a lot of different crafts that require tools

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/234
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-25 08:53:57 +00:00
DrakiaXYZ
19013a478f If a preset has a different _id property than its object key, output an error and skip it. (!233)
This resolves an issue where a mod with bad preset data is able to break loot generation

Can be tested by changing the "\_id" property of an item preset in globals.json, and seeing the error output to the console.

A better solution for the future may be to deprecate the "\_id" property entirely, and use just the object key, however that would have more far reaching changes compared to this simple fix

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/233
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-24 23:26:27 +00:00
Dev
b5cde813a3 Cleanup of date calculation code 2024-02-23 16:10:18 +00:00
Dev
386aeee9d7 Updated server to match raid times with live 2024-02-23 16:05:30 +00:00
Dev
6d84dbb2d4 Commnent improvement 2024-02-22 21:51:44 +00:00
Dev
104fd03b39 FIxed infinite loop when only one item exists in pool and bot has maxed out number of that item already 2024-02-22 21:48:57 +00:00
Dev
5e496af804 Move itemLimit code to be across all bot containers instead of per
Remove a tpl from loot pool once an item limit has been reached - prevents it being picked over and over
Remove loot data from pmc jsons as its generated dynamically, adding data into jsons now acts as an override for the dynamic generation
Reduced rouble max count to 1 for PMCs

Split PMC loot caches by side (usec/bear)
2024-02-22 16:34:15 +00:00
Dev
cdb55ef7d5 Weight PMC look by price, higher price = smaller weight 2024-02-22 14:02:32 +00:00
Dev
ded7142774 Comment improvement 2024-02-22 13:55:57 +00:00
Dev
a26ff26a4a Add code to add items to a wallets flee slot if available 2024-02-22 13:52:59 +00:00
Dev
25a4e64e9a Invert Currency check 2024-02-21 18:37:24 +00:00
Dev
9525953444 Add code to insert roubes into wallets on bots 2024-02-21 18:36:45 +00:00
Dev
cc0f543bdf Rewrote how bot loot is stored + chosen during bot gen
All loot is now weighted - weights come from offline-live bot dumps

Removed `lootNValue` - loot is no longer picked by its value
Regenerated bot loot files - i saw some additional weapons get added to scavs
2024-02-21 17:36:27 +00:00
Dev
6cda845f1f Handle when foldItem() tries to modify an item without a upd object 2024-02-20 14:17:04 +00:00
Dev
867b1ea50f Add COMB_MUZZLE_DEVICE to BaseClasses enum 2024-02-20 13:12:30 +00:00
Dev
2e8cb81016 Format draw() 2024-02-20 09:12:16 +00:00
Dev
0bf2cf38fe Add logging to drawAmmoTpl to help with finding mod errors 2024-02-20 09:07:48 +00:00
Dev
472ab0eabd Add keys to fence
Reduce key listing cap to 15k
lower key price the less uses it has
Increase current durability cap of armor to 50% from 1%
Reduce jewlery cap to 40k from 50k (removes gp coins and golden necklace)
2024-02-19 16:58:07 +00:00
Dev
5917fbce38 When generating a bots appearance check if it has a body/hand mapping in globals and use that if isNotRandom is set 2024-02-19 11:55:24 +00:00
Dev
68a78d8bdd Add extra types to BaseClasses and fix typo 2024-02-18 21:10:41 +00:00
Dev
7406ee389e Improve emulation of fence item prices
Specifically medical items with < 100% usages remaining
2024-02-18 20:20:24 +00:00
DrakiaXYZ
886d99bb71 Fix achievement progress being wiped after doing a scav run (!232)
There is no need to copy all achievement counters from scav to PMC, we only need to copy the achievement counters where the achievement side is "Savage"

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/232
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-18 16:32:46 +00:00
DrakiaXYZ
97994fc0a6 Handle IsAlwaysSpawn in the same way we handle spawnpointsForced to allow single spawn restrictions (!231)
Also move the relaxation key single spawn limit to Streets instead of shoreline

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/231
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-18 09:03:37 +00:00
Dev
2e245d98ff Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2024-02-17 21:56:23 +00:00
Dev
5386ca8d5a Small improvements to updateFuel() 2024-02-17 21:55:43 +00:00
DrakiaXYZ
b84531bb27 Fix the "Unable to transfer stack" exception on scav post-raid screen (!230)
Switched `transferItem` to use the `getOwnerInventoryItems` method, so that it properly handles transfer events on the scav inventory

Bit of cleanup and consistency changes made to the `transferItem` method

Testing instructions in issue: https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/483

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/230
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-17 20:53:47 +00:00
DrakiaXYZ
8853ff9aad Remove maps the player can't access due to PMC level from the list of possible daily locations (!229)
This change should handle any map having its level range changed.

With base data, no changes should occur, because GZ currently lists level 0-100 as its level range. You can however change GZ's base.json to limit it to level 20 for testing

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/229
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-17 10:48:52 +00:00
DrakiaXYZ
91c154daa8 Fix some armor not showing up on the flea when Operational filter is enabled (!228)
Some plate carriers have no required plates, and thus were failing the functional check. I've changed it to check for an item count greater than the required plate count (Since `items` also contains the carrier itself).

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/228
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-17 10:48:22 +00:00
Dev
64810f7216 Fixed completing a quest not failing linked quests properly 2024-02-17 10:46:38 +00:00
Dev
e9ad1c50a0 Fixed quest completion check not working for quests that have string values inside its AvailableForStart status array 2024-02-17 10:13:19 +00:00
Kaeno
fbbc410182 fix not being able to sell keys that are unlimited and have uses. Thanks drakia 2024-02-16 21:18:06 +00:00
Dev
edd5f0bbb4 Log skills gained when repairing armor using kits 2024-02-16 20:02:00 +00:00
Kaeno
9d96f97b55 Add maxPatrolValue route for module to pull data from. Added sandboxMaxPatrolvalue to location.json. linting on location.json 2024-02-16 16:17:55 +00:00
Dev
bb10151bda Add Santas's bag to christmas event items array 2024-02-16 15:30:56 +00:00
Dev
87229cc58d Make killing a traitor scav give positive fence rep 2024-02-16 15:11:09 +00:00
Kaeno
ab86830a1a Update Wildspawntypes Enums to match client 2024-02-16 14:40:52 +00:00
Dev
8be821cec0 Clear bot cache of data prior to generating bots for first time 2024-02-16 14:40:14 +00:00
Dev
21caeed3db Improve fence multi-stack assort handling 2024-02-16 13:41:16 +00:00
Kaeno
cfe321cf4b Change durability calculation to match live better 2024-02-16 12:56:39 +00:00
qe201020335
a7ae3c3c67 Fix ProbabilityObjectArray.draw returning undefined when the pool is initially empty (!227)
It now returns an empty array if the pool is initially empty.

This function does not guarantee the number of elements returned because it will break out the loop early if the pool is exhausted.

Co-authored-by: qe201020335 <qe201020335@sina.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/227
Co-authored-by: qe201020335 <qe201020335@noreply.dev.sp-tarkov.com>
Co-committed-by: qe201020335 <qe201020335@noreply.dev.sp-tarkov.com>
2024-02-16 10:12:15 +00:00
Dev
7bc867a8f7 Replace labsAccessCardChancePercent with lootItemsToAddChancePercent inside playerscav.json
Fixed scav generation on profile generation always using fence rep 0

Added small % chance to add red flare to pscav
2024-02-16 09:59:43 +00:00
Dev
2965709535 Fix ammo packs not showing on fence 2024-02-15 23:34:04 +00:00
Dev
d352f678b3 Removed debug logging 2024-02-15 23:14:53 +00:00
Dev
d5627e0627 Rewrote fence itemTypeLimits and itemCategoryRoublePriceLimit
Fixed bug where item limit was off by one
2024-02-15 23:14:31 +00:00
qe201020335
a1d82af41f Fix dynamic loot generation not respecting spawn point's IsAlwaysSpawn field (!226)
A similar field can also be seen in static container generation which the value is respected

Also Limited the amount of random draws to avoid going over the `desiredSpawnpointCount`
- Consider a potential mod that changes every spawn point's `IsAlwaysSpawn` to true, then there is absolute no point for the generator to draw them again and only to have them removed during dedupe

Co-authored-by: qe201020335 <qe201020335@sina.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/226
Co-authored-by: qe201020335 <qe201020335@noreply.dev.sp-tarkov.com>
Co-committed-by: qe201020335 <qe201020335@noreply.dev.sp-tarkov.com>
2024-02-15 09:09:35 +00:00
DrakiaXYZ
d77c930396 Fix bitcoin desync between client/server while offline (!225)
The server expects that the total "Progress" when a bitcoin is complete to be the "ProductionTime" value (145000 by default). However the server was using a modified target value, while only adding the actual time change to the Progress.
This results in a drift over time between the client/server while the server is stopped, as the client gets an incorrect value on startup.

If we instead scale the addition to Progress based on the adjusted craft time, and target the base productionTime for completion, we can get a much more accurate progress while offline that matches the client

I used the profile from this ticket for testing: https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/496

The user has both an upgrade and bitcoin going at the same time, so they should progress at the same rate. This is what the code was previously resulting in:
![image](/attachments/fe428a3b-d271-40e1-a3f6-08ef936224b6)

While the server was shut down for 50 minutes (As noted by the upgrade), only 36 minutes was deducted from the bitcoin craft.

This is the result of that same profile after these changes were made:
![image](/attachments/d2ce44e6-1a0e-4991-aa51-3eb340c22ca5)

You can see that ~2 hours 25 minutes was deducted from both the upgrade, as well as the bitcoin craft timer. There is still a slight discrepancy, but in a total bitcoin run it should be minimal

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/225
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-15 08:57:26 +00:00
Dev
f449a51f6a Further output object changes 2024-02-14 15:11:19 +00:00
Dev
99df88ec24 Clean up passing IItemEventRouterResponse around and then returning it in same function 2024-02-14 14:59:43 +00:00
Dev
b294766304 Only pass sessionId into createPlayerOffer() instead of full profile 2024-02-14 14:12:53 +00:00
Dev
8ad8193194 Improve comments 2024-02-14 14:11:54 +00:00
Dev
bafb3e4569 Remove unnecessary pre SPT 3.6.x null check 2024-02-14 14:04:30 +00:00
Dev
22d158f8a4 Remove second call to this.saveServer.getProfiles() + only run offer processing for profiles that have the necessary level to create flea offers 2024-02-14 14:01:27 +00:00
Dev
991ee312bd Remove redundant call to get pmc profile when we already have full profile 2024-02-14 13:52:44 +00:00
Dev
882d1b6ee5 FIx equipment preset flea seach not showing any offers 2024-02-14 11:58:17 +00:00
Dev
d5217928c2 Add 40% chance armors with plates do not have them whem listed on flea - mimics live behaviour 2024-02-14 11:12:20 +00:00
Dev
9403ff796e Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2024-02-13 16:32:01 +00:00
Dev
9c2ee34d6f When inspecting item, save result to scav and pmc profile 2024-02-13 16:16:36 +00:00
DrakiaXYZ
dd05fe743f Fix double quotes in container tags (!222)
As far as I can tell, there's no need to strip backslashes, as they should only exist to escape other characters (Double quotes, for example). Stripping them will more often than not result in invalid JSON

NOTE: Due to the loss of git history, I'm unable to see _why_ exactly this replacement was done in the first place. There may be some valid reason I'm not thinking of. If this is the case, I can look at other solutions

Resolves: https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/488
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/222
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-13 15:55:11 +00:00
Dev
7975ebafda Pass full profiles into mergePmcAndScavEncyclopedias 2024-02-13 13:07:26 +00:00
Dev
2e3f624131 Update PMC encyclopedia post-raid
Update scav encyclopedia during generation to be pmc encyclopedia

Remove redundant return statements from function
2024-02-13 12:20:30 +00:00
Dev
1c63d85649 merge encyclopedia dicts together post-raid 2024-02-13 12:10:17 +00:00
DrakiaXYZ
bf60fb7ea9 Fix flea armor not having proper random durability (!223)
Clone flea items prior to passing them off to the createSingleOfferForItem method

This change results in more armor on the flea having 100% durability, and less having identical non-max durability values

Resolves: https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/447

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/223
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-13 08:34:55 +00:00
Dev
69870d191e improve preset price multipler calculation - reducces preset prices overall 2024-02-12 23:59:02 +00:00
Dev
6709300e93 Update moveItem() to better handle when the item being moved has no slotId 2024-02-12 23:14:04 +00:00
Dev
c4520ddbe9 Protect again null quest object when trying to send a message during quest failure 2024-02-12 21:23:20 +00:00
Dev
0fb0d0bd60 Cache bots sent to client to spawn in raid, cleared post-raid 2024-02-12 17:11:23 +00:00
Dev
456220767e Do not reduce scav rep after killing a traitor scav 2024-02-12 17:08:21 +00:00
Dev
5dacc1419e Do not count price of soft inserts towards armor prices when listed on flea 2024-02-12 16:39:20 +00:00
Dev
7b1fd03f1d Delete amulet from inventory when charges is 0 or below 2024-02-12 16:00:25 +00:00
Dev
ae1bc9ad3a Nullguard against items without a slotid 2024-02-12 15:33:16 +00:00
Dev
d7e37b0218 make ICultistAmulet optional 2024-02-12 15:15:20 +00:00
Dev
430437974c Add comment 2024-02-12 15:10:45 +00:00
Dev
77baeeee42 Decrement cultist amulet uses after each raid by one 2024-02-12 15:08:08 +00:00
Dev
e9af6e3868 Update JSON + add new properties 2024-02-12 15:06:51 +00:00
DrakiaXYZ
28b0a55732 Fix/add some trader services data for LK Services (!221)
- Fix data type for TraderServiceModel
- Add LK Service price/item data

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/221
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-12 09:21:48 +00:00
Dev
28c9ddad9c Fixed repair kits not giving skill points when repairing armors 2024-02-11 21:24:58 +00:00
Dev
b2b45f2972 Slightly reduce expired offer count threshold 2024-02-11 19:51:49 +00:00
Dev
872c6282ec Fix being unable to sell items on flea that have been adjusted via itemPriceMultiplier property
Take into account adjustment when calcualting sell chance
2024-02-11 19:50:44 +00:00
Dev
805190abb4 Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2024-02-11 19:22:20 +00:00
Dev
575f467f78 Tie random weapon reward to rouble reward
Prevents daily quests from choosing high-level weapons as a reward for low level dailies
2024-02-11 19:22:00 +00:00
Kaeno
28ab029ef3 Fixed ammo boxes again. location starts at highest count instead of lowest 2024-02-11 17:31:52 +00:00
Dev
9e70b1135c Reverse ammo stacks in ammo boxes to fix issue with opening ammo boxes in raid - Thanks to Kaeno for investigation + fix 2024-02-11 15:15:21 +00:00
Dev
71f308c288 Cleanup of default presets being added to container code 2024-02-11 15:06:03 +00:00
Dev
baa2da9b8e Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2024-02-11 14:59:33 +00:00
Dev
bba30d616b Fix durability filtering on flea not working for helmets / armors
Updated  `getItemQualityModifierForOfferItems()` to return root items quality modifer when its a weapon
Fixed `getItemQualityModifierForOfferItems()` assuming quality started at 1
2024-02-11 14:59:25 +00:00
Kaeno
a4f1cb23d9 Temporary fix for containers having missing items. due to Armor not being generated correctly 2024-02-11 14:45:01 +00:00
Dev
da6244e1ac Improvements to calculateFenceStandingChangeFromKillsAsScav() - should properly handle additional rep loss when over 6 fence rep 2024-02-11 13:03:38 +00:00
Dev
5ec01d51c7 swap let to const 2024-02-11 12:16:08 +00:00
Dev
9819ac3737 Mimic live behaviour for ammo box locarion values 2024-02-11 12:12:27 +00:00
Dev
b5639f481f More logging 2024-02-11 10:51:00 +00:00
Dev
a0083f281e Log fence rep post-raid 2024-02-11 10:39:31 +00:00
Dev
ff1e80e302 Add endpoint to configure trailtor scavs 2024-02-11 10:32:13 +00:00
Kaeno
f2bcbbf8ab Updated forgotten TaskConditionCounters for scav TaskConditionCounters migration code. 2024-02-11 00:26:45 +00:00
Dev
1858fe5bd5 Fix pockets being lost on death 2024-02-10 23:28:36 +00:00
Dev
fea17cf3db Pass output into more event functions 2024-02-10 16:32:37 +00:00
Dev
f7a16e15f9 Reset client output object data at end of function, instead of at start - fixes issue where old profile change data persists in memory after player logs out and into another profile
Pass output into failquest function
2024-02-10 16:23:26 +00:00
Dev
4232ba6db1 Pass output object into various other inventroy actions 2024-02-10 16:08:42 +00:00
Dev
9fe739debb EXPERIMENTAL - pass output object into handleItemEvent and into move function 2024-02-10 15:44:21 +00:00
Dev
d436534ea0 Fixed flea quality filters not applying to weapons 2024-02-10 15:06:20 +00:00
Kaeno
882c1d6082 Allow Scavs to examine items and retain their Encyclopedia (Examined Items) 2024-02-10 14:17:33 +00:00
Kaeno
963e0a8739 Dont inform client when hall of fame is upgraded as BSG doesnt inform the client upgrade has occurred, Prevents client from locking up 2024-02-10 12:30:54 +00:00
Dev
b34edb0d3b Adjustments to profile saving logging logic
Bundle up profile save time and display in one line + do not log to file
Don't log when each profile is saved
Do not log to file how much fuel is left in generator
2024-02-10 10:07:40 +00:00
Dev
973b74bd98 Add ability to control weapon/equipment current durability
Fixed non-armored rigs not showing
Blacklist mk-18
2024-02-10 09:57:44 +00:00
DrakiaXYZ
9573290778 Fix daily quest weapon rewards (!219)
The rewardItem.target has to be set after the item IDs are regenerated, so it gets the new root item ID

Resolves: https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/470

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/219
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-10 08:54:12 +00:00
Dev
97cc3f1de3 Fix manually adjusted items being down-priced by unreasonableItemPriceChange code 2024-02-09 23:36:55 +00:00
Dev
fbd371b5c7 Fix code that would detete majority of quest progress from profile 2024-02-09 23:18:23 +00:00
Dev
d3f66a85a0 Allow unreasonable item price code to work with item sub types 2024-02-09 22:28:25 +00:00
Dev
4b9f2ddbd1 Fixed 2 issues with collecting bitcoins;
Only check if progress was only `great than` craft time, not `great than or equal to`
Didn't take into account developer accounts have reduce craft timers
2024-02-09 22:01:19 +00:00
Dev
eeef5a1d92 Comment improvements 2024-02-09 17:13:58 +00:00
Dev
1cfc7f2a16 Fixed issue with server not properly handling item rotations when trying to fit an item into a container
Added small optimisations to skip full rows when looking for a free slot to put item in
Added small optimisation to skip looking for a free slot when entire container is full
Fixed error messages not properly being passed back up chain
2024-02-09 17:13:19 +00:00
Dev
8b6de1a7ea Rename splitStackIntoSmallerStacks to splitStackIntoSmallerChildStacks 2024-02-09 15:57:54 +00:00
Dev
8e80fa6350 Removed unused function hydrateAmmoBoxWithAmmo() 2024-02-09 15:48:57 +00:00
Dev
4a8c12dc59 Improve canPlaceItemInInventory() logging
Increase attempts to fit into container to 3 from 2
2024-02-09 15:18:49 +00:00
Dev
5a8317b8a1 Correctly pass item rotation when calling fillContainerMapWithItem()
Removed unused legacy function `placeItemInInventoryLegacy()`
Dont return stash layout as result in `fillContainerMapWithItem()`

Added small optimisation to `fillContainerMapWithItem()`, check if all slots of failled before trying to fit item
2024-02-09 15:13:49 +00:00
Dev
791ebd4693 Moveed handling of unreasonableModPrices into ragfair code instead of on game start
Lowered weapon mod threshold from 9x to 6x
2024-02-09 14:13:48 +00:00
DrakiaXYZ
cc6061b885 Resolve issue caused by quests pulling loose ammo from magazines (!218)
If the item handed in for a quest has a numeric `location` property, this indicates it's inside a magazine or other "sequential" container.
Re-calculate the `location` property of all children in the items parent in this case, to avoid gaps which break the profile

Resolves: https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/455

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/218
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-09 12:53:44 +00:00
Dev
74ea69ffe6 Remoe unused enabled properties from ragfair config chancePercent is used instead 2024-02-09 12:46:23 +00:00
Dev
e915d17019 Reworked fence assort generation and partial refresh
Split item generation values up, separate value for item/equipment/weapon
Fixed more assorts being generated than were being deleted each partial refresh
Added assort item options to discount assort config
2024-02-09 12:39:58 +00:00
Dev
b7b08f99f2 Add functionality to apply a multipler to individual dynamic offers on flea
Use new functionaliy to apply a large multipler to `5.45x39mm BP gs ammo pack` items to match live data
2024-02-09 09:56:18 +00:00
Dev
28677f672b Fence changes:
Larger number of weapon presets
Larger stack size for ammos (override stack size of ammo by parent id, not item id)
Removed ammo boxes from blacklist + add max limit of 2
Removed fence debug logging
Make weapon picker check if weapon is on blacklist before adding
Fixed incorrect weapon mod removal check
Reduced chances mods are removed from weapons
2024-02-08 21:58:47 +00:00
Dev
596785eda9 Added support for ammo box hydration on fence 2024-02-08 21:31:46 +00:00
Refringe
2df185bbbe
Style Lint Run
`npm run style:fix`
2024-02-08 16:00:08 -05:00
Refringe
115f217c02
Refactor Insurance Processing for Gear Lost in Raids
Notable coding Changes:
- Added `getRootItemParentID` method in `InsuranceService` to standardize the determination of the root insurance container.
- Added `IInsuranceEquipmentPkg` model for structuring insurance packages, a type used to store insurance item data before it's saved in the profile.
- Added `HashUtil` in `InsuranceController` and `InsuranceService` for generating an ID for the root insurance container in the case that the root ID cannot be found.
- Updated and normalized item map generation and usage across `InsuranceService` and `InsuranceController`.
- Updated `ItemHelper` with new methods `adoptOrphanedItems` and `generateItemsMap`, facilitating better management of item relationships and efficient item look-ups.
- Updated `InsuranceController.findItemsToDelete` and related methods to use the new `rootItemParentID` parameter to ensure that all root level items share the same parent ID.
- Updated logic in `InsuranceService` for creating insurance packages and handling orphaned items.

Uh-huh, but what would you say you do here?
- Resolves an issue that arose when `lostondeath.json` equipment configuration options were set to `false`. On death, the equipment's children items would be sent back to the player through insurance, duplicating them.
- Resolves an issue that prevented items from appearing in an insurance return even though they passed an insurance roll.
- Improved debug logging.

Remaining Oopses:
- We do not have data on items that were dropped in a raid. This means we have to pull item data from the profile at the start of the raid to return to the player in insurance. Because of this, the item positioning may differ from the position the item was in when the player died. Apart from removing all positioning, this is the best we can do.

Resolves #425
2024-02-08 15:57:04 -05:00
Dev
2d27aaf545 Update assorts 2024-02-08 20:42:40 +00:00
Dev
c097914e45 Add system to ignore armor plate slots when removing plates not suitable for flea 2024-02-08 16:53:14 +00:00
Dev
7d97bc4945 Correctly generate ammo boxes for dynamic/static/bot loot with one stack of cartridges. It seems the 0.14 client update now handles ammo boxes having a single stack and properly splits the ammo inside it 2024-02-08 16:01:38 +00:00
Dev
810cd8abd6 Improve flea offer item durability randomisation
Expanded `condition` config system to separate out current and max durability
Added missing armor config settings
Rewrote weapon durability method `randomiseWeaponDurabilityValues()` to do work similar to `randomiseArmorDurabilityValues()`
Fixed various items being classified as ARMORED_EQUIPMENT and using the wrong category config values
Moved ARMORED_EQUIPMENT to bottom of config so its chosen last, fixes vests being flagged as wrong item
2024-02-08 14:52:09 +00:00
Dev
adf973bf49 Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2024-02-08 11:45:20 +00:00
Dev
a06e0d1641 Improve flea handling of quality filtering for offers with child objects like armors/plates/weapons 2024-02-08 11:45:12 +00:00
DrakiaXYZ
bc8e98dadc Fix the server sell all price not matching the client displayed value (!216)
Resolved by having the client send the sell price instead of trying to calculate it on the server. Same route, just with an extra parameter passed in

Removed unnecessary value calculation code, and renamed method to match new behaviour

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/216
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-02-08 09:10:06 +00:00
Dev
7a33eea672 Small cleanup of fence item removal code -reduce assort size to 140 to ensure its divisible by partialRefreshChangePercent without remainder 2024-02-07 23:44:15 +00:00
Dev
8756431774 Ensure giveProfileMoney() rounds money its sending to nearest integer 2024-02-07 23:23:19 +00:00
Dev
439c412800 Ensure fence assorts are always rounded to nearest integer 2024-02-07 23:17:22 +00:00
Dev
15bf71b16f Move daily money reward into its own function 2024-02-07 20:56:54 +00:00
Dev
cc2e820290 Move ammo stack size calcualtion into its own function 2024-02-07 20:51:12 +00:00
Dev
98b592f0c2 Prevent daily rewards from picking armors with soft inserts to duplciate reward count of 2024-02-07 20:43:45 +00:00
Dev
0759afb84f Update daily system to correctly reward just weapons when traderWhitelistDetails.weaponRewardChancePercent passes its check instead of weapons or armor 2024-02-07 20:32:24 +00:00
Dev
424e438732 Improve how daily quests calculate the price of items when choosing a reward that's inside its price boundaries
Items with a default preset inside globals.json now use all items inside the preset for price calculation
2024-02-07 20:15:44 +00:00
Dev
4e20ca6744 Remove debug logging, its scaring too many people 2024-02-07 18:01:00 +00:00
Dev
57855fd316 Add whitelist system to magazine filling function fillMagazineWithRandomCartridge(). Fixes issues with kedr being filled with incompatible ammo 2024-02-07 14:45:43 +00:00
Azrael1123
7a4b27bbe1 Better fix for SPT-AKI/Issues#417 (!215)
[The wiki specifies](https://escapefromtarkov.fandom.com/wiki/Scavs#Scav_karma) that, between 6 and 8, Fence rep is reset to 6 before penalties are applied (i.e. killing someone at 7.5 rep leaves you at 5.9), but the current fix just subtracts a flat 1 reputation instead (i.e. a kill at 7.5 leaves you at 6.4)

this should change that.

Co-authored-by: Azrael <Azrael@noneofyourbusiness.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/215
Co-authored-by: Azrael1123 <azrael1123@noreply.dev.sp-tarkov.com>
Co-committed-by: Azrael1123 <azrael1123@noreply.dev.sp-tarkov.com>
2024-02-07 08:18:18 +00:00
Refringe
ebbc3e2029
Refactored InsuranceController for Better Attachment Handling
Made several improvements to the `InsuranceController` to ensure a more reliable and logical handling of insured items and their attachments.

- Updates `parentAttachmentsMap` declaration to `let` for mutability, enabling dynamic updates during processing.
- Updates `parentAttachmentsMap` to initially include all attachments (including attachments that should not be in-raid moddable).
- Updates `processRegularItems` logic to include `parentAttachmentsMap` in its parameters and logic. Now better ensures that attachments are correctly identified and processed alongside their parent items.
- Adds `removeNonModdableAttachments` method to filter out non-moddable attachments from processing.
- Updates deletion logic to better handle cases where items, such as armour vests and their non-removable plates, are processed to prevent orphaned items post-deletion.

Resolves #401
2024-02-07 01:16:46 -05:00
Refringe
2aa0054833
Insurance Package Removal Issue
Resolved an issue that caused insurance packages that were created/lost in the same raid with different traders to be removed all at once instead of one-by-one after they were processed. This shouldn't have been causing any notable issues as the packages were already cached/queued up for processing elsewhere in the code, but it was never the original intent to have them removed before they were processed. The fix was simply to also match the trader ID when the package removal takes place.

Possibly related to #401 #425
2024-02-06 20:08:14 -05:00
Refringe
6714d2d172
Forgot Instance of Parent Update
Updates the `replaceIDs` method call in the `LocationGenerator` class to be inline with the changes in the parent commit.
2024-02-06 18:50:42 -05:00
Refringe
42dabc057b
Improved replaceIDs Method in ItemHelper
- Implemented deep cloning of input Items to prevent mutation.
- Reordered parameters: Items (required) now precede PMC data (optional).
- Updated method calls to bring them inline with these changes.
2024-02-06 18:39:06 -05:00
Refringe
c29482394b
(More) Simple Parameter Reassignment Issues
Addresses some of the simple linting errors regarding the reassignment of function parameters.
2024-02-06 18:35:11 -05:00
Dev
d8fe911464 Cleanup dynamic loot selection, armors have their children stored in loose loot json, use existing code to pull children out instead of generating it 2024-02-06 23:17:41 +00:00
Dev
cb10ec4148 When generating armors for static loot, try and use default preset first before generating randomly 2024-02-06 23:00:39 +00:00
Dev
1101927768 Improve fence price calculation code. Prices now take into account removed item mods + mod durability 2024-02-06 20:44:40 +00:00
Dev
b40e41bd3d Improve sellChance logic
Two changes:

Calcualte the quality of an item and its mods, not just root item
Calcualte the average price of an offer using item + mods, not just root item
2024-02-06 15:52:22 +00:00
Dev
5f873e73b8 Move handbook override code into HandbookHelper.hydrate() - changes now apply to ragfair 2024-02-06 12:52:56 +00:00
Dev
62f51be3aa Improve readability of valid item check 2024-02-06 12:18:41 +00:00
Dev
7bc9fdbe95 Add system to override handbook price, add christmas gift items small/med/large 2024-02-06 12:16:26 +00:00
Dev
72345abb4a Force plates to spawn in armor items found inside PMC backpacks 2024-02-06 10:53:08 +00:00
Dev
ddac44f79d Divide roubles calculated inside calculateCostOfScavInventoryAndMailMoneyToPlayer() by half 2024-02-06 10:33:59 +00:00
Dev
023697ed74 Partial fix for items flagged as being never lost on death coming back as insurance.
Items will not return but plates inside them still do
2024-02-06 10:10:56 +00:00
Dev
c6de12e6f8 Rename variables/comments for clarity 2024-02-06 09:49:51 +00:00
Refringe
807ba04967
Resolves Bot Generation Error
- Resolves an issue in bot generation caused by a missing parameter when calling the `shouldModBeSpawned` method.
- Adds a optional chaining operator within a condition to safeguard against undefined errors.

Contributed by: barlog_m

Thank you! :D
2024-02-05 19:16:36 -05:00
Refringe
cd6e40b66c
Error Message Propagation Issue
Resolves an issue where the error message in `getItemsToListOnFleaFromInventory` did not propagate as expected due to the pass-by-value behaviour in JavaScript. The solution was to refactor the method to return an object that includes both the items and the error message.
2024-02-05 19:03:26 -05:00
Refringe
3a2b24b9b8
Simple Parameter Reassignment Issues
Addresses some of the more simple linting errors regarding the reassignment of function parameters.
2024-02-05 19:03:26 -05:00
Refringe
34121182a1
Biome Linting Issues
Fixed some instances of:
- Unordered imports
- Reassigning function parameters
- Modifying values in assignment/return statements
- Array.forEach being used instead of for...of
- Simplified control logic
2024-02-05 19:03:26 -05:00
Dev
b7d74f1dec Add system to flag weapon slot ids as required.
Applies to stocks/recievers for PMCs
recievers for exusec/raider
2024-02-05 22:02:03 +00:00
Dev
32862866aa Remove some debug logging 2024-02-05 19:53:59 +00:00
Dev
d36593ca57 Rework fence service to handle armor/weapons separately,
made config work with a weapon/equipment min/max value
Improve price filtering system to work with weapons/equipment
2024-02-05 19:52:46 +00:00
Dev
3653ab9f83 Apply a duribility price modifier to items sold on flea 2024-02-05 19:49:42 +00:00
Dev
ce27f58664 FIx weapons/armors not showing on fence 2024-02-05 18:21:02 +00:00
Dev
422b7878ab Add getMatchingPreset() and add workaround for silenced DVL choosing wrong barrel mods 2024-02-05 15:36:05 +00:00
Dev
a04a05996d Adjust calculateFenceStandingChangeFromKills() to take into account rep loss when fence rep between 6 and 8 or rep > 8 2024-02-05 14:44:31 +00:00
Dev
bf5f3316b1 Rename cloned variables to help with readability 2024-02-05 14:43:46 +00:00
Dev
183e71370a Reworked buyItem() to use addItemsToStash() to ensure it performs a space check prior to adding any items to stash 2024-02-05 14:07:21 +00:00
Dev
2f673d12b9 Improve weapon/equipment item purchase filtering 2024-02-05 11:38:04 +00:00
Dev
0f6b34605b Prevent duplicate equipment builds occuring when renaming an existing build 2024-02-05 09:13:37 +00:00
Dev
946172d20c Add additional helmet soft inserts to getSoftInsertSlotIds() 2024-02-05 09:02:58 +00:00
Dev
a2668a9618 Rework insurance to not duplicate items + still return soft_inserts
Added missing groin_back to `itemRequiresSoftInserts()`
2024-02-04 22:41:11 +00:00
Dev
d9bcb3fce8 Fix deleting an item from mail before receiving all kills server 2024-02-04 19:51:19 +00:00
Dev
9fa0bf53e5 Rework sell all scav gear button to send money as mail 2024-02-04 19:27:35 +00:00
Dev
63603f5d9a Reduce grizzly count added to PMC secure to 1 + morphine to 2 2024-02-04 14:43:37 +00:00
Dev
cfe470029f Refactor insurance item checking code into 2 functions to allow checking if any items were lost before sending Insurance lost mail 2024-02-04 10:19:57 +00:00
Dev
afce41d68b Improve lost insurance message system, only send lost insurance when an insured item was lost 2024-02-04 09:52:56 +00:00
Dev
193161f786 Fix preset buy searches not filtering items based on search criteria/player level 2024-02-04 09:31:00 +00:00
Dev
2c4278cd96 Show debug message as warning + fix incorrect prapor quest assort ids 2024-02-04 09:12:27 +00:00
Dev
f2ed957579 Expand server version debug logging 2024-02-04 09:04:12 +00:00
Dev
4d88b2a94a Prevent developer profile changes bleeding into non-dev accounts 2024-02-03 23:40:20 +00:00