Commit Graph

421 Commits

Author SHA1 Message Date
Refringe
98a35f4b47
Merge branch '3.8.0' into testing-redux 2023-11-04 21:12:49 -04:00
TheSparta
45dad54e3e Fixed PlayerService.calculateLevel 2023-11-04 14:53:08 +00:00
Dev
86c519b117 Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-04 10:50:13 +00:00
Dev
75958ee7d2 Replace hard coded blacklist in isValidItem() with more appropriate call to ItemFilterService.isValidItem() 2023-11-04 10:49:52 +00:00
Dev
24894643de Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-04 10:43:06 +00:00
Dev
ab01e42271 Call getDynamicItemPrice() correctly inside getItemPrice() 2023-11-04 10:28:33 +00:00
Dev
432f778512 Make randomiseAmmoStackSize() and randomiseMoneyStackSize() not purge the entire upd object
Always randomise the ammo stack size, not only if it doesnt have one
2023-11-04 09:08:33 +00:00
Refringe
047884e9c7
Additional InsuranceController Tests
- Adds tests for the remaining methods in the `InsuranceController`.
- Adds a `countAllInsuranceItems()` method to the `InsuranceController`.
- Adds the Vitest UI and coverage packages.
- Updates the `profileInsuranceFactory` to use second-epoch dates instead of millisecond-epoch dates.
- Updates the `InsuranceController.fetchHideoutItemParent()` method to log a warning when an item with a slotId of 'hideout' cannot be found.

TODO:
- The Vitest coverage options are not working.
2023-11-03 17:39:33 -04:00
Dev
93209e4a76 Add config option to force stock to spawn on a bot during weapon generation
Enable it for various bot types (most bosses/raiders)
2023-11-03 17:40:00 +00:00
Dev
a5a0bf82d7 Changes after feedback from Drakia 2023-11-02 21:16:31 +00:00
Dev
981da646b0 Add 2023 haloween event system
Event bots are generated from their base type, then their role is updated before being sent to the client e.g. peacefullZryachiyEvent becomes bossZryachiy for generation, then back to peacefullZryachiyEvent
2023-11-02 15:02:18 +00:00
Dev
0a85f6f319 Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-02 09:00:14 +00:00
DrakiaXYZ
ebeda336db Implement live-like calculation of Weapon Maintenance XP (!164)
- Implement formula based on 30 weapon repairs done on live
- Return the repair amount as `repairAmount` from `repairItemByKit`
- Add an additional `repairPoints` to `RepairDetails` to return the repair points used
- Update `repairAmount` references to `repairPoints` to keep old behavior
- Add new parameter to rewardSkillPoints that applies live-like level scaling
- Only give weapon maintenance XP when using a repair kit

This implementation comes with a "Crit Fail" and "Crit Success" mechanic to account for live sometimes randomly being -4 or +4 off from my estimated values. By default the chance of each is 10%, and they can overlap and cancel each other out

Spreadsheet of live repair data:
https://docs.google.com/spreadsheets/d/1-tR4WYelhZfKZ3ZDbxr3nd73Y60E1wQRjDWONpMVSew/edit?usp=sharing

Useful columns:
C: The amount of dura attempted to be repaired, this is used in the estimated skill calculated
G: Hand entered value of how much skill gain I actually saw on live (Multiplied by 10 for readability. So "3.2" would be "32")
J: The estimated skill gain, based on the calculation included in this merge request
K: How far off the estimated skill gain was (Negative implies we guessed high and the actual result was lower)

One thing of note:
I've modified all the existing references to `repairAmount` to be the new `repairPoints` when a repair kit is used. This is to keep the existing behaviour outside of my direct changes as much as possible.

