Commit Graph

2497 Commits

Author SHA1 Message Date
Dev
98620d2e1f Added tests for botDifficultyHelper 2024-05-14 15:45:56 +01:00
Dev
1d8bc4537c Fix issue with getBotDifficultySettings() cloning assault bot correctly when bot type not found but storing it against the new bot type with preserved caps, resulting in getting difficulty values failing 2024-05-14 15:45:04 +01:00
Dev
ed6e81ab52 Expanded input parameters for getBotGenerationDetailsForWave() and include change inside returnSingleBotFromCache() 2024-05-14 11:34:09 +01:00
Dev
81c7b8751b Extracted 2 functions from generateBotsFirstTime() to allow easier overriding for mod authors 2024-05-14 11:23:02 +01:00
Dev
512054d29f Added additional localeService tests
Fixed issue with existing tests overwriting function result that bled into other tests
2024-05-14 10:26:07 +01:00
Alex
7dc17acb97 Made commando first check if there's a preset for an item, otherwise if goes through normal logic (!333)
Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/333
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
2024-05-14 07:30:40 +00:00
DrakiaXYZ
adab18e3fb Fix issues around locales (!332)
- Remove locale check for give command (Now handled in the localeService itself)
- Fix variable names/spelling/lowercase in LocaleService.getPlatformForServerLocale (should be no change in behaviour)
- Rewrite LocaleService.getPlatformForClientLocale to not depend on serverSupportedLocales, and instead just use the tables for validity checking
- Expand fallback of client locale handling to include the region code (Handles Czech and Korean locales)
- Write tests for locales

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/332
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-05-13 21:42:58 +00:00
Dev
5254e9753e Fixed two getHighestRelativeBotLevel() tests caused by a refactor of the functions parameters 2024-05-13 22:41:34 +01:00
Dev
5ec6bc1aae FIxed getItems() test due to changes in how items are cloned 2024-05-13 22:31:53 +01:00
Refringe
14e8f8fa19
Take your brackets back!
I don't want em'. Grumble. Ahem...

This change allows for "extra" parentheses to be added in situations where, without them, the code could possibly, potentially be seen as maybe a little-bit, tiny confusing.

Also, fixes a bunch of other ESLint errors. Mostly down to naming warnings now. Mostly.
2024-05-13 17:04:23 -04:00
Dev
65e2b87190 Adjusted sendInsuredItems() to use the globals property Insurance.MaxStorageTimeInHour 2024-05-13 20:34:44 +01:00
DrakiaXYZ
7e4ec0bc53 Fix LFS association for sandbox files (!331)
Resolves "Encountered 8 files that should have been pointers" issue, hopefully

Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/331
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
2024-05-13 19:20:21 +00:00
Dev
600195224a Updated trader base JSONs 2024-05-13 20:16:27 +01:00
Dev
0d00fb5370 Added unheard edition profile + EN locale description 2024-05-13 20:07:35 +01:00
Alex
f8d1227dfd Introduced a new ICloner interface with 3 implementations, one of them being a recursive cloner which is faster and more efficient than its counterparts by more than 50% (!328)
Co-authored-by: clodan <clodan@clodan.com>
Co-authored-by: Dev <dev@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/328
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
2024-05-13 17:58:17 +00:00
Dev
f2c7e938cc Updated various JSONs 2024-05-13 17:05:04 +01:00
Dev
01783e295b Updated french locale 2024-05-13 09:52:33 +01:00
Dev
da61f62a55 Updated version tags 2024-05-13 09:51:28 +01:00
clodan
be082ebb71 Fixed give command localization issue
(cherry picked from commit 9390759621)
2024-05-12 22:14:29 +01:00
Dev
02e8b5051c Added guard against nullref inside updateFenceAssorts() to protect against modded items 2024-05-12 19:08:11 +01:00
Dev
4b7682383c Updated locales with latest Crowdin data 2024-05-12 15:26:22 +01:00
Dev
d5f57d74f5 Made bear/usec PMC jsons match 2024-05-12 15:20:34 +01:00
Dev
ad97d3438c Updated package.json version 2024-05-12 14:57:22 +01:00
vniehues
3e68297016 [ADD] functionality to read "x-forwarded-for" and "x-real-ip" headers when handling a request (!329)
I'm currently hosting the Project Fika Docker on a dedicated Server to have the Server up 24/7 without the need to let my PC run.
When hosting this as a docker container behind traefik (reverse proxy), the logger currently logs the internal IP of the traefik container.
This change makes it so that the headers that traefik/nginx can set are actually read and used. If these headers are not present, we fall back to the original method of using the `socket.remoteAdress`.
Since this is for logging only, the security implications are minimal.

