Commit Graph

1045 Commits

Author SHA1 Message Date
Dev
6cf91ad923 Skip null production objects inside handleRecipe() 2023-11-13 12:01:48 +00:00
Dev
68ad264be5 Update daily reward values 2023-11-13 10:12:59 +00:00
Dev
b776d1cf20 Lint usec/bear jsons 2023-11-12 17:44:31 +00:00
Dev
9a6e783e9c Add more modders as PMCs 2023-11-12 17:16:54 +00:00
Terkoiz
44c2fffd70 Remove banned users from the PMC name list 2023-11-12 19:07:00 +02:00
Dev
88f83e6ae3 Update flea prices 2023-11-12 10:46:28 +00:00
Dev
0666aad779 Implement Unbind event handler
Occurs when player moves item from quick access panel to inventory

Small optimistion for `Bind` event, once item is found, exit loop
2023-11-12 10:10:34 +00:00
Dev
6547a767ef Set scav daily amount to 1 2023-11-12 09:46:25 +00:00
Dev
1e5e0e067b Update version number 2023-11-11 22:55:46 +00:00
Dev
5f774bf3c8 Exit loop after deleting hideout craft 2023-11-11 20:15:46 +00:00
Refringe
320c8b7d48
Formatting for test classes. 2023-11-10 17:21:20 -05:00
Refringe
3ef51e771b
Formatting of DI classes. 2023-11-10 16:58:55 -05:00
Refringe
87bb07cfd9
Formatting for controller classes. 2023-11-10 16:49:29 -05:00
Refringe
5fa8803f8c
Auto-formatting for context classes. 2023-11-10 15:23:51 -05:00
Refringe
ab7f41b924
Auto-formatting for callback classes. 2023-11-10 15:19:56 -05:00
Refringe
90cdd6eea1
Auto-formatting of root-level files. 2023-11-10 15:17:43 -05:00
Refringe
12891ceac6
Additional formatting configuration changes. 2023-11-10 15:16:21 -05:00
Dev
8fda5395e6 FIx getFleaPriceForItem() handing items with a price of 0 incorrectly.
Only show error when price returned is undefined
2023-11-10 20:11:36 +00:00
Dev
113ab255e8 Fix incorrect locale string token 2023-11-10 20:02:27 +00:00
Dev
d2f4327871 Update updateProductionTimers() to handle Progress value being undefined 2023-11-10 19:18:58 +00:00
Dev
37029791da Nullguard removeQuestFromScavProfile() accessing a null scav quest array 2023-11-10 19:13:14 +00:00
Dev
7849a730f2 Fix nullguard firing for all traders 2023-11-10 19:00:04 +00:00
Refringe
5f7bfdeb1a
Gets Biome and ESLint working for non-formatting linting. 2023-11-10 13:25:58 -05:00
Refringe
fe614670b7
Implements dprint formatting library. 2023-11-10 11:29:56 -05:00
Dev
ade4875362 Change warning in checkTraderRepairValuesExist() to use nickname 2023-11-10 10:37:26 +00:00
Dev
c4c923f8dc Update checkTraderRepairValuesExist() to not use .clone 2023-11-10 10:31:22 +00:00
Dev
21dd62269e Log server values on start 2023-11-09 22:27:20 +00:00
Dev
171d39d5cf Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-09 14:49:41 +00:00
Dev
cfc12d86cd 27050 2023-11-09 14:48:40 +00:00
TheSparta
8c8ccdc787 Removed rome from devDependencies 2023-11-08 19:53:03 +00:00
TheSparta
f48e704bf1 import DependencyContainer type directly from tsyringe
- Redundant re-export of DependencyContainer from tsyringe, caused madge to think it was a circular dependency due to the file name also being tsyringe, deleted the file and importing directly from tsyringe instead.
2023-11-08 19:53:03 +00:00
TheSparta
a7334c198b Fixed check:circular script 2023-11-08 19:53:02 +00:00
TheSparta
09a64b801a fixed lint/style/noNonNullAssertion 2023-11-08 19:53:01 +00:00
TheSparta
89cfc5c6ee Turned off organizeImports and noStaticOnlyClass 2023-11-08 19:53:01 +00:00
TheSparta
98a793229c fixed lint/complexity/noUselessSwitchCase 2023-11-08 19:53:00 +00:00
TheSparta
f2ef3efdac fixed suppressions/unused 2023-11-08 19:53:00 +00:00
TheSparta
d13bcc2eba fixed lint/style/noInferrableTypes 2023-11-08 19:52:59 +00:00
TheSparta
ed1557d26b fixed suppressions/deprecatedSuppressionComment 2023-11-08 19:52:58 +00:00
TheSparta
e3c833a085 fixed lint/style/useExponentiationOperator 2023-11-08 19:52:58 +00:00
TheSparta
133c0f760d fixed lint/suspicious/noGlobalIsNan 2023-11-08 19:52:57 +00:00
TheSparta
5b46e956c4 fixed lint/complexity/useLiteralKeys 2023-11-08 19:52:56 +00:00
TheSparta
3eee163aae fixed lint/complexity/noForEach 2023-11-08 19:51:52 +00:00
TheSparta
40a9ed4102 fixed lint/complexity/noUselessConstructor 2023-11-08 19:51:52 +00:00
TheSparta
0308ae4bf7 fixed lint/style/useEnumInitializers 2023-11-08 19:51:51 +00:00
TheSparta
27f7eb8caf Allow decorators on the constructor parameters 2023-11-08 19:51:50 +00:00
Dev
4580c1cea8 FIx hideout crafts flaged as needFuelForAllProductionTime not progressing 2023-11-08 16:17:14 +00:00
Dev
a2970be193 lint config 2023-11-08 12:08:33 +00:00
Dev
5929e873e1 Force CPSU part 2 journal quest item as single spawn 2023-11-08 12:05:57 +00:00
Dev
98ab19c6fa Update countAllInsuranceItems() to make use of MathUtil.arraySum() 2023-11-08 09:51:15 +00:00
Dev
4f7715825a Make timeutil.pad() protected so it appears in mod types data 2023-11-08 09:06:22 +00:00
Dev
43eadcbfa9 Update test to make use of string literals 2023-11-08 08:59:28 +00:00
Refringe
eaa4c3cf0b
Removes trailing spaces. 2023-11-07 23:29:25 -05:00
Refringe
a190311612
Removes IUUidGenerator Class
Removes the `IUUidGenerator` class in favour of the built-in `crypto.randomUUID()` method.
2023-11-07 23:27:52 -05:00
Refringe
0ad85b45e1
Small ItemHelper.getRandomCompatibleCaliberTemplateId() Improvements
- Updated to safely access a deeply nested property.
- Updated to safely access the item `_id` and `_name` properties in the warning log.
- Updated to use the `RandomUtil.getArrayValue()` method to select a random ammo item template ID.
- Finished up some tests.
2023-11-07 22:59:04 -05:00
Refringe
ea7d6117ea
Specifying the port was causing 404 errors on the UI coverage link. Removing it resolved the issue. Odd. 2023-11-07 21:57:07 -05:00
Refringe
3ba9e48a3e
Updates TimeUtil Class
- Adds the `date-fns-tz` module to dep.
- Moves the `date-fns` module from development dependancies to dependancies.
- Removes the depreciated `substr` method usage.
- Adds the `pad` method to handle padding time digits.
- Dates and times are now standardized UTC.
- Adds basic tests for all methods.
2023-11-07 21:32:57 -05:00
Dev
262c8a6e83 Add tests for getRandomCompatibleCaliberTemplateId() 2023-11-07 22:21:48 +00:00
Dev
c90f9499b1 Add more itemHelper tests 2023-11-07 21:52:41 +00:00
Dev
64845bf8ff Update tests 2023-11-07 21:30:29 +00:00
Dev
80afa0262c Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-07 21:22:06 +00:00
Dev
dfd1bcc589 getTemplatePrice(), when an item cannot be found in the handbook, add it with the price of 0 instead of 1 2023-11-07 21:21:34 +00:00
Dev
7941675102 getItemPrice() if static price is 0 and dynamic price is missing, return 0 instead of undefined 2023-11-07 21:13:41 +00:00
Dev
d2736f4004 Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into testing-redux 2023-11-07 20:59:14 +00:00
Dev
123df5c595 Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-07 20:58:56 +00:00
Refringe
a97c2b31ea
Testing performance improvements? I think so! 2023-11-07 15:42:32 -05:00
Dev
1f622a0760 Add Trader Repair Value on game start 2023-11-07 20:00:02 +00:00
Dev
8fb8b66afb Add Charisma bonus when using repair kit (50% chane of no toall durability loss on kit use) 2023-11-07 17:01:24 +00:00
Dev
203ef0c011 Centralise getting a skill from a player profile into one location profileHelper.getSkillFromProfile() 2023-11-07 15:17:38 +00:00
Dev
d10c226db0 Add Melee skill to enum 2023-11-07 15:05:59 +00:00
Dev
847586f073 Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-07 14:44:26 +00:00
Dev
022c73d791 Further adjustment to daily/weekly rewards 2023-11-07 14:43:35 +00:00
Dev
7defca2ae4 Add ability for repeatable quests to reward skill points
Slightly increase rep gain from weekly quests
2023-11-07 14:38:13 +00:00
Dev
5a60e4dcf0 Consolodate multiple functions (incrementSkillLevel, rewardSkillpoints) that do the same task into one addSkillpointsToPlayer, make them use enum for skill type instead of string 2023-11-07 11:20:25 +00:00
Dev
206509359e Add Charisma points when insuring items, points to reward is a total guess until data can be obtained 2023-11-07 10:40:14 +00:00
Dev
938e439c81 Use daily quest count value from globals instead of hard coding it 2023-11-07 10:20:59 +00:00
Dev
1510237b01 take into accout Charisma skill at elite level when calculating daily quest count 2023-11-07 09:58:58 +00:00
TheSparta
a2900c2c43 Removed tsconfig.profiler.json 2023-11-07 00:55:18 +00:00
Refringe
65202b2aff
Remove the resetAllMocks call because restoreAllMocks does the same thing, plus restores the mocked method's original functionality. 2023-11-06 15:35:46 -05:00
Refringe
07930a396b
We're not testing types yet so I'm leaving this disabled. 2023-11-06 15:23:59 -05:00
Refringe
143eda42d1
Removes the path definition in the tsconfig profiler configuration so it doesn't overwrite the base config. 2023-11-06 15:23:22 -05:00
Refringe
76b6ee6ae1
Merge branch '3.8.0' into testing-redux
# Conflicts:
#	project/gulpfile.mjs
#	project/tsconfig.json
#	project/tsconfig.profiler.json

