Add resource package support

This commit is contained in:
sardelka9515
2022-08-23 12:21:17 +08:00
parent 6d7fe58719
commit 8ff08e0804
9 changed files with 102 additions and 48 deletions

View File

@ -81,10 +81,10 @@ namespace RageCoop.Server.Scripting
}
return r;
}
internal static ServerResource LoadFromZip(string zipPath, string tmpDir, string dataFolder, Logger logger = null)
internal static ServerResource LoadFrom(Stream input,string name, string tmpDir, string dataFolder, Logger logger = null)
{
tmpDir=Path.Combine(tmpDir, Path.GetFileNameWithoutExtension(zipPath));
new FastZip().ExtractZip(zipPath, tmpDir, null);
tmpDir=Path.Combine(tmpDir, name);
new FastZip().ExtractZip(input, tmpDir, FastZip.Overwrite.Always,null,null,null,true,true);
return LoadFrom(tmpDir, dataFolder, logger, true);
}
/// <summary>