Co-authored-by: Vincent Niehues <vincent.niehues@zeitag.ch>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/329
Co-authored-by: vniehues <vniehues@noreply.dev.sp-tarkov.com>
Co-committed-by: vniehues <vniehues@noreply.dev.sp-tarkov.com>
2024-05-12 13:56:03 +00:00
Dev
9323db5b1c Improved debug logging in filterPlateModsForSlotByLevel() + improved variable names 2024-05-12 10:29:18 +01:00
Dev
572f6a5668 Improved getModPoolForSlot()
Comment changes
Variable change
Only log debug message when default mod not found + multiple choices exist in pool
Fixed possible nullref if `getMatchingPreset()` returns null
2024-05-12 10:15:08 +01:00
Dev
879d19d912 Adjusted PMC mod chance values 2024-05-12 10:03:22 +01:00
Dev
72a1eb0a34 Improve comments inside modIsFrontOrRearSight() 2024-05-12 09:31:40 +01:00
Dev
ac5103390c Added nullguard check inside generateLoot() to prevent 380 mods killing bot generation 2024-05-11 16:21:39 +01:00
Dev
2e824b129c Update core json version number 2024-05-11 14:08:03 +01:00
Dev
111da41ec8 Update flea prices 2024-05-11 12:20:24 +01:00
Dev
fddbe4cf54 Merge branch '3.8.2-DEV' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.2-DEV 2024-05-10 14:51:44 +01:00
Dev
aeee99bae5 updated removeResourceFromArea() to get FiR status for a fuel item without a upd property 2024-05-10 14:51:23 +01:00
TheSparta
3b0ee75d7f Handle all bundles regarless of extension on BundleSerializer 2024-05-09 15:22:10 +01:00
Dev
a2f6d8b9bb Add PMC names 2024-05-08 08:25:53 +01:00
Refringe
8821115cfc
Fixes Duplicate Interface
This renames a BTR configuration interface that had the same name as another interface.

IBtrMapConfig --> IBtrPathConfig
2024-05-08 00:26:12 -04:00
Refringe
ba1ac09b0b
Merge branch '3.8.2-DEV' into 3.9.0-DEV
# Conflicts:
#	project/src/callbacks/ItemEventCallbacks.ts
#	project/src/models/eft/common/IGlobals.ts
#	project/src/models/eft/common/ILocation.ts
#	project/src/models/eft/common/ILocationBase.ts
#	project/src/models/eft/common/tables/ILootBase.ts
#	project/src/models/eft/common/tables/ITemplateItem.ts
#	project/src/models/eft/weather/IWeatherData.ts
#	project/src/models/spt/bots/BotGenerationDetails.ts
#	project/src/models/spt/config/IPmcConfig.ts
#	project/src/models/spt/config/IWeatherConfig.ts
#	project/src/models/spt/server/IDatabaseTables.ts
#	project/src/models/spt/server/ILocations.ts
#	project/src/servers/http/IHttpListener.ts
2024-05-08 00:21:12 -04:00
Refringe
50c7a26a58
ESLint Pass
This is the first pass of ESLint on the codebase.