Manually resolved by Refringe
2023-11-06 15:06:46 -05:00
Refringe
04dcd971c6
Merge branch 'master' into 3.8.0 2023-11-06 14:54:04 -05:00
TheSparta
00fbc813ac fix/profiler (!166)
- `run:profiler` now uses swc instead of tsc.
- Removed `tsconfig.test.json` as it was only being used for the profiler which is now using swc.
- simplified `tsconfig.json` and `tsconfig.typedef.json`, they both had `baseUrl` and `paths` set to the same values, so i just moved them to `tsconfig.base.json`

Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/166
Co-authored-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
Co-committed-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
2023-11-06 19:39:13 +00:00
Refringe
a7d3e0d59a
Tests: Moves class (re)resolution to beforeEach to help ensure that all mocks have been reset. 2023-11-06 14:39:12 -05:00
Dev
71312c8ed7 Disable prepareAndGenerateBotstest, add generateBotNickname tests 2023-11-06 17:23:33 +00:00
Dev
214e81ba83 Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into testing-redux 2023-11-06 14:54:34 +00:00
Dev
0abfe0699e Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-06 14:52:14 +00:00
TheSparta
a244e89abe Skip mods that are duplicated (!165)
- Instead of loading duplicated mods, it now skips all of them.
- Changed a few localisation strings, deleted the ones that became outdated.

Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/165
Co-authored-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
Co-committed-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
2023-11-06 14:51:31 +00:00
Dev
1cccb0445a Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into testing-redux 2023-11-06 13:19:15 +00:00
Dev
6de32bad6a Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-06 13:18:56 +00:00
Dev
2040835566 Set halloween event as disabled by default + enable for halloween 2023-11-06 13:18:38 +00:00
Dev
77c6bd8b62 Update JSONs 2023-11-06 13:12:12 +00:00
Dev
b61cc6add0 27001 2023-11-06 12:57:27 +00:00
Dev
4bce4b49f4 Change server logging to be grouped by day instead of per hour 2023-11-06 12:44:59 +00:00
Dev
7daaf53dff Add transition stage for PMCs gear from level 15-22 to make the changes from no flea gear to all flea gear less abrupt
Add missing equipment items to bear/usec PMCs
2023-11-06 11:36:36 +00:00
Dev
6ba0cfa459 Fix inverted check 2023-11-06 09:24:13 +00:00
Dev
32b356d3f1 Fix isbotPmc isBotBoss and isBotFollower failing when undefined values are passed in 2023-11-05 20:29:10 +00:00
Dev
5656384c8f Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into testing-redux 2023-11-05 20:25:15 +00:00
Dev
d3b7e5ef7a Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-05 20:24:28 +00:00
Dev
54223f3848 Add botController test 2023-11-05 20:11:52 +00:00
TheSparta
de83dee158 Fixed vscode launch configuration for vitest 2023-11-05 19:40:15 +00:00
TheSparta
1f0318e66d Create container once before all tests
- Doesn't recreate the container for each test file, only loads the database once at the start, makes it much faster.
- Every test file should be imported in `Setup.test.ts` in order for it to work.
2023-11-05 16:59:54 +00:00
Dev
6f11e3de34 Add ItemBaseClassService tests 2023-11-05 16:44:08 +00:00
Dev
df6a08367b Remove reduandant else from getRepairableItemQualityValue() 2023-11-05 13:19:10 +00:00
Dev
c527824d60 Change getRepairableItemQualityValue() to handle max durability being lower than durability 2023-11-05 13:16:59 +00:00
Dev
c12819ce33 Check for correct return type 2023-11-05 12:40:50 +00:00
Dev
7e409735d1 Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into testing-redux 2023-11-05 12:39:38 +00:00
Dev
c7dfc5b9cf Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-05 12:39:20 +00:00
Dev
8f70b03284 Fix hasBuyRestrictions erroring on bad input data
Fix isItemTplStackable erroring on bad input data
2023-11-05 12:37:17 +00:00
Dev
84f3f0e3d5 Add additional pmc response 2023-11-05 12:21:44 +00:00
Dev
d1614b19a6 Add tests for InRaidHelper 2023-11-05 10:49:20 +00:00
Dev
d4f2139236 Add additional tests to ItemHelper.test 2023-11-05 10:19:00 +00:00
Dev
ed20707935 Add tests for BotLevelGenerator 2023-11-05 09:20:11 +00:00
Refringe
98a35f4b47
Merge branch '3.8.0' into testing-redux 2023-11-04 21:12:49 -04:00
TheSparta
0fff6afc8c switched coverage provider from v8 to istanbul 2023-11-04 21:07:44 +00:00
Dev
8ee176b9d8 Handle when fillCamora() cannot find camora slots in weapons modPool 2023-11-04 20:11:09 +00:00
Dev
69b32fabdf Add HandbookHelper tests 2023-11-04 19:42:07 +00:00
TheSparta
71b5ce7512 fixed __coverage__ folder location 2023-11-04 18:37:16 +00:00
Dev
8f21ee2ef3 Allow coverage to show correct files in src folder 2023-11-04 18:31:37 +00:00
TheSparta
a865709535 added --coverage to test:ui script 2023-11-04 17:09:14 +00:00
TheSparta
9638288381 Fix level calcualtion function 2023-11-04 17:01:24 +00:00
TheSparta
1b737189b7 Added coverage reportOnFailure and removed enabled by default 2023-11-04 14:54:17 +00:00
TheSparta
45dad54e3e Fixed PlayerService.calculateLevel 2023-11-04 14:53:08 +00:00
Dev
6ca19150bc Add BotHelper tests 2023-11-04 13:34:09 +00:00
Dev
85b815f32e Add tests for PlayerServer.calculateLevel() 2023-11-04 11:43:04 +00:00
Dev
ebe7dc68c3 Add isInStash() tests to PaymentService.tests 2023-11-04 11:22:07 +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
b303849ad1 Add 3 test for getItemStackSize() 2023-11-04 10:21:56 +00:00
Dev
2f7f8a3f62 use correct base type id for test 2023-11-04 09:53:30 +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
b808850e7e Remove duplicate mod_magazine key 2023-11-03 17:15:42 +00:00
Dev
60b658c6f6 Correct pmc response to ensure consistency with meme-lore 2023-11-03 16:44:15 +00:00
Dev
b62850e03e Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0 2023-11-02 21:25:31 +00:00
Dev
a5a0bf82d7 Changes after feedback from Drakia 2023-11-02 21:16:31 +00:00
Dev
e9be58d5f4 Update bot XP values + other bot values 2023-11-02 16:17:03 +00:00
TheSparta
e327df7504 Override WinstonLogger registration with a mock 2023-11-02 15:58:16 +00:00
Dev
2511b8bba2 Update locales 2023-11-02 15:26:13 +00:00
Dev
7a3acaee95 update shoreline and factory 2023-11-02 15:25:40 +00:00
Dev
e664742e49 Update map spawn point data values (missing shoreline) 2023-11-02 15:08:20 +00:00
Dev
8ee0188fdd Reduce flashlight usage on cultists to 5% 2023-11-02 15:02:45 +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
9949d3c7ff Correct spt version 2023-11-02 11:54:38 +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
Dev
6f48a29713 Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server 2023-11-02 08:59:55 +00:00
Dev
c782b58e64 Remoev duplicate name 2023-11-02 08:59:43 +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
d74b505a7b Fix types generation command not working 2023-11-01 14:20:27 +00: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
bb06008983 Add missing PmcKills properties to daily scav elimination quest config 2023-11-01 11:45:24 +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
Dev
6f9dbdd2b6 Update seasonal equipment weights to match newly adjusted values
Add bossboar and followerboar
2023-11-01 10:42:54 +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
fc5eabc73d Update bot difficulty changes lost in merge 2023-10-31 19:13:27 +00: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
4dea8e8fa9 Adjust bot ammo and equipment weights after changes to bot generator:
Fixed bug where ammo from ammo boxes in bot inventory were being counted
Add up all appearances of ammo a bot uses and store as weightings
2023-10-31 19:07:47 +00:00
TheSparta
35e82fde2c Remove unused config files + swapped rome for biome (!163)
Removed `parcel` and `babel` config files and dependencies, as the project isn't using these tools anymore.

