-
Notifications
You must be signed in to change notification settings - Fork 22
Conversation
NeosModLoader/NeosVersionReset.cs
Outdated
if (Logger.IsDebugEnabled()) | ||
{ | ||
string actualPlugins = plugins.Keys.Join(delimiter: ", "); | ||
Logger.DebugInternal($"Found {plugins.Count} actual plugins: {actualPlugins}"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huumh, didn't we have debug methods just take in a closure that returns the debug string, and only gets called if the debug level is enabled...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually... that's a good idea. Silly me for not seeing it.
@@ -527,7 +527,7 @@ internal void Save(bool saveDefaultValues = false, bool immediate = false) | |||
{ | |||
|
|||
Thread thread = Thread.CurrentThread; | |||
NeosMod? callee = Util.ExecutingMod(); | |||
NeosMod? callee = Util.ExecutingMod(new(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new(1)
is a stack trace? 0.o .NET syntax is weird, I assume this has just omitted the StackTrace
part and it's implied...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the compiler knows a StackTrace is the only type that can go there, so we can omit the explicit type in the constructor call. This is equivalent to new StackTrace(1)
.
# Conflicts: # NeosModLoader/Util.cs
This does the following:
AppDomain.GetAssemblies()
. It turns out that .NET calls this a lot internally, and my logic that was supposed to be intercepting FrooxEngine calls was also messing with internal .NET calls not initiated by FrooxEngine. I've implemented a smarter stack frame search to solve this.