Skip to content

针对二进制文件系统加载做出的修改 #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GameFramework/Resource/ResourceManager.ResourceLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ public byte[] LoadBinaryFromFileSystem(string binaryAssetName)
}

IFileSystem fileSystem = m_ResourceManager.GetFileSystem(resourceInfo.FileSystemName, resourceInfo.StorageInReadOnly);
byte[] bytes = fileSystem.ReadFile(resourceInfo.ResourceName.FullName);
byte[] bytes = fileSystem.ReadFile(binaryAssetName);
if (bytes == null)
{
return null;
Expand Down
4 changes: 2 additions & 2 deletions GameFramework/Utility/Utility.Encryption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static class Encryption
/// <returns>异或后的二进制流。</returns>
public static byte[] GetQuickXorBytes(byte[] bytes, byte[] code)
{
return GetXorBytes(bytes, 0, QuickEncryptLength, code);
return GetXorBytes(bytes, 0, Math.Min(QuickEncryptLength, bytes.Length), code);
}

/// <summary>
Expand All @@ -36,7 +36,7 @@ public static byte[] GetQuickXorBytes(byte[] bytes, byte[] code)
/// <param name="code">异或二进制流。</param>
public static void GetQuickSelfXorBytes(byte[] bytes, byte[] code)
{
GetSelfXorBytes(bytes, 0, QuickEncryptLength, code);
GetSelfXorBytes(bytes, 0, Math.Min(QuickEncryptLength, bytes.Length), code);
}

/// <summary>
Expand Down