Swapped `rome` for `biome`, `rome` is archived and won't be receiving updates anymore, `biome` is a community fork.

Co-authored-by: Pedro Silva <sparta14gaming@gmail.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/163
Co-authored-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
Co-committed-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
2023-10-31 16:03:45 +00:00
Dev
73a81f954c Update bloodhound names 2023-10-31 09:35:05 +00:00
Dev
dbe8f941c4 Update JSONs 2023-10-30 22:19:59 +00:00
Refringe
1d90a472f2
Testing PaymentService.payMoney
Adds a single test for the basic functionality of the `PaymentService.payMoney` method. It's huge. I hate it. It works. The entire class needs to be refactored to be more testable. Each of these methods should be split up to only have (ideally) a single responsibility--It has about 6 going on right now.
2023-10-30 17:45:17 -04:00
Refringe
d85e649511
Removes Testing Profile/Account Creation
It was just too damn slow... 25+ seconds for *two*. Profile information will have to be partial-mocked using the sections and properties that the tested method will use, and casted as the parameter type (`IPmcData`, for example).
2023-10-30 17:38:37 -04:00
Refringe
7bd8b9e994
VSCode Launch Fixes
- Resolved an issue that caused the debug env from starting up. My bad--Doh!
- Updated the testing VSCode launch option to use Vitest instead of Jest.
2023-10-30 17:34:05 -04:00
Refringe
aa512e93ef
Resolves an issue that caused the profiler from not being able to parse import paths. 2023-10-30 17:31:58 -04:00
Dev
79d232482b 26921 2023-10-30 19:00:21 +00:00
Refringe
1821607866
Moved import under database comment. 2023-10-30 11:46:40 -04:00
Refringe
f5c379e189
Mocks some logger methods to prevent actual execution. 2023-10-30 11:46:10 -04:00
Dev
1c18282cfe Log profile save action into console window, not log file 2023-10-30 15:14:26 +00:00
Dev
a75acdf9ce Update bloodhound names 2023-10-30 10:07: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
Refringe
4e33befaa0
Creates a temporary testing account and profile for each test suite. This is really slow... May have to think this one through. 2023-10-29 22:21:21 -04:00
Refringe
cc39c1847c
Enables typeschecking vitest feature. 2023-10-29 22:19:49 -04:00
Refringe
5ed94b6e63
Removes some trailing spaces. 2023-10-29 22:19:05 -04:00
Refringe
1d914783ae
Renamed tsconfig.test.json to tsconfig.profiler.json, as it's not actually used for testing. 2023-10-29 22:01:48 -04:00
TheSparta
b31a48066b Removed usage of global.container
Importing container from tsyringe directly seems to work fine.
2023-10-29 22:20:35 +00:00
TheSparta
ba32350751 Refactored tests CustomEnvironment.
- Instead of importing everything and registering to the container, it now uses `@spt-aki/di/Container` instead.
2023-10-29 22:20:34 +00:00
TheSparta
8490590c31 Removed @tests path alias from .swcrc 2023-10-29 22:20:34 +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
ad5e0815b6 Migrated from Jest to Vitest
Basically the same, except it plays nicer with Typescript and ESM.