ESLint formatting is less strict when it comes to line-length and line-breaks then dprint/biome, so if you see formatting that you don't like... fix it! It shouldn't require a configuration change.

- This should merge clean into master (when the time comes).
- This will not merge clean into `3.9.0-DEV`, but the conflicts aren't that bad.
2024-05-07 23:57:08 -04:00
Refringe
a73a2a76e6 Merge branch '3.8.2-DEV' into eslint-stylistic 2024-05-08 01:25:50 +00:00
Refringe
e8b47bf733
ESLint Configuration Format & Import Sorting
The built-in ESLint import settings will lint the imports, but not fix them, as that's concidered stylistic. The ESLint Stylistic package doesn't currently support sorting. We have to use the ESLint Import plugin to force import sorting. This Import plugin doesn't yet support the new ESLint flat-configuration file format so we've had to convert back to the old no-flat format.
2024-05-07 14:26:54 -04:00
Refringe
c601391da4
Fixes Markdown Formatting 2024-05-07 13:37:01 -04:00
TheSparta
cd5179bf39 fixed autoimport resolved wrong path
- vscode fumbled my previous commit
2024-05-07 15:14:49 +01:00
TheSparta
65f062a3f9 merged equal uid request interfaces into one 2024-05-07 15:09:25 +01:00
Dev
d8f2153009 Fixed flares not being sent when using give command from commando bot 2024-05-07 13:45:29 +01:00
Dev
3bf887341f Added PMC name 2024-05-07 09:49:36 +01:00
Dev
eb0fb09a37 Fixed profile creation failing when player alt+f4s partially through profile creation process
Added nullguard to `userbuilds` code inside `checkForOrphanedModdedItems()`
2024-05-07 09:02:44 +01:00
Refringe
735624eb9c
Merge branch '3.8.2-DEV' into 3.9.0-DEV 2024-05-06 21:52:21 -04:00
TheSparta
f991382d66 Fixed unable to send bundle if path had spaces 2024-05-06 21:53:30 +01:00
Dev
fa76578880 Updated insurance tests
Added logging of items attachments that are being removed
Only add items with a price to weight dictionary
2024-05-06 19:33:44 +01:00
Dev
77a5b0a4b4 Reworked how insurance picks attachments to delete before return
Now has a chance to not pick any to remove (default 10%)
Now only removes attachments that are above a rouble price (default 2000)

Stores attachments in a dictionary weighted by rouble price
Picks random amount of attachments to remove and then picks from pool by price, removing items from pool as they're picked
2024-05-06 15:54:29 +01:00
Dev
9fb1d9728e Fixed PMC loot generator only using flea price not flea or handbook price. Now uses whatever is higher 2024-05-06 15:21:35 +01:00
Dev
17296fabfd Moved reduceWeightValues from PMCLootGenerator into weightedRandomHelper and made public 2024-05-06 15:20:44 +01:00
Alex
c33773a318 Added more resiliency to the give command for modders who dont want to add localization for their mods (!325)
Fixed cases for modded items causing problems with Commando.

Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/325
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
2024-05-06 07:17:40 +00:00
Refringe
6921f9363d
Code Styling Changes
- Drops DPrint
- Drops Biome
- Adds ESList Stylistic
- Updates ESLint config to new FlatConfig format
- Removed the `dprint.dprint` and `biomejs.biome` VSC extentions from the recommendations list
- Updates README to reflect all the above changes

TODO: Import sorting & minor fixes after `npm run lint:fix`.

