mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-14 04:34:16 +01:00
fix: add flag for testing plugins, don't load testing plugins if testing is disabled
This commit is contained in:
parent
770363e2d2
commit
e498da8079
2 changed files with 15 additions and 1 deletions
|
|
@ -99,6 +99,12 @@ namespace Dalamud.Plugin
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var testingFile = new FileInfo(Path.Combine(dllFile.Directory.FullName, ".testing"));
|
||||||
|
if (testingFile.Exists && this.dalamud.Configuration.DoPluginTest) {
|
||||||
|
Log.Information("Plugin {0} was testing, but testing is disabled.", dllFile.FullName);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// read the plugin def if present - again, fail before actually trying to load the dll if there is a problem
|
// read the plugin def if present - again, fail before actually trying to load the dll if there is a problem
|
||||||
var defJsonFile = new FileInfo(Path.Combine(dllFile.Directory.FullName, $"{Path.GetFileNameWithoutExtension(dllFile.Name)}.json"));
|
var defJsonFile = new FileInfo(Path.Combine(dllFile.Directory.FullName, $"{Path.GetFileNameWithoutExtension(dllFile.Name)}.json"));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ namespace Dalamud.Plugin
|
||||||
var outputDir = new DirectoryInfo(Path.Combine(this.pluginDirectory, definition.InternalName, definition.AssemblyVersion));
|
var outputDir = new DirectoryInfo(Path.Combine(this.pluginDirectory, definition.InternalName, definition.AssemblyVersion));
|
||||||
var dllFile = new FileInfo(Path.Combine(outputDir.FullName, $"{definition.InternalName}.dll"));
|
var dllFile = new FileInfo(Path.Combine(outputDir.FullName, $"{definition.InternalName}.dll"));
|
||||||
var disabledFile = new FileInfo(Path.Combine(outputDir.FullName, ".disabled"));
|
var disabledFile = new FileInfo(Path.Combine(outputDir.FullName, ".disabled"));
|
||||||
|
var testingFile = new FileInfo(Path.Combine(outputDir.FullName, ".testing"));
|
||||||
var wasDisabled = disabledFile.Exists;
|
var wasDisabled = disabledFile.Exists;
|
||||||
|
|
||||||
if (dllFile.Exists && enableAfterInstall)
|
if (dllFile.Exists && enableAfterInstall)
|
||||||
|
|
@ -118,6 +119,13 @@ namespace Dalamud.Plugin
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (doTestingDownload) {
|
||||||
|
testingFile.Create();
|
||||||
|
} else {
|
||||||
|
if (testingFile.Exists)
|
||||||
|
testingFile.Delete();
|
||||||
|
}
|
||||||
|
|
||||||
return this.dalamud.PluginManager.LoadPluginFromAssembly(dllFile, false, PluginLoadReason.Installer);
|
return this.dalamud.PluginManager.LoadPluginFromAssembly(dllFile, false, PluginLoadReason.Installer);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue