Use IGameTiming for lobby timing instead of DateTime.

Fixes #1681
This commit is contained in:
Pieter-Jan Briers
2021-01-11 09:03:58 +01:00
parent b36d22128a
commit 374b100a5e
5 changed files with 31 additions and 29 deletions

View File

@@ -92,7 +92,7 @@ namespace Content.Shared.GameTicking
public bool IsRoundStarted { get; set; }
public bool YouAreReady { get; set; }
// UTC.
public DateTime StartTime { get; set; }
public TimeSpan StartTime { get; set; }
public bool Paused { get; set; }
public override void ReadFromBuffer(NetIncomingMessage buffer)
@@ -105,7 +105,7 @@ namespace Content.Shared.GameTicking
}
YouAreReady = buffer.ReadBoolean();
StartTime = new DateTime(buffer.ReadInt64(), DateTimeKind.Utc);
StartTime = new TimeSpan(buffer.ReadInt64());
Paused = buffer.ReadBoolean();
}
@@ -158,9 +158,9 @@ namespace Content.Shared.GameTicking
#endregion
/// <summary>
/// The total amount of seconds to go until the countdown finishes
/// The game time that the game will start at.
/// </summary>
public DateTime StartTime { get; set; }
public TimeSpan StartTime { get; set; }
/// <summary>
/// Whether or not the countdown is paused
@@ -169,7 +169,7 @@ namespace Content.Shared.GameTicking
public override void ReadFromBuffer(NetIncomingMessage buffer)
{
StartTime = new DateTime(buffer.ReadInt64(), DateTimeKind.Utc);
StartTime = new TimeSpan(buffer.ReadInt64());
Paused = buffer.ReadBoolean();
}