Skip to content

Commit

Permalink
warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tpill90 committed May 3, 2024
1 parent 4332efc commit be87da0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion EpicPrefill/EpicGamesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public async Task DownloadMultipleAppsAsync(bool downloadAllOwnedGames, List<str
var distinct = CdnList.Distinct().OrderBy(e => e).ToList();
foreach (var cdn in distinct)
{
Console.WriteLine(cdn);
AnsiConsole.Console.WriteLine(cdn);
}

_ansiConsole.LogMarkupLine("Prefill complete!");
Expand Down
6 changes: 1 addition & 5 deletions EpicPrefill/EpicPrefill.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>

<!-- Code analysis settings -->
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnableNETAnalyzers>false</EnableNETAnalyzers>
<Features>strict</Features>
<AnalysisLevel>latest</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
Expand Down Expand Up @@ -101,10 +101,6 @@
<!-- Required definitions in order for Microsoft.CodeAnalysis.BannedApiAnalyzers to work -->
<AdditionalFiles Include="..\LancachePrefill.Common\BannedSymbols.txt" Link="Properties\BannedSymbols.txt" />

<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="16.9.60">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
6 changes: 4 additions & 2 deletions EpicPrefill/Extensions/MiscExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public static byte[] Decompress(this byte[] bytes)
public static byte[] ComputeSha1Hash(this byte[] input)
{
using var sha = SHA1.Create();
#pragma warning disable CA1850
return sha.ComputeHash(input);
#pragma warning restore CA1850
}

public static string ToHexString(this byte[] input)
Expand Down Expand Up @@ -47,7 +49,7 @@ public static string ReadFstring(this BinaryReader br)

// Read bytes representing string
var bytes = br.ReadBytes(stringLength - 2);
// Reading utf-16 two byte null terminators
// Reading utf-16 two byte null terminators
br.ReadBytes(2);

return Encoding.Unicode.GetString(bytes);
Expand All @@ -58,7 +60,7 @@ public static string ReadFstring(this BinaryReader br)
{
// Read bytes representing string
var bytes = br.ReadBytes(stringLength - 1);
// Read null delimiter
// Read null delimiter
br.ReadBytes(1);

return Encoding.ASCII.GetString(bytes);
Expand Down
6 changes: 3 additions & 3 deletions EpicPrefill/Handlers/EpicGamesApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public async Task<List<GameAsset>> GetOwnedAppsAsync()

// Read and deserialize
using var responseContent = await response.Content.ReadAsStreamAsync();
var ownedApps = JsonSerializer.Deserialize(responseContent, SerializationContext.Default.ListGameAsset);
var ownedApps = await JsonSerializer.DeserializeAsync(responseContent, SerializationContext.Default.ListGameAsset);

var appMetadata = await LoadAppMetadataAsync(ownedApps);
foreach (var app in ownedApps)
Expand Down Expand Up @@ -112,7 +112,7 @@ private async Task<AppMetadataResponse> GetSingleAppMetadataAsync(GameAsset appI
response.EnsureSuccessStatusCode();

using var responseStream = await response.Content.ReadAsStreamAsync();
var appMetadata = JsonSerializer.Deserialize(responseStream, SerializationContext.Default.DictionaryStringAppMetadataResponse);
var appMetadata = await JsonSerializer.DeserializeAsync(responseStream, SerializationContext.Default.DictionaryStringAppMetadataResponse);

return appMetadata.Values.First();
}
Expand All @@ -129,7 +129,7 @@ public async Task<List<ManifestUrl>> GetAllDownloadUrlsAsync(GameAsset appInfo)
response.EnsureSuccessStatusCode();

using var responseStream = await response.Content.ReadAsStreamAsync();
ManifestResponse deserialized = JsonSerializer.Deserialize(responseStream, SerializationContext.Default.ManifestResponse);
ManifestResponse deserialized = await JsonSerializer.DeserializeAsync(responseStream, SerializationContext.Default.ManifestResponse);

return deserialized.elements.First().manifests.ToList();
}
Expand Down
2 changes: 1 addition & 1 deletion EpicPrefill/Models/Exceptions/EpicLoginException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class EpicLoginException : Exception
{
protected EpicLoginException(SerializationInfo info, StreamingContext context) : base(info, context)
protected EpicLoginException(SerializationInfo info, StreamingContext context)
{

}
Expand Down
2 changes: 1 addition & 1 deletion EpicPrefill/Models/Exceptions/UserCancelledException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class UserCancelledException : Exception
{
protected UserCancelledException(SerializationInfo info, StreamingContext context) : base(info, context)
protected UserCancelledException(SerializationInfo info, StreamingContext context)
{

}
Expand Down

0 comments on commit be87da0

Please sign in to comment.