Skip to content

Commit

Permalink
Checksums have to be passed first before sending welcome message
Browse files Browse the repository at this point in the history
  • Loading branch information
compujuckel committed Dec 20, 2024
1 parent 1fbdb5c commit 8af59c1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion AssettoServer.Shared/AssettoServer.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<FrameworkReference Include="Microsoft.AspNetCore.App" Version="2.2.8" />
<PackageReference Include="Serilog" Version="4.1.0" />
<PackageReference Include="Serilog" Version="4.2.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion AssettoServer/AssettoServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<PackageReference Include="protobuf-net.Grpc" Version="1.2.2" />
<PackageReference Include="Qmmands" Version="5.0.2" />
<PackageReference Include="Scriban" Version="5.12.0" />
<PackageReference Include="Serilog" Version="4.1.0" />
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" />
<PackageReference Include="Serilog.Enrichers.Sensitive" Version="1.7.3" />
Expand Down
7 changes: 5 additions & 2 deletions AssettoServer/Network/Udp/ACUdpServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,14 @@ private void OnReceived(SocketAddress address, byte[] buffer, int size)
}
else if (packetId == ACServerProtocol.PositionUpdate)
{
// Pass checksum first before sending first update + welcome message.
// Plugins might rely on checksums to generate CSP extra options
if (client.ChecksumStatus != ChecksumStatus.Succeeded) return;

if (!client.HasSentFirstUpdate)
client.SendFirstUpdate();

if (client.ChecksumStatus != ChecksumStatus.Succeeded
|| client.SecurityLevel < _configuration.Extra.MandatoryClientSecurityLevel) return;
if (client.SecurityLevel < _configuration.Extra.MandatoryClientSecurityLevel) return;

car.UpdatePosition(packetReader.Read<PositionUpdateIn>());
}
Expand Down
2 changes: 1 addition & 1 deletion FastLaneUtils/FastLaneUtils.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0" />
<PackageReference Include="Serilog" Version="4.1.0" />
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
</ItemGroup>

Expand Down

0 comments on commit 8af59c1

Please sign in to comment.