Fix the duration timing again.

This commit is contained in:
scuffedjays
2020-04-16 13:07:58 -05:00
parent 7ae8f8429d
commit 43b27e93bc

View File

@@ -195,7 +195,7 @@ namespace Content.Server.GameTicking
SpawnPlayer(player, job, false); SpawnPlayer(player, job, false);
} }
_roundStartTimeSpan = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); _roundStartTimeSpan = IoCManager.Resolve<IGameTiming>().RealTime;
_sendStatusToAll(); _sendStatusToAll();
} }
@@ -222,10 +222,7 @@ namespace Content.Server.GameTicking
roundEndMessage.GamemodeTitle = MakeGamePreset().ModeTitle; roundEndMessage.GamemodeTitle = MakeGamePreset().ModeTitle;
//Get the timespan of the round. //Get the timespan of the round.
roundEndMessage.RoundDuration = new TimeSpan(DateTime.Now.Hour, roundEndMessage.RoundDuration = IoCManager.Resolve<IGameTiming>().RealTime.Subtract(_roundStartTimeSpan);
DateTime.Now.Minute,
DateTime.Now.Second)
.Subtract(_roundStartTimeSpan);
//Generate a list of basic player info to display in the end round summary. //Generate a list of basic player info to display in the end round summary.
var listOfPlayerInfo = new List<RoundEndPlayerInfo>(); var listOfPlayerInfo = new List<RoundEndPlayerInfo>();
@@ -238,7 +235,7 @@ namespace Content.Server.GameTicking
{ {
PlayerOOCName = ply.Name, PlayerOOCName = ply.Name,
PlayerICName = mindComponent.Mind.CurrentEntity.Name, PlayerICName = mindComponent.Mind.CurrentEntity.Name,
Role = mindComponent.Mind.AllRoles.First() != null ? mindComponent.Mind.AllRoles.First().Name : Loc.GetString("Unkown"), Role = mindComponent.Mind.AllRoles.FirstOrDefault()?.Name ?? Loc.GetString("Unkown"),
Antag = false Antag = false
}; };
listOfPlayerInfo.Add(playerEndRoundInfo); listOfPlayerInfo.Add(playerEndRoundInfo);