I have it mostly working, except for a type error:
`TypeError: Int32Array is not a constructor`

But I'm too damn tired it debug it at the moment.
2023-10-29 22:20:32 +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
Refringe
f009d13d2a Successfully importing database and passing global container. 2023-10-29 22:20:31 +00:00
TheSparta
1eceb797e2 fixed tests tsyringe resolve 2023-10-29 22:20:30 +00:00
TheSparta
abbd60d7e2 Switched from ts-jest to @swc/jest 2023-10-29 22:20:30 +00:00
Refringe
ca0547ed1a Trying to get the @spt-aki path alias working in a custom Jest Env. 2023-10-29 22:20:29 +00:00
Dev
fe703b34ec Remove unused file 2023-10-29 20:46:50 +00:00
Dev
199d7be0aa Add empty array to prevent undefined issue during bot gen 2023-10-29 20:46:15 +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
65aff3d74b Incldue Raider pocket loot on bloodhounds
Remove bloodhound last name
2023-10-29 17:32: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
1cd13ce21f Adjust weekly boss elimination requirements 2023-10-29 13:03:02 +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
Dev
d28c1bb5b0 Update core config 2023-10-28 10:42:23 +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
Dev
90efc36360 Fix incorrect value names in getEliminationKillCount 2023-10-24 17:06:02 +01:00
Dev
a5dbfef7d0 Localise some error text 2023-10-24 16:40:34 +01:00
Dev
657dd358c2 Give method an access type protected 2023-10-24 15:12:18 +01:00
Dev
1cf63ad1ad Split pmc kill requirement for elimination into separate min/max counts from other bot types 2023-10-24 15:01:31 +01:00
Dev
c3777af231 Add guards to dynamic spawn point generation
Rename some variables for clarity
2023-10-24 11:15:23 +01:00
Refringe
8541e5f028 Refactor Currency Handling in PaymentService.payMoney() Method (!159)
This commit includes a series of changes aimed at improving the logic and readability of the `payMoney` method in the PaymentService class. The method is pivotal for handling in-game payments, specifically in cases involving multiple types of currencies and barter trades. The changes resolve an issue that prevented barter payments that included both a currency and another item.

