Skip to content

Commit

Permalink
get rid of some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
compujuckel committed Sep 14, 2024
1 parent 5de0bdf commit fedd332
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class CarListResponse : IOutgoingNetworkPacket
public int PageIndex;
public int EntryCarsCount;
public required IEnumerable<IEntryCar<IClient>> EntryCars;
public Dictionary<byte, EntryCarResult> CarResults;
public required Dictionary<byte, EntryCarResult> CarResults;

public void ToWriter(ref PacketWriter writer)
{
Expand Down
9 changes: 8 additions & 1 deletion AssettoServer/AssettoServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<DebugType>embedded</DebugType>
<Nullable>enable</Nullable>
<PublishDir>..\out-$(RuntimeIdentifier)\</PublishDir>
<NoWarn>ERP022,EPC12</NoWarn>
<NoWarn>ERP022,EPC12,EPC20</NoWarn>
<Platforms>AnyCPU</Platforms>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == '' AND $([MSBuild]::IsOsPlatform('Windows')) AND '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X64' ">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == '' AND $([MSBuild]::IsOsPlatform('Linux')) AND '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X64' ">linux-x64</RuntimeIdentifier>
Expand Down Expand Up @@ -78,6 +78,13 @@
<PackageReference Include="Sigil" Version="5.0.0" />
<PackageReference Include="SunCalcNet" Version="1.2.2" />
<PackageReference Include="System.IO.Hashing" Version="9.0.0-rc.1.24431.7" />
<!--
Only putting this here because of tons of vulnerability warnings at build time with version 4.3.0.
NJsonSchema pulls this in via Namotion.Reflection.
TODO Remove once Namotion.Reflection and NJsonSchema no longer depend on a vulnerable version
-->
<PackageReference Include="System.Private.Uri" Version="4.3.2" />
<PackageReference Include="YamlDotNet" Version="16.1.2" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.244" PrivateAssets="all" Condition="!Exists('packages.config')" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion AssettoServer/Network/Tcp/ACTcpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ private void OnCarListRequest(PacketReader reader)
PageIndex = carListRequest.PageIndex,
EntryCarsCount = carsInPage.Count,
EntryCars = carsInPage,
CarResults = _sessionManager.CurrentSession.Results,
CarResults = _sessionManager.CurrentSession.Results ?? new Dictionary<byte, EntryCarResult>(),
};

CarListResponseSending?.Invoke(this, new CarListResponseSendingEventArgs(carListResponse));
Expand Down

0 comments on commit fedd332

Please sign in to comment.