Server/project
OkaMoez 1c6b76163b Make accelerated time calculations independent of client (!205)
Changes server accelerated time calculation to be fully independent of client calculations.

Local testing over most of a day showed time acceleration continuing through relogging as a client, and calculated times being synced to about +- 2 seconds between server and client with no drift.

-----------
In #202 I referenced the client side formula for accelerate time:
`In Raid Time = Today's Date + Location Time + Time Since Client Connection * Acceleration`
At the time I didn't know where Location Time was set and conservatively tried to match the server calculations to the client.  Since then I've confirmed that it is set after calling `client/game/start` and holds the accelerated server timestamp from that call.  With this in mind, I'm more confident changing the server calculations and here we are.

Previously each time you started your client, the accelerated time would start counting from your irl time at launch.  This change moves that to the server, so you could leave your server running to have a more live-like experience where you won't be sure of the in raid accelerated time until you log in.

Added benefit of significantly simplifying the `getInRaidTime()` code.

Future work could be done to add save/load support to the server's timestamp to further emulate the live experience where timers won't reset to your irl time unless you wipe the data.  I'd personally lean towards saving it at a server level, not a profile level, to allow multiple profiles to share a single 'wipe'.

-----------

Co-authored-by: OkaMoez <43766412+OkaMoez@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/205
Co-authored-by: OkaMoez <okamoez@noreply.dev.sp-tarkov.com>
Co-committed-by: OkaMoez <okamoez@noreply.dev.sp-tarkov.com>
2024-01-23 10:13:53 +00:00
..
.vscode missed some node version refs 2023-12-15 14:06:02 +00:00
assets Workaround for sandbox map having Level 20 max 2024-01-23 10:02:06 +00:00
src Make accelerated time calculations independent of client (!205) 2024-01-23 10:13:53 +00:00
tests Reworked LinkedList and Queue 2023-12-21 22:27:19 +00:00
.dockerignore Updated dependencies + A few other things (!150) 2023-10-14 09:01:41 +00:00
.editorconfig Formatting/Linting Changes (!168) 2023-11-16 21:42:06 +00:00
.eslintignore Add Repo 2023-03-03 15:23:46 +00:00
.eslintrc.json Add customizable chat bots and chat commands (!179) 2023-12-24 19:54:27 +00:00
.nvmrc Updated to node v20.10.0 2023-12-15 13:59:45 +00:00
.swcrc Removed @tests path alias from .swcrc 2023-10-29 22:20:34 +00:00
biome.json Formatting/Linting Changes (!168) 2023-11-16 21:42:06 +00:00
docker-compose.yml Add Repo 2023-03-03 15:23:46 +00:00
Dockerfile Formatting/Linting Changes (!168) 2023-11-16 21:42:06 +00:00
Dockerfile.docs Update Dockerfile.docs (!174) 2023-12-12 09:50:46 +00:00
Dockerfile.pnpm Updated dependencies + A few other things (!150) 2023-10-14 09:01:41 +00:00
dprint.json Formatting/Linting Changes (!168) 2023-11-16 21:42:06 +00:00
gulpfile.mjs Updated to node v20.10.0 2023-12-15 13:59:45 +00:00
package.json Updated dependencies 2023-12-21 19:02:07 +00:00
pkgconfig.json Fixed stacktraces and source maps on the built exe (!153) 2023-10-15 07:31:16 +00:00
Server.code-workspace Formatting/Linting Changes (!168) 2023-11-16 21:42:06 +00:00
tsconfig.base.json Merge branch '3.8.0' into testing-redux 2023-11-06 15:06:46 -05:00
tsconfig.json fix/profiler (!166) 2023-11-06 19:39:13 +00:00
tsconfig.typedef.json fix/profiler (!166) 2023-11-06 19:39:13 +00:00
typedoc.json Formatting/Linting Changes (!168) 2023-11-16 21:42:06 +00:00
vitest.config.ts Auto-formatting Sweep 2023-11-15 21:12:40 -05:00