Curse you, Alex!
2024-05-06 02:36:35 -04:00
Alex
c552c7ad67 Removed exception thrown in compare util and instead assume two objects dont match (!324)
Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/324
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
2024-05-05 11:33:18 +00:00
Dev
6d8311150e Made traderOffersNeedRefreshing() more resilent to incorrectly installed trader mods 2024-05-05 11:50:24 +01:00
Alex
84d5462955 Fixed give command to use dice coefficient making it more precise. Fixed give command giving invalid items to players. (!323)
Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/323
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
2024-05-05 08:01:18 +00:00
Dev
509e208fb9 Merge branch '3.8.1-DEV' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.9.0-DEV
# Conflicts:
#	project/assets/configs/pmc.json
#	project/src/helpers/ItemHelper.ts
#	project/src/models/spt/config/IPmcConfig.ts
2024-05-04 21:41:44 +01:00
TheSparta
d3ac83e63b expose websockets (!321)
- Added 2 methods that expose the websocket server and each session's websocket

Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/321
Co-authored-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
Co-committed-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
2024-05-04 18:02:20 +00:00
TheSparta
d2e1624618 dialogs-profiles-refresh (!320)
This PR updates a few interfaces and consequently a few functions returned data,

it also handles 2 new routes:
`/client/friend/request/decline`
`/client/friend/request/accept-all`

Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/320
Co-authored-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
Co-committed-by: TheSparta <thesparta@noreply.dev.sp-tarkov.com>
2024-05-03 22:54:48 +00:00
Dev
99444c7237 Added config to not included secure container loot in PMCs - set to false by default 2024-05-03 21:31:24 +01:00
Dev
d32d1cb50b Removed non-ammo items from PMC secures 2024-05-03 21:09:51 +01:00
Dev
096c8471dc Fixed incorrectly logging insurance mesage 2024-05-03 20:04:29 +01:00
Dev
3125e768f7 Updated locales 2024-05-03 17:28:55 +01:00
Alex
03c914f9e8 Fixed ragfair memory leak (!319)
Fixed ragfair memory leak where NPC player ids would continuously get added into the cache map, when those offers expire the entry on the dictionary would be left empty but the string allocation on the key would remain in memory, overtime it would stack up to massive amounts of memory usage

Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/319
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
2024-05-02 13:18:34 +00:00
Alex
bccda0302f ragfair-safety-net (!318)
Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/318
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
2024-05-02 08:56:40 +00:00
Dev
2ba5358f39 Update locales with data from crowdin 2024-05-01 21:39:58 +01:00
Alex
0502257093 Added functionality for Fence to resell items sold to him by PMCs, and fixed give command giving incomplete preset items and bugged ammo boxes (!317)
Fixes https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/625

Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/317
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
2024-05-01 20:17:09 +00:00
Dev
ae0b7f83ec Fixed incorrect locale tag 2024-05-01 16:32:59 +01:00
Dev
3a464af5f4 Merge branch '3.8.1-DEV' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.9.0-DEV 2024-05-01 12:27:28 +01:00
Dev
39fdeb895c Expanded Sealed weapon container pool - Added additional weapons + updated ammos + blacklisted melee weapons from pool 2024-05-01 10:34:59 +01:00
acidphantasm
3d2fd7b40a Add stash row quest reward functionality (!316)
This functionality is currently not in use and would be nice to have for mod developers. There have been 'seasonal' quests in the past that had stash rows as a reward but this was never implemented in SPT.

