mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Several fixes for BSA compiling
This commit is contained in:
parent
65cac27403
commit
723f687dbd
@ -280,7 +280,7 @@ namespace Compression.BSA
|
||||
case VersionType.SSE:
|
||||
{
|
||||
var r = new MemoryStream();
|
||||
using (var w = LZ4Stream.Encode(r, new LZ4EncoderSettings {CompressionLevel = LZ4Level.L10_OPT}, true))
|
||||
using (var w = LZ4Stream.Encode(r, new LZ4EncoderSettings {CompressionLevel = LZ4Level.L12_MAX}, true))
|
||||
{
|
||||
_srcData.CopyTo(w);
|
||||
}
|
||||
|
@ -314,7 +314,18 @@ namespace Wabbajack.Common
|
||||
|
||||
if (!_typeToName.ContainsKey(serializedType))
|
||||
{
|
||||
throw new InvalidDataException($"No Binding name for {serializedType}");
|
||||
var custom = serializedType.GetCustomAttributes(false)
|
||||
.OfType<JsonNameAttribute>().FirstOrDefault();
|
||||
if (custom == null)
|
||||
{
|
||||
throw new InvalidDataException($"No Binding name for {serializedType}");
|
||||
}
|
||||
|
||||
_nameToType[custom.Name] = serializedType;
|
||||
_typeToName[serializedType] = custom.Name;
|
||||
assemblyName = null;
|
||||
typeName = custom.Name;
|
||||
return;
|
||||
}
|
||||
|
||||
var name = _typeToName[serializedType];
|
||||
|
@ -30,8 +30,12 @@ namespace Wabbajack.Common
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
// This can happen at times due to differences in compression sizes
|
||||
if (_head + size >= _size)
|
||||
throw new InvalidDataException($"Size out of range. Declared {_size} used {_head + size}");
|
||||
{
|
||||
return new MemoryStream();
|
||||
}
|
||||
|
||||
var startAt = _head;
|
||||
_head += size;
|
||||
var stream = _mmap.CreateViewStream(startAt, size, MemoryMappedFileAccess.ReadWrite);
|
||||
|
@ -66,7 +66,7 @@ namespace Wabbajack.Lib.CompilationSteps
|
||||
|
||||
var id = Guid.NewGuid().ToString();
|
||||
|
||||
var matches = await sourceFiles.PMap(_mo2Compiler.Queue, e => _mo2Compiler.RunStack(stack, new RawSourceFile(e, Consts.BSACreationDir.Combine((RelativePath)id, e.Name.FileName))));
|
||||
var matches = await sourceFiles.PMap(_mo2Compiler.Queue, e => _mo2Compiler.RunStack(stack, new RawSourceFile(e, Consts.BSACreationDir.Combine((RelativePath)id, (RelativePath)e.Name))));
|
||||
|
||||
|
||||
foreach (var match in matches)
|
||||
|
@ -17,7 +17,7 @@ namespace Wabbajack.Lib.CompilationSteps
|
||||
source.AbsolutePath.Extension != Consts.ESM) return null;
|
||||
|
||||
var bsa = source.AbsolutePath.ReplaceExtension(Consts.BSA);
|
||||
var bsaTextures = source.AbsolutePath.AppendToName(" - Textures");
|
||||
var bsaTextures = source.AbsolutePath.AppendToName(" - Textures").ReplaceExtension(Consts.BSA);
|
||||
|
||||
if (source.AbsolutePath.Size > 250 || !bsa.IsFile && !bsaTextures.IsFile) return null;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user