## Changes:

- Replaced `barterPrice` variable with a `currencyAmounts` mapping that efficiently tracks each type of currency involved in the trade.
- Updated how the `costOfPurchaseInCurrency` variable is calculated to factor in multiple currencies.
- Introduced a new variable `totalCurrencyAmount` to sum up the total amount of all currencies, which is checked to determine whether any (non)currency payment is necessary.
- Added some inline comments for readability.

Resolves #176

Co-authored-by: Refringe <brownelltyler@gmail.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/159
Co-authored-by: Refringe <refringe@noreply.dev.sp-tarkov.com>
Co-committed-by: Refringe <refringe@noreply.dev.sp-tarkov.com>
2023-10-24 09:27:46 +00:00
Dev
250b9dca3f Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server 2023-10-23 19:29:35 +01:00
Dev
7b0298cda2 Adjsut 2 bot gen errors to be warnings 2023-10-23 19:19:05 +01:00
TheSparta
7aee78eb49 Fixes Insured items on secured containers (!158)
This PR fixes both https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/174 and https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/175.

Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/158
Co-authored-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
Co-committed-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
2023-10-23 16:45:40 +00:00
Dev
69ee8983b2 Improve logging text 2023-10-22 13:14:38 +01:00
Dev
3c709311d8 Correctly save statusTimer values into profile 2023-10-21 21:24:14 +01:00
Dev
ec7d3e1699 Fix bad injection 2023-10-21 20:22:11 +01:00
Dev
54d47585f2 Show sessionid/profile id when profile data is saved 2023-10-21 20:19:45 +01:00
Dev
018b0a8f70 Fix profile creation error 2023-10-21 20:13:29 +01:00
Dev
573d91a9c2 Persist ConditionCounters data between pscav runs
Move values around to help with readability
2023-10-21 18:23:58 +01:00
Dev
de2f70fb79 Remove replaced repeatable quest from PMC and scav profile 2023-10-21 17:39:44 +01:00
Dev
0c31c0ab8f Add additional pmc responses 2023-10-20 14:06:39 +01:00
Dev
3f07fc1bfc Cleanup of async method names
Add method comments
Reduction of code complexity inside `executeModsAsync()`
Add error message when loaded mod has no `main` property
2023-10-20 12:23:19 +01:00
Dev
33d3e6ce05 move log to correct place 2023-10-19 22:55:53 +01:00
Dev
3f8c681e7d Add mising standingForKill values 2023-10-19 22:39:26 +01:00
Dev
88a24151ef Remove empty object 2023-10-19 22:29:53 +01:00
Dev
234cd0b833 Randomise standing loss for dailies 2023-10-19 21:49:38 +01:00
Dev
83590dcc25 Get id if not found in profile 2023-10-19 21:44:10 +01:00
Dev
20b9a39cda Add missing IDs to json and pass throughout code 2023-10-19 21:36:17 +01:00
Dev
fa2a8c6513 Add missing id property to accept quest client response 2023-10-19 21:06:09 +01:00
Dev
11ae41dcff Fix missing text 2023-10-19 20:59:06 +01:00
Dev
489189bd81 Add missing properties to templates 2023-10-19 20:51:16 +01:00
Dev
79dc3cca1b Correct mistake in sending repeatable data to client on quest accept 2023-10-19 20:43:42 +01:00
Dev
d97beda4b7 Rework how repeatable quests are replaced 2023-10-19 20:04:47 +01:00
Dev
57b1fe0733 Improve bad replacement quest error messaging 2023-10-19 19:30:23 +01:00