However, this seems to be incorrect in some cases (For example, buff chance is repairPoints/maxDura, but repairPoints will go down the higher your int. I'm assuming this is meant to be repairedDura/maxDura). May want to update these references to use `repairAmount` once they've been confirmed to expect the repair amount instead of repair points used.

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/164
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2023-11-02 08:56:02 +00:00
Refringe
946552199e
Merge branch '3.8.0' into testing-redux
# Conflicts:
#	project/package.json

Manually resolved by Refringe
2023-11-02 01:56:18 -04:00
Refringe
85a227e7d5
Updates 🚀
- Created profileInsurance test fixture.
- Created ProfileInsurance test factory class.
- Improved many of the InsuranceController method tests by utilizing the factory and fixture. Still some left to do here.
- Adds the `date-fns` package as a development dependancy for easy date manipulation.
- Cleaned up some comments.

Bug Fixes 🐞
- Resolved an issue where `ItemHelper.getAttachmentMainParent()` was not returning null when it should have.
- Resolved an issue where `InsuranceController.populateParentAttachmentsMap()` would continue to process when the parent could not be found.
2023-11-02 01:47:28 -04:00
Dev
b1842e1c49 When generating a specific location condition for an elimination quest, don't add weapon requirement props to it - unnecessary
Clean up kill condition generation method comments/param names

Replace magic strings with objects
2023-11-01 13:29:47 +00:00
Dev
9d56030880 Remove unused class property 2023-11-01 13:06:01 +00:00
Dev
90b76eab68 Correctly check when difficulty is not a number 2023-11-01 11:36:13 +00:00
Dev
d1db6cc7a9 Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-01 11:35:18 +00:00
Dev
37b7712602 Rename function getAllSeasonalEventItems() to getInactiveSeasonalEventItems() 2023-11-01 11:35:05 +00:00
Dev
9d3f6dc092 For slots that have seasonal items added, force slot spawn chance to be at least 75% 2023-11-01 11:00:43 +00:00
Dev
1c6550894e Add additional items to halloween items list 2023-11-01 10:43:47 +00:00
Refringe
7f37d48753
InsuranceController Tests & Minor Changes
- Adds tests for the majority of the methods within InsuranceController.
- Simplifies the `InsuranceController.sendMail()` method so that the toDelete parameter is no longer required.
- Modifies `InsuranceController.findItemsToDelete()` to only process regular and attachment items when they exist.
- Modifies `InsuranceController.rollForDelete()` to return null in the event that the provided Trader can not be found.
2023-10-31 23:08:13 -04:00
Dev
fc606ee540 Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0
# Conflicts:
#	project/assets/database/bots/types/assault.json
#	project/assets/database/bots/types/bossknight.json
#	project/assets/database/bots/types/bosszryachiy.json
#	project/assets/database/bots/types/followerzryachiy.json
2023-10-31 19:10:23 +00:00
Dev
1c18282cfe Log profile save action into console window, not log file 2023-10-30 15:14:26 +00:00
Dev
dacb72e78d Cleanup of akihttplistener 2023-10-30 09:36:19 +00:00
Dev
476788fee8 Fix build issue caused by merge of #162 2023-10-30 09:25:34 +00:00
ree
9fa0bcc705 Properly re-assemble all data in http requests before handling it (!162)
Remove unneeded HttpBufferHandler

-----------

The old code processed each chunk of data as an entire request, which is not correct. It was observed split data after ~14600 bytes (on a 1 gig lan connection). I think it was worse on remote connections.

This was the cause of the "unknown compression method" and invalid json parse errors when saving the profile.

Co-authored-by: Decoy <redacted@example.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/162
Reviewed-by: Terkoiz <terkoiz@noreply.dev.sp-tarkov.com>
Co-authored-by: ree <ree@noreply.dev.sp-tarkov.com>
Co-committed-by: ree <ree@noreply.dev.sp-tarkov.com>
2023-10-30 09:23:30 +00:00
TheSparta
f354811ca8 A few changes to Watermark and Error Handling
- Made it so Watermark doesn't initialize on the constructor, this makes it possible for tests to use `@spt-aki/di/Container`;
- Removed unnecessary calls to `ErrorHandler.handleCriticalError`, all you really need to do is `throw new Error()` and it'll get caught automatically.
2023-10-29 22:20:33 +00:00
Refringe
00ac9e190a Additional Tests & New Setup
- Adds additional ItemHelper tests
- Attempts to bring container registration into the environment to debug how we can register everything but not actually start the server.
2023-10-29 22:20:32 +00:00
Dev
fe703b34ec Remove unused file 2023-10-29 20:46:50 +00:00
Dev
220a89b915 Default value to false if not found intead of letting it be undefined 2023-10-29 20:45:35 +00:00
Dev
6f62d0b400 Rename variable for clarity
Remove redundant `BlocksX` check
2023-10-29 20:44:41 +00:00
Dev
8223124882 Sort mod_barrel after mod_handguard to prevent weapon gen errors with certain combinations of barrel + gas blocks causing all handgaurds to be incompatible
Also force gas block to be processed AFTER barrel + handguard
2023-10-29 16:35:03 +00:00
Dev
fd7e59d1d2 Adjust servers handling of item stacks, when item has a StackMaxSize value of 1, use that instead of items db property StackMaxRandom 2023-10-28 19:39:45 +01:00
Dev
6d30d86ea4 Correctly handle when crafts are completed, null craft data instead of removing entire production key/value pair 2023-10-28 17:57:14 +01:00
Dev
cc86ecce2b Send correct data to client to inform it craft has been cancelled 2023-10-28 17:48:37 +01:00
Dev
ce50c88b87 Improve error message text 2023-10-28 16:16:39 +01:00
Dev
0316278b15 First pass at handling the cancellation of a hideout craft.
Doesnt explode server with unhandled exception error
Does remove craft from profile
Doesnt remove it from client screen until client refresh
2023-10-28 15:53:13 +01:00
Dev
73be87bee4 Update IBotDurability with additional bot types 2023-10-28 12:44:44 +01:00
Dev
48913e8707 Update getDefaultCounters() to return data found from live profile 2023-10-28 12:40:21 +01:00
Dev
6e3e8f13d6 set NeedWipeOptions on profile creation 2023-10-28 12:28:52 +01:00
Dev
6e5d35dbd1 Update JSONs 2023-10-28 12:20:48 +01:00
chomp
ea518adb32 Add new WildSpawnTypes for 26835 (!161)
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/161
2023-10-28 09:39:49 +00:00
Dev
f4fce0612e Force handguards that take a sub-handguard to set handguard spawn chance to 100% - fixes split handguards appearing without the lower part
Only adds lower when weapon has no launcher attached

Adjust sub stock adding code to trigger when stock has a subslot that starts with `mod_stock`, this means `mod_stock_akms` and `mod_stock_000` will be included
2023-10-26 20:31:05 +01:00
DrakiaXYZ
170a185928 Add a new /singleplayer/log route (!160)
Add a new /singleplayer/log route for logging data to the server console from the client

Supports:
- All server log levels
- `Custom` log level with text/background color
- Specifying the source of the log line (ex. Plugin name)

Example output:
![Example](https://i.imgur.com/c0XBYLm.png)

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/160
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2023-10-26 09:44:17 +00:00
Dev
1f90ae0bb0 Add undefined check to updateProfileBaseStats() 2023-10-25 18:13:33 +01:00
Dev
0e3d25df03 Improve getTrader()
Error when no profile found
Reduce returns to 1
fold two checks into one
Remove magic string reliance on TradersInfo exist check
More comments
2023-10-25 12:18:27 +01:00
Dev
729b180e85 Add request object type 2023-10-25 11:54:11 +01:00
Dev
b29f0a0904 Coop extract gifts from fence are now Found in Raid 2023-10-25 10:14:19 +01:00