From 81ee7181c7e599c755b4d23e65377fbec61fdb26 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sun, 4 May 2025 15:27:55 +0100 Subject: [PATCH] Split `GetInRaidTime` into 2 methods --- .../Helpers/WeatherHelper.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Helpers/WeatherHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/WeatherHelper.cs index f7f28461..34158f92 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/WeatherHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/WeatherHelper.cs @@ -17,16 +17,26 @@ public class WeatherHelper( protected WeatherConfig _weatherConfig = _configServer.GetConfig(); /// + /// Assumes current time /// Get the current in-raid time - does not include an accurate date, only time /// - /// (new Date()) /// Date object of current in-raid time - public DateTime GetInRaidTime(long? timestamp = null) + public DateTime GetInRaidTime() + { + return GetInRaidTime(_timeUtil.GetTimeStamp()); + } + + /// + /// Get the current in-raid time - does not include an accurate date, only time + /// + /// Fixed timestamp + /// Date object of current in-raid time + public DateTime GetInRaidTime(long timestamp) { // tarkov time = (real time * 7 % 24 hr) + 3 hour var russiaOffsetMilliseconds = _timeUtil.GetHoursAsSeconds(3) * 1000; var twentyFourHoursMilliseconds = _timeUtil.GetHoursAsSeconds(24) * 1000; - var currentTimestampMilliSeconds = timestamp ?? _timeUtil.GetTimeStamp(); + var currentTimestampMilliSeconds = _timeUtil.GetTimeStamp(); return _timeUtil.GetDateTimeFromTimeStamp( (long)