chore: remove all MonoMod hooks for now

This commit is contained in:
goat 2023-11-14 20:28:36 +01:00
parent 8a2ba70cc3
commit f8bd6d20ef
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
4 changed files with 22 additions and 19 deletions

View file

@ -74,7 +74,6 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="MinSharp" Version="1.0.4" /> <PackageReference Include="MinSharp" Version="1.0.4" />
<PackageReference Include="MonoModReorg.RuntimeDetour" Version="23.1.2-prerelease.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Serilog" Version="2.11.0" /> <PackageReference Include="Serilog" Version="2.11.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" /> <PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
@ -121,14 +120,6 @@
</ItemGroup> </ItemGroup>
</Target> </Target>
<Target Name="ChangeAliasesOfNugetRefs" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
<ItemGroup>
<ReferencePath Condition="'%(FileName)' == 'MonoMod.Iced'">
<Aliases>monomod</Aliases>
</ReferencePath>
</ItemGroup>
</Target>
<PropertyGroup> <PropertyGroup>
<!-- Needed temporarily for CI --> <!-- Needed temporarily for CI -->
<TempVerFile>$(OutputPath)TEMP_gitver.txt</TempVerFile> <TempVerFile>$(OutputPath)TEMP_gitver.txt</TempVerFile>

View file

@ -23,7 +23,8 @@ internal class TaskTracker : IDisposable, IServiceType
[ServiceManager.ServiceDependency] [ServiceManager.ServiceDependency]
private readonly Framework framework = Service<Framework>.Get(); private readonly Framework framework = Service<Framework>.Get();
private MonoMod.RuntimeDetour.Hook? scheduleAndStartHook; // NET8 CHORE
// private MonoMod.RuntimeDetour.Hook? scheduleAndStartHook;
private bool enabled = false; private bool enabled = false;
[ServiceManager.ServiceConstructor] [ServiceManager.ServiceConstructor]
@ -121,7 +122,8 @@ internal class TaskTracker : IDisposable, IServiceType
/// <inheritdoc/> /// <inheritdoc/>
public void Dispose() public void Dispose()
{ {
this.scheduleAndStartHook?.Dispose(); // NET8 CHORE
// this.scheduleAndStartHook?.Dispose();
this.framework.Update -= this.FrameworkOnUpdate; this.framework.Update -= this.FrameworkOnUpdate;
} }
@ -170,7 +172,8 @@ internal class TaskTracker : IDisposable, IServiceType
return; return;
} }
this.scheduleAndStartHook = new MonoMod.RuntimeDetour.Hook(targetMethod, patchMethod); // NET8 CHORE
// this.scheduleAndStartHook = new MonoMod.RuntimeDetour.Hook(targetMethod, patchMethod);
Log.Information("AddToActiveTasks Hooked!"); Log.Information("AddToActiveTasks Hooked!");
} }

View file

@ -136,7 +136,8 @@ internal partial class PluginManager : IDisposable, IServiceType
this.configuration.PluginTestingOptIns ??= new List<PluginTestingOptIn>(); this.configuration.PluginTestingOptIns ??= new List<PluginTestingOptIn>();
this.ApplyPatches(); // NET8 CHORE
//this.ApplyPatches();
} }
/// <summary> /// <summary>
@ -393,8 +394,9 @@ internal partial class PluginManager : IDisposable, IServiceType
plugin.ExplicitDisposeIgnoreExceptions($"Error disposing {plugin.Name}", Log); plugin.ExplicitDisposeIgnoreExceptions($"Error disposing {plugin.Name}", Log);
} }
this.assemblyLocationMonoHook?.Dispose(); // NET8 CHORE
this.assemblyCodeBaseMonoHook?.Dispose(); // this.assemblyLocationMonoHook?.Dispose();
// this.assemblyCodeBaseMonoHook?.Dispose();
} }
/// <summary> /// <summary>
@ -804,7 +806,8 @@ internal partial class PluginManager : IDisposable, IServiceType
this.installedPluginsList.Remove(plugin); this.installedPluginsList.Remove(plugin);
} }
PluginLocations.Remove(plugin.AssemblyName?.FullName ?? string.Empty, out _); // NET8 CHORE
// PluginLocations.Remove(plugin.AssemblyName?.FullName ?? string.Empty, out _);
this.NotifyinstalledPluginsListChanged(); this.NotifyinstalledPluginsListChanged();
this.NotifyAvailablePluginsChanged(); this.NotifyAvailablePluginsChanged();
@ -1443,7 +1446,8 @@ internal partial class PluginManager : IDisposable, IServiceType
} }
catch (InvalidPluginException) catch (InvalidPluginException)
{ {
PluginLocations.Remove(plugin.AssemblyName?.FullName ?? string.Empty, out _); // NET8 CHORE
// PluginLocations.Remove(plugin.AssemblyName?.FullName ?? string.Empty, out _);
throw; throw;
} }
catch (BannedPluginException) catch (BannedPluginException)
@ -1489,7 +1493,8 @@ internal partial class PluginManager : IDisposable, IServiceType
} }
else else
{ {
PluginLocations.Remove(plugin.AssemblyName?.FullName ?? string.Empty, out _); // NET8 CHORE
// PluginLocations.Remove(plugin.AssemblyName?.FullName ?? string.Empty, out _);
throw; throw;
} }
} }
@ -1580,6 +1585,8 @@ internal partial class PluginManager : IDisposable, IServiceType
} }
} }
// NET8 CHORE
/*
/// <summary> /// <summary>
/// Class responsible for loading and unloading plugins. /// Class responsible for loading and unloading plugins.
/// This contains the assembly patching functionality to resolve assembly locations. /// This contains the assembly patching functionality to resolve assembly locations.
@ -1687,3 +1694,4 @@ internal partial class PluginManager
this.assemblyCodeBaseMonoHook = new MonoMod.RuntimeDetour.Hook(codebaseTarget, codebasePatch); this.assemblyCodeBaseMonoHook = new MonoMod.RuntimeDetour.Hook(codebaseTarget, codebasePatch);
} }
} }
*/

View file

@ -408,7 +408,8 @@ internal class LocalPlugin : IDisposable
} }
// Update the location for the Location and CodeBase patches // Update the location for the Location and CodeBase patches
PluginManager.PluginLocations[this.pluginType.Assembly.FullName] = new PluginPatchData(this.DllFile); // NET8 CHORE
// PluginManager.PluginLocations[this.pluginType.Assembly.FullName] = new PluginPatchData(this.DllFile);
this.DalamudInterface = this.DalamudInterface =
new DalamudPluginInterface(this, reason); new DalamudPluginInterface(this, reason);