diff --git a/AssettoServer.Shared/Network/Packets/Outgoing/Handshake/HandshakeResponse.cs b/AssettoServer.Shared/Network/Packets/Outgoing/Handshake/HandshakeResponse.cs index 7403cce8..8aa97bb6 100644 --- a/AssettoServer.Shared/Network/Packets/Outgoing/Handshake/HandshakeResponse.cs +++ b/AssettoServer.Shared/Network/Packets/Outgoing/Handshake/HandshakeResponse.cs @@ -43,7 +43,7 @@ public class HandshakeResponse : IOutgoingNetworkPacket, IIncomingNetworkPacket public IEnumerable? ChecksumPaths; public string LegalTyres = ""; public int RandomSeed; - public long CurrentTime; + public int CurrentTime; public void ToWriter(ref PacketWriter writer) { @@ -93,7 +93,7 @@ public void ToWriter(ref PacketWriter writer) writer.Write(TrackGrip); writer.Write(SessionId); - writer.Write(SessionTime); + writer.Write(SessionTime); writer.Write(ChecksumCount); if (ChecksumPaths != null) @@ -102,7 +102,7 @@ public void ToWriter(ref PacketWriter writer) writer.WriteUTF8String(LegalTyres); writer.Write(RandomSeed); - writer.Write((uint)CurrentTime); + writer.Write(CurrentTime); } public void FromReader(PacketReader reader) @@ -177,6 +177,6 @@ public void FromReader(PacketReader reader) LegalTyres = reader.ReadUTF8String(); RandomSeed = reader.Read(); - CurrentTime = reader.Read(); + CurrentTime = reader.Read(); } } diff --git a/AssettoServer/Network/Tcp/ACTcpClient.cs b/AssettoServer/Network/Tcp/ACTcpClient.cs index 4b1801a6..bf6c10ae 100644 --- a/AssettoServer/Network/Tcp/ACTcpClient.cs +++ b/AssettoServer/Network/Tcp/ACTcpClient.cs @@ -382,7 +382,7 @@ private async Task ReceiveLoopAsync() SessionTime = _sessionManager.CurrentSession.SessionTimeMilliseconds, ChecksumCount = (byte)_checksumManager.TrackChecksums.Count, ChecksumPaths = _checksumManager.TrackChecksums.Keys, - CurrentTime = _sessionManager.ServerTimeMilliseconds, + CurrentTime = 0, // Ignored by AC LegalTyres = cfg.LegalTyres, RandomSeed = 123, SessionCount = (byte)_configuration.Sessions.Count, diff --git a/AssettoServer/Program.cs b/AssettoServer/Program.cs index 2f37e51b..fdcab6a2 100644 --- a/AssettoServer/Program.cs +++ b/AssettoServer/Program.cs @@ -149,6 +149,7 @@ internal static async Task Main(string[] args) && inst.Name != "http.server.request.duration" && inst.Name != "kestrel.connection.duration" && inst.Name != "aspnetcore.routing.match_attempts" + && inst.Name != "dns.lookups.duration" && !inst.Name.StartsWith("http.client."); }); diff --git a/AssettoServer/Server/SessionState.cs b/AssettoServer/Server/SessionState.cs index 6633a19c..90d1db7f 100644 --- a/AssettoServer/Server/SessionState.cs +++ b/AssettoServer/Server/SessionState.cs @@ -10,7 +10,7 @@ public class SessionState public int EndTime { get; set; } // TODO public long StartTimeMilliseconds { get; set; } public int TimeLeftMilliseconds => Configuration.Infinite ? Configuration.Time * 60_000 : (int)(StartTimeMilliseconds + Configuration.Time * 60_000 - _timeSource.ServerTimeMilliseconds); - public int SessionTimeMilliseconds => (int)(_timeSource.ServerTimeMilliseconds - StartTimeMilliseconds); + public long SessionTimeMilliseconds => _timeSource.ServerTimeMilliseconds - StartTimeMilliseconds; public uint TargetLap { get; set; } = 0; public uint LeaderLapCount { get; set; } = 0; public bool LeaderHasCompletedLastLap { get; set; } = false;