Co-authored-by: acidphantasm <127812106+acidphantasm@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/316
Co-authored-by: acidphantasm <acidphantasm@noreply.dev.sp-tarkov.com>
Co-committed-by: acidphantasm <acidphantasm@noreply.dev.sp-tarkov.com>
2024-05-01 08:22:11 +00:00
Dev
5273434f7d Fixed typo 2024-04-30 23:26:49 +01:00
Dev
bddf87a4e2 Prevented drawAmmoTpl() failures from killing loot generation when cartridge data cannot be found inside staticAmmoDist 2024-04-30 23:23:00 +01:00
Dev
06b35ddde8 Improved how Level specific PMC levels are handled, not included min and max - stored in pmc.json 2024-04-30 23:21:52 +01:00
Dev
297e35a1ff Added system to set min level for PMCs spawned on sandbox_high to 20 2024-04-30 21:52:26 +01:00
Dev
a63f1c3890 Plumb in sandbox_high to configs 2024-04-30 21:51:11 +01:00
Dev
8ff241b7b9 Add new map to Interface 2024-04-30 20:54:48 +01:00
Dev
d6cd99b8ab Reduce sandbox to max level 20 2024-04-30 20:31:00 +01:00
Dev
923ca0226b Fixed incorrect data structure of base.json inside sandbox_high 2024-04-30 20:30:49 +01:00
Dev
267efdc7ea Merge branch '3.8.1-DEV' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.9.0-DEV 2024-04-29 21:50:12 +01:00
Dev
6ec3ed55bc Update map loot 2024-04-29 20:36:56 +01:00
Dev
3e99f6761f Add missing base json for sandbox_high 2024-04-29 16:30:48 +01:00
Valens
a425b1bc4b Fix weightingAdjustmentsBybotLevel (!315)
Fixed linting/syntax of the weightingAdjustmentsByBotLevel function to properly end equipment and start clothing as part of IAdjustmentDetails.

Additionally, added the "add" subfunctions to equipment for the last three levelRanges as they were missing.

Co-authored-by: VforValens <8889280+VforValens@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/315
Co-authored-by: Valens <valens@noreply.dev.sp-tarkov.com>
Co-committed-by: Valens <valens@noreply.dev.sp-tarkov.com>
2024-04-29 15:03:42 +00:00
chomp
b6926c1bf9 Improved about 5-10% performance on botgen and fixed bug that would skip containers when generating items that wouldnt fit in pockets (!314)
Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/314
2024-04-29 13:27:07 +00:00
Dev
619137417b Adjusted PMC loot/stam values due to earlier fixes to loot generation 2024-04-29 14:25:24 +01:00
Alex
55d913d0f6 Fix give command for multiple profiles and added blacklist filter (!313)
Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/313
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
2024-04-29 10:13:10 +00:00
Dev
a1070f941c Added extra guard against adding cartridges to box sold by fence
Skip adding cartridges to ammo box inside `addCartridgesToAmmoBox()` if cartridge already exists
2024-04-28 23:04:37 +01:00
Dev
995d50dba4 made use of function addUpdObjectToItem() 2024-04-28 22:50:39 +01:00
Dev
15348cec35 Fixed water bottles lacking a FoodDrink property in EoD profiles 2024-04-28 22:42:39 +01:00
Dev
b9973e609f Fixed issue with water bottles having no upd object in rare cases killing client 2024-04-28 22:39:17 +01:00
Alex
65a804dc01 pushing merge conflict resolution to previous commit (!312)
Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/312
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
2024-04-28 14:47:55 +00:00
Dev
cee7ef2e47 Updated all maps with new loot data structure 2024-04-28 15:31:37 +01:00
Alex
2172c29640 First iteration of async work on callbacks (!311)
Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/311
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
2024-04-28 13:45:36 +00:00
Dev
ddd5d69eda Added 2 additional pmc kill messages 2024-04-28 14:33:30 +01:00
kiobu
44583f40ac fixes to get in raid (customs only) (!310)
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/310
Co-authored-by: kiobu <kiobu@sdf.org>
Co-committed-by: kiobu <kiobu@sdf.org>
2024-04-28 08:01:27 +00:00
Dev
b59283e5b5 Added missing 68x51 ammo to bigmap json 2024-04-27 23:18:07 +01:00
Dev
9dff3e0790 Merge branch '3.8.1-DEV' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.9.0-DEV 2024-04-27 22:58:05 +01:00
Dev
30ee6de4a2 Added 2 additional PMC responses 2024-04-27 22:02:06 +01:00
Alex
a1e48ca245 Added profile and trader commands to commando (!309)
Added new spt commands for commando to alter profile levels and skill, as well as trader rep and money spent.

Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/309
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
2024-04-27 16:56:28 +00:00