Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
MarseyEntry threading
Browse files Browse the repository at this point in the history
  • Loading branch information
misandrie committed Jul 2, 2024
1 parent ba13ab8 commit 8b4f313
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions Marsey/Game/Misc/Doorbreak.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ public static class Doorbreak
/// Invokes MarseyEntry
/// </summary>
/// <param name="entry">MethodInfo of MarseyEntry::Entry()</param>
public static void Enter(MethodInfo? entry)
/// <param name="threading">Call in another thread</param>
public static void Enter(MethodInfo? entry, bool threading = true)
{
if (entry == null) return;

Thread entryThread = new Thread(() =>
{
entry.Invoke(null, new object[] {});
});

entryThread.Start();

if (threading)
new Thread(() => { entry.Invoke(null, []); }).Start();
else
entry.Invoke(null, []);
}
}
}
2 changes: 1 addition & 1 deletion Marsey/Subversion/Subverse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private static void Postfix(object __instance)
MethodInfo? entryMethod = CheckEntry(subverterAssembly);
if (entryMethod != null)
{
Doorbreak.Enter(entryMethod);
Doorbreak.Enter(entryMethod, threading: false);
}
}
}
Expand Down

0 comments on commit 8b4f313

Please sign in to comment.