mirror of
https://github.com/aelurum/AssetStudio.git
synced 2026-11-15 19:28:48 -05:00
Some other fixes
This commit is contained in:
@@ -118,9 +118,9 @@ namespace AssetStudio
|
||||
{
|
||||
if (!unityVer.IsStripped && customUnityVer != unityVer)
|
||||
{
|
||||
Logger.Warning($"Detected Unity version is different from the specified one ({customUnityVer.FullVersion.Color(ColorConsole.BrightCyan)}).\n" +
|
||||
$"Assets may load with errors.\n" +
|
||||
$"It is recommended to specify the detected Unity version: {unityVer.FullVersion.Color(ColorConsole.BrightCyan)}");
|
||||
Logger.Warning($"Detected Unity version [{unityVer.FullVersion.Color(ColorConsole.BrightCyan)}] is different from the specified one [{customUnityVer.FullVersion.Color(ColorConsole.BrightCyan)}].\n" +
|
||||
"Assets may load with errors.\n" +
|
||||
"It is recommended not to specify a Unity version for this file.");
|
||||
}
|
||||
unityVer = customUnityVer;
|
||||
}
|
||||
@@ -359,12 +359,13 @@ namespace AssetStudio
|
||||
case CompressionType.Lzham:
|
||||
throw new IOException($"Unsupported blockInfo compression type: {compressionType}.\n");
|
||||
default:
|
||||
throw new IOException($"Unknown blockInfo compression type: {compressionType}.\nYou may try to specify the compression type manually.\n");
|
||||
throw new IOException($"Unknown blockInfo compression type: {compressionType}.\nYou may try to specify the compression type manually in the options.\n");
|
||||
}
|
||||
|
||||
if (numWrite != uncompressedSize)
|
||||
{
|
||||
var msg = $"{compressionType} blockInfo decompression error. {errorMsg}\nWrite {numWrite} bytes but expected {uncompressedSize} bytes.";
|
||||
var type = compressionType == CompressionType.None ? "Uncompressed" : compressionType.ToString();
|
||||
var msg = $"{type} blockInfo decompression error. {errorMsg}\nWrite {numWrite} bytes but expected {uncompressedSize} bytes.";
|
||||
var exMsg = compressionType > CompressionType.Lz4HC || customBlockInfoCompression != CompressionType.Auto
|
||||
? "Wrong compression type or blockInfo data might be encrypted."
|
||||
: "BlockInfo data might be encrypted.";
|
||||
@@ -491,7 +492,8 @@ namespace AssetStudio
|
||||
|
||||
if (numWrite != blockInfo.uncompressedSize)
|
||||
{
|
||||
var msg = $"{compressionType} block decompression error. {errorMsg}\nWrite {numWrite} bytes but expected {blockInfo.uncompressedSize} bytes.";
|
||||
var type = compressionType == CompressionType.None ? "Uncompressed" : compressionType.ToString();
|
||||
var msg = $"{type} block decompression error. {errorMsg}\nWrite {numWrite} bytes but expected {blockInfo.uncompressedSize} bytes.";
|
||||
var exMsg = compressionType > CompressionType.Lz4HC || customBlockCompression != CompressionType.Auto
|
||||
? "Wrong compression type or block data might be encrypted."
|
||||
: "Block data might be encrypted.";
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace AssetStudio.CustomOptions
|
||||
{
|
||||
throw new NotSupportedException("Specified Unity version is not in a correct format.\n" +
|
||||
"Specify full Unity version, including letters at the end.\n" +
|
||||
"Example: 2017.4.39f1");
|
||||
"Example: 2022.3.2f1");
|
||||
}
|
||||
_customUnityVer = value;
|
||||
UnityVersionChanged?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace AssetStudio
|
||||
private static readonly byte[] brotliMagic = { 0x62, 0x72, 0x6F, 0x74, 0x6C, 0x69 };
|
||||
private static readonly byte[] zipMagic = { 0x50, 0x4B, 0x03, 0x04 };
|
||||
private static readonly byte[] zipSpannedMagic = { 0x50, 0x4B, 0x07, 0x08 };
|
||||
private static readonly byte[] unityFsMagic = {0x55, 0x6E, 0x69, 0x74, 0x79, 0x46, 0x53, 0x00};
|
||||
private static readonly byte[] unityFsMagic = { 0x55, 0x6E, 0x69, 0x74, 0x79, 0x46, 0x53, 0x00 };
|
||||
private static readonly int headerBuffLen = 1152;
|
||||
private static byte[] headerBuff = new byte[headerBuffLen];
|
||||
|
||||
|
||||
@@ -98,8 +98,7 @@ namespace AssetStudio
|
||||
return;
|
||||
}
|
||||
version = assetsManager.Options.CustomUnityVersion;
|
||||
reader.Position = versionPos;
|
||||
reader.ReadBytes(version.ToString().Length + 1);
|
||||
reader.Position = versionPos + version.ToString().Length + 1;
|
||||
}
|
||||
}
|
||||
if (header.m_Version >= SerializedFileFormatVersion.Unknown_8)
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace AssetStudio
|
||||
}
|
||||
if (readed != reader.byteSize)
|
||||
{
|
||||
Logger.Info($"Failed to read type, read {readed} bytes but expected {reader.byteSize} bytes");
|
||||
Logger.Info($"Failed to read type, read {reader.Position - reader.byteStart} bytes but expected {reader.byteSize} bytes");
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
|
||||
Reference in New Issue
Block a user