Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9c22948ce9 | ||
![]() |
2b1a5d4c6e | ||
![]() |
2860dda41b |
@@ -62,14 +62,21 @@ namespace Torch.Managers
|
||||
{
|
||||
File.Delete(source);
|
||||
}
|
||||
catch (IOException)
|
||||
catch (Exception e) when (e is IOException or UnauthorizedAccessException)
|
||||
{
|
||||
var tempFilePath = Path.Combine(path, file + ".old");
|
||||
if (File.Exists(tempFilePath))
|
||||
File.Delete(tempFilePath);
|
||||
|
||||
try
|
||||
{
|
||||
File.Move(source, tempFilePath);
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -109,8 +109,15 @@ namespace Torch.Managers
|
||||
else
|
||||
{
|
||||
_fsManager.SoftDelete(extractPath, file.FullName);
|
||||
try
|
||||
{
|
||||
file.ExtractToFile(targetFile, true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.Warn(e, "unable to extract {0}", targetFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//zip.ExtractToDirectory(extractPath); //throws exceptions sometimes?
|
||||
|
@@ -58,10 +58,10 @@ namespace Torch.Patches
|
||||
typeof(TypeConverter).Assembly.Location,
|
||||
typeof(System.Diagnostics.TraceSource).Assembly.Location,
|
||||
typeof(System.Security.Policy.Evidence).Assembly.Location,
|
||||
typeof(ProtoBuf.Meta.RuntimeTypeModel).Assembly.Location,
|
||||
typeof(ProtoContractAttribute).Assembly.Location,
|
||||
Path.Combine(baseDir, "System.Xml.ReaderWriter.dll"),
|
||||
Path.Combine(baseDir, "netstandard.dll"),
|
||||
Path.Combine(baseDir, "System.Runtime.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "ProtoBuf.Net.Core.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "Sandbox.Game.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "Sandbox.Common.dll"),
|
||||
Path.Combine(MyFileSystem.ExePath, "Sandbox.Graphics.dll"),
|
||||
@@ -83,14 +83,6 @@ namespace Torch.Patches
|
||||
|
||||
using var batch = MyScriptCompiler.Static.Whitelist.OpenBatch();
|
||||
batch.AllowTypes(MyWhitelistTarget.ModApi, typeof(ConcurrentQueue<>));
|
||||
batch.AllowNamespaceOfTypes(MyWhitelistTarget.Both, typeof(ImmutableArray), typeof(ArrayExtensions));
|
||||
batch.AllowTypes(MyWhitelistTarget.ModApi, typeof(ProtoContractAttribute).Assembly.GetExportedTypes()
|
||||
.Where(b => b.Namespace == "ProtoBuf" && b.Name.Contains("Attribute"))
|
||||
.Concat(new[]
|
||||
{
|
||||
typeof(DataFormat), typeof(MemberSerializationOptions), typeof(ImplicitFields)
|
||||
}).ToArray());
|
||||
batch.AllowTypes(MyWhitelistTarget.ModApi, typeof(WorkData));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user