mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
The server expects that the total "Progress" when a bitcoin is complete to be the "ProductionTime" value (145000 by default). However the server was using a modified target value, while only adding the actual time change to the Progress. This results in a drift over time between the client/server while the server is stopped, as the client gets an incorrect value on startup. If we instead scale the addition to Progress based on the adjusted craft time, and target the base productionTime for completion, we can get a much more accurate progress while offline that matches the client I used the profile from this ticket for testing: SPT-AKI/Issues#496 The user has both an upgrade and bitcoin going at the same time, so they should progress at the same rate. This is what the code was previously resulting in: ![image](/attachments/fe428a3b-d271-40e1-a3f6-08ef936224b6) While the server was shut down for 50 minutes (As noted by the upgrade), only 36 minutes was deducted from the bitcoin craft. This is the result of that same profile after these changes were made: ![image](/attachments/d2ce44e6-1a0e-4991-aa51-3eb340c22ca5) You can see that ~2 hours 25 minutes was deducted from both the upgrade, as well as the bitcoin craft timer. There is still a slight discrepancy, but in a total bitcoin run it should be minimal Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com> Reviewed-on: SPT-AKI/Server#225 Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com> Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>