chore: cleanup warnings, always load banned dev plugins

This commit is contained in:
goat 2023-01-23 23:53:18 +01:00
parent 9a32da7db8
commit d81f218155
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
4 changed files with 24 additions and 23 deletions

View file

@ -260,7 +260,6 @@ namespace Dalamud.Injector
for (var i = 2; i < args.Count; i++) for (var i = 2; i < args.Count; i++)
{ {
Log.Information(args[i]);
if (args[i].StartsWith(key = "--dalamud-working-directory=")) if (args[i].StartsWith(key = "--dalamud-working-directory="))
workingDirectory = args[i][key.Length..]; workingDirectory = args[i][key.Length..];
else if (args[i].StartsWith(key = "--dalamud-configuration-path=")) else if (args[i].StartsWith(key = "--dalamud-configuration-path="))

View file

@ -395,26 +395,6 @@ public class SigScanner : IDisposable, IServiceType
} }
} }
private unsafe class UnsafeCodeReader : CodeReader
{
private readonly int length;
private readonly byte* address;
private int pos;
public UnsafeCodeReader(byte* address, int length)
{
this.length = length;
this.address = address;
}
public bool CanReadByte => this.pos < this.length;
public override int ReadByte()
{
if (this.pos >= this.length) return -1;
return *(this.address + this.pos++);
}
}
/// <summary> /// <summary>
/// Helper for ScanText to get the correct address for IDA sigs that mark the first JMP or CALL location. /// Helper for ScanText to get the correct address for IDA sigs that mark the first JMP or CALL location.
/// </summary> /// </summary>
@ -578,4 +558,25 @@ public class SigScanner : IDisposable, IServiceType
Log.Error(ex, "Couldn't load cached sigs"); Log.Error(ex, "Couldn't load cached sigs");
} }
} }
private unsafe class UnsafeCodeReader : CodeReader
{
private readonly int length;
private readonly byte* address;
private int pos;
public UnsafeCodeReader(byte* address, int length)
{
this.length = length;
this.address = address;
}
public bool CanReadByte => this.pos < this.length;
public override int ReadByte()
{
if (this.pos >= this.length) return -1;
return *(this.address + this.pos++);
}
}
} }

View file

@ -55,5 +55,6 @@ public class SettingsTabExperimental : SettingsTab
base.Draw(); base.Draw();
ImGuiHelpers.SafeTextColoredWrapped(ImGuiColors.DalamudGrey, "Total memory used by Dalamud & Plugins: " + Util.FormatBytes(GC.GetTotalMemory(false))); ImGuiHelpers.SafeTextColoredWrapped(ImGuiColors.DalamudGrey, "Total memory used by Dalamud & Plugins: " + Util.FormatBytes(GC.GetTotalMemory(false)));
ImGuiHelpers.ScaledDummy(15);
} }
} }

View file

@ -147,7 +147,7 @@ internal class LocalPlugin : IDisposable
} }
var pluginManager = Service<PluginManager>.Get(); var pluginManager = Service<PluginManager>.Get();
this.IsBanned = pluginManager.IsManifestBanned(this.Manifest); this.IsBanned = pluginManager.IsManifestBanned(this.Manifest) && !this.IsDev;
this.BanReason = pluginManager.GetBanReason(this.Manifest); this.BanReason = pluginManager.GetBanReason(this.Manifest);
this.SaveManifest(); this.SaveManifest();
@ -320,7 +320,7 @@ internal class LocalPlugin : IDisposable
throw new ArgumentOutOfRangeException(this.State.ToString()); throw new ArgumentOutOfRangeException(this.State.ToString());
} }
if (pluginManager.IsManifestBanned(this.Manifest)) if (pluginManager.IsManifestBanned(this.Manifest) && !this.IsDev)
throw new BannedPluginException($"Unable to load {this.Name}, banned"); throw new BannedPluginException($"Unable to load {this.Name}, banned");
if (this.Manifest.ApplicableVersion < startInfo.GameVersion) if (this.Manifest.ApplicableVersion < startInfo.GameVersion)