mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-01 05:13:40 +01:00
feat: delay main thread continuation until GameFixes are applied
This is a temporary workaround until we have infrastructure to intercept winapi in C++
This commit is contained in:
parent
28102b405b
commit
d2335274ee
8 changed files with 67 additions and 18 deletions
|
|
@ -49,6 +49,7 @@ namespace Dalamud
|
|||
|
||||
private readonly ManualResetEvent unloadSignal;
|
||||
private readonly ManualResetEvent finishUnloadSignal;
|
||||
private readonly IntPtr mainThreadContinueEvent;
|
||||
private MonoMod.RuntimeDetour.Hook processMonoHook;
|
||||
private bool hasDisposedPlugins = false;
|
||||
|
||||
|
|
@ -61,7 +62,8 @@ namespace Dalamud
|
|||
/// <param name="loggingLevelSwitch">LoggingLevelSwitch to control Serilog level.</param>
|
||||
/// <param name="finishSignal">Signal signalling shutdown.</param>
|
||||
/// <param name="configuration">The Dalamud configuration.</param>
|
||||
public Dalamud(DalamudStartInfo info, LoggingLevelSwitch loggingLevelSwitch, ManualResetEvent finishSignal, DalamudConfiguration configuration)
|
||||
/// <param name="mainThreadContinueEvent">Event used to signal the main thread to continue.</param>
|
||||
public Dalamud(DalamudStartInfo info, LoggingLevelSwitch loggingLevelSwitch, ManualResetEvent finishSignal, DalamudConfiguration configuration, IntPtr mainThreadContinueEvent)
|
||||
{
|
||||
this.ApplyProcessPatch();
|
||||
|
||||
|
|
@ -76,6 +78,8 @@ namespace Dalamud
|
|||
|
||||
this.finishUnloadSignal = finishSignal;
|
||||
this.finishUnloadSignal.Reset();
|
||||
|
||||
this.mainThreadContinueEvent = mainThreadContinueEvent;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -107,6 +111,13 @@ namespace Dalamud
|
|||
var gameFixes = Service<GameFixes>.Set();
|
||||
gameFixes.Apply();
|
||||
|
||||
Log.Information("[T1] GameFixes OK!");
|
||||
|
||||
// Signal the main game thread to continue
|
||||
NativeFunctions.SetEvent(this.mainThreadContinueEvent);
|
||||
|
||||
Log.Information("[T1] Game thread continued!");
|
||||
|
||||
// Initialize FFXIVClientStructs function resolver
|
||||
FFXIVClientStructs.Resolver.Initialize();
|
||||
Log.Information("[T1] FFXIVClientStructs initialized!");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue