Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbadmin committed Dec 19, 2022
1 parent 3d3d126 commit 6a5f8db
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ void Fsw_Changed(object sender, FileSystemEventArgs e)
private const uint MagicNumber = 123094055U;
private const uint MagicNumberV2 = 123094056U;

private static readonly Lazy<uint[]> MagicNumbers = new(new uint[] { MagicNumber, MagicNumberV2 });

/// <summary>
/// 从steam本地客户端缓存文件中读取游戏数据
/// </summary>
Expand All @@ -556,7 +558,7 @@ List<SteamApp> GetAppInfos_()
}
using BinaryReader binaryReader = new(stream);
uint num = binaryReader.ReadUInt32();
if (num is not MagicNumberV2 or MagicNumber)
if (!MagicNumbers.Value.Contains(num))
{
var msg = string.Format("\"{0}\" magic code is not supported: 0x{1:X8}", Path.GetFileName(AppInfoPath), num);
Log.Error(nameof(GetAppInfos), msg);
Expand Down

0 comments on commit 6a5f8db

Please sign in to comment.