light mode fix

This commit is contained in:
hydrant
2020-05-05 19:35:13 +02:00
parent 1b140a6119
commit 3618f2074e
3 changed files with 18 additions and 12 deletions

View File

@@ -10,6 +10,8 @@ namespace ReallifeGamemode.Server.Managers
{
private static Timer realTimeTimer;
public static TimeSpan CurrentTime { get; private set; }
public static void StartTimeManager()
{
if (realTimeTimer == null)
@@ -24,11 +26,13 @@ namespace ReallifeGamemode.Server.Managers
public static void PauseTimeManager()
{
realTimeTimer.Stop();
CurrentTime = DateTime.Now.TimeOfDay;
}
private static void SetTime(object sender, ElapsedEventArgs args)
{
DateTime now = DateTime.Now;
CurrentTime = now.TimeOfDay;
NAPI.World.SetTime(now.Hour, now.Minute, now.Second);
}
}