Includes updates to Vitest dependencies, a small bug fix, and a
configuration change. All three of which were throwing warnings when the
test suite was ran.
### Dependency Updates:
*
[`project/package.json`](diffhunk://#diff-18e5b8a4dad7b1ed0da6b50ed507b3ab8116e07a8e44abd959a28261878d021fL69-R70):
Updated `@vitest/coverage-istanbul` and `@vitest/ui` to version `^2.1.8`
and added `vitest` dependency.
[[1]](diffhunk://#diff-18e5b8a4dad7b1ed0da6b50ed507b3ab8116e07a8e44abd959a28261878d021fL69-R70)
[[2]](diffhunk://#diff-18e5b8a4dad7b1ed0da6b50ed507b3ab8116e07a8e44abd959a28261878d021fL84-R85)
### Bug Fix:
*
[`project/src/controllers/RepeatableQuestController.ts`](diffhunk://#diff-92e6bd4234ed3c13309eb9bd27437f0933e58dedee51544e9b017b57c2a3c51cL581-R581):
Fixed a bug in the charisma bonus calculation for the `cost.count`
value.
### Configuration Changes:
*
[`project/tests/CustomEnvironment.ts`](diffhunk://#diff-79780538b7a90a5f7befb22838a460f65e3e0bce53d3685f36ed2b74894246a0L9-R9):
Updated the import path for `Environment` from `vitest`.
*
[`project/vitest.config.mts`](diffhunk://#diff-18152746ad4df10b798ca21a09c321bc8ad4adc393ebc6a26016a524203e599cR5-L10):
Added `cacheDir` configuration and renamed the file from
`vitest.config.ts`.
This changes the backup service to log in debug instead of error when the profiles directory can't be found. The profiles directory will not exist on initial run, so this is actually expected to catch until it's created.
Here's a jumping off point for the profile backup feature. Included some
basic configuration options. Currently backup runs on server start-up
(before the profiles are loaded into memory) and on a configurable
interval.
I think it still needs work.
- [x] The folder name dates should be used to detect which old backups
should be removed
- [x] Not sure about the interval implementation...
- [x] Could make the clean method thinner
- [x] Remove VFS; I don't believe it's needed for copy operations
- [x] Save a list of active mods used by the backed up profiles
---------
Co-authored-by: Chomp <27521899+chompDev@users.noreply.github.com>
Co-authored-by: Chomp <dev@dev.sp-tarkov.com>
This commit implements basic friends list functionality including adding, auto accepting, and removing friends. As well as storing the list in the profile and providing the friends list back to the client on login.
This is a one-way implementation, the target profile will not have the source account added to its friends list.
This is primarily useful in combination with the recent favorites fixes, to allow users to inspect favorited weapons on other profiles to "copy" weapon builds between their profiles
Adds a public `randNum` method to the `RandomUtil` class which can be seen as a "superseeded" version of the `randInt` method. It can handle generating random numbers, including both integers or floating-point numbers with support for providing a precision.
Adds a private `getNumberPrecision` method to the `RandomUtil` class which simply counts the number of fractional digits in a number.
Changes `randInt` to log a debug message saying that the ability to pass it a floating-point number is deprecated.
Better handle rewards not fitting (they shouldn't just poof) by instead
trimming the rewards amount until they fit.
(cherry picked from commit 8d05bf0069b22968d7e4fcdc4901ae0babd948c3)
Reworked Cultist circle code to pass blacklist around as a set rather than array
Removed cultist circle use of `itemRewardBlacklist` to store item parent ids, feature is handled by new config property