Jump to content

[1.11.x] MADLAD - Mod Assembly Dll Loading Anomaly Detector 2.2.1.2 (01/03/2021)


severedsolo

Recommended Posts

Requested by @Tonka Crash here:

What does it do?

hWk5Wca.png

A simple mod that will parse your KSP.log and notify you at the Main Menu if any Assemblies (plugins) have failed to load, if there are any, then it will give you a notification, as above.

Important Note: MADLAD does not know, or care, WHY a dll failed to load. Usually your choices are a) you didn't install all the dependencies, or b) the mod is not compatible with your KSP version.

Attention: From KSP 1.8 / MADLAD 2.0 onwards, the way MADLAD handles mods who's dependencies aren't met has changed. See this post for more information:

 

It also won't point out which mod a DLL is from. If the DLL has a strange name (accord.dll from Kerbal Wind Tunnel comes to mind) - you'll need to do some more digging.

Adding mods to the whitelist

Spoiler

MADLAD now supports a whitelist for cases where it is expected that an assembly will fail to load and this is ok.

Add a MM patch to your mod as follows:



@MADLAD_WHITELIST //there can only be one so target with @
{
	MOD //each assembly should have it's own MOD node
	{
		ModName = CC_RemoteTech //the name of the assembly you are expecting to fail
		DependencyPath = RemoteTech/Plugins/RemoteTech.dll //the path to the dependency (relative to GameData if it WAS installed.)
		//If the file is not found, we assume the user didn't install it deliberately and the error is suppressed.
	}
}

 

License: MIT

Download Here

Source

Edited by severedsolo
Link to comment
Share on other sites

3 minutes ago, Tonka Crash said:

@severedsolo Now the trick is to get people to use it. This is one of the reasons I'd hinted that it would be a good option for inclusion in a mod like KSP-AVC/miniAVC that almost everyone has. 

*shrug* it's an open license, if people want to include it they can. I don't expect it will ever need any maintenance either.

With this, I've actually managed to write a KSP mod that doesn't interface with KSP in any way at all. Other than making KSP load it.

Edited by severedsolo
Link to comment
Share on other sites

3 minutes ago, DStaal said:

I'll be using it.

One question: Is there a way to let the player copy-paste out of it?  It'd make reporting issues easier.

No, but quite frankly, you should be providing your entire log when reporting issues. There is useful information around the error that it prints. This is literally just to alert you that there is a problem, and refer to the log for more details.

Link to comment
Share on other sites

Fair enough.  Mostly I wanted to be able to grab it and store it so I could sort it out later - not report that text itself, but be able to refer to it better, especially if there are multiple mods involved.

Link to comment
Share on other sites

Thank you! I'll use.

Feature request:

have MADLAD create a .log (fresh every run) file in \Logs\MODLAD\ like MM does?
would be a stretch goal of having either a command line switch (like MM does) or setting to turn that feature on/off.

This log would parse KSP.log for all WRN/ERR etc and store in its own with related messages.

 

Link to comment
Share on other sites

15 hours ago, zer0Kerbal said:

Thank you! I'll use.

Feature request:

have MADLAD create a .log (fresh every run) file in \Logs\MODLAD\ like MM does?
would be a stretch goal of having either a command line switch (like MM does) or setting to turn that feature on/off.

This log would parse KSP.log for all WRN/ERR etc and store in its own with related messages.

 

 

18 hours ago, DStaal said:

I'll be using it.

One question: Is there a way to let the player copy-paste out of it?  It'd make reporting issues easier.

I'll roll these together, and have it output its log to the folder so that it can be copy pasted if needed

Link to comment
Share on other sites

4 hours ago, severedsolo said:

I'll roll these together, and have it output its log to the folder so that it can be copy pasted if needed

I assume it will include timestamps? Makes it much easier to match up with the KSP.log vOv

 

Link to comment
Share on other sites

  • 1 month later...
On 6/17/2019 at 2:51 PM, Stone Blue said:

I assume it will include timestamps? Makes it much easier to match up with the KSP.log vOv

 

Indeed.

MADLAD 1.1 Released

  • Errors will now be logged to GameData/MADLAD/Logs/log.txt as well as popping up in game.
  • Fixed a bunch of issues with the version file
Edited by severedsolo
Link to comment
Share on other sites

  • 2 months later...
19 hours ago, Azzinoth said:

Could you make this mod avaiable in CKAN?

Sure, I meant to I guess it just slipped my mind. Will get that done soon.

MADLAD 2.0 Released

  • Recompile against KSP 1.8 / .Net Framework 4.5
  • Due to changes in the way KSP/Unity handle dependencies with 1.8 mod may warn of loading exceptions in scenes other than the Main Menu. See forum post for more details.

Note the major version number change. This is absolutely 100% not compatible with KSP versions earlier than 1.8

Changes to the way MADLAD detects problems with Mods that have dependencies.

In previous versions of KSP, MADLAD only had to check for exceptions on the Main Menu because if a mods dependencies weren't met, that mod would just refuse to load and we'd know about it straight away.

This has changed in KSP 1.8. Now KSP will happily load a dll and won't actually cause an issue / throw an exception until that dll actually tries to access one of it's dependencies.

So going forward, MADLAD will now scan entries as they appear in your log, and if it detects a "Could not load file or assembly" error, it will log it and pop up to warn you. Mods that fail to load straight away (before the Main Menu) will be handled in the usual way.

Link to comment
Share on other sites

 

10 hours ago, zer0Kerbal said:

possible bug concerning log.txt creation. issue reported on github.

and using it on 1.7.3 without any (noticeable) issue(s).

MADLAD 2.0.1 Released

  • Handle cases where the Logs Directory doesn't exist before attempting to write to it.
Link to comment
Share on other sites

  • 2 weeks later...

MADLAD 2.1 released

  • Now alerts users if mods are installed to the wrong locations (if specified in the version file) - thanks to @linuxgurugamer see: here for more information and documentation

Still doesn't handle KSPAssemblyDependency that's coming next - my computer went south this weekend so didn't get time to implement it.

1.7.3 backport is coming but, see above.

Edited by severedsolo
Link to comment
Share on other sites

10 hours ago, linuxgurugamer said:

Any chance it was a windows update?

Only if it was more broken than I thought! I use Linux Mint.

Nah this was just 2 years of detritus and bad package management (on my part) building up until the system became an unstable mess, so I had to reinstall.

Link to comment
Share on other sites

@severedsolo I think I want to make a small change to the InstallValidator code.  It won't invalidate anything that already uses it, I just want to add the ability to check to see if a directory exists without having to specify a file in it.  I'll get this done and do a PR this evening

Link to comment
Share on other sites

This keeps doing a popup but I don't know which mod is triggering it. Must have missed something when going through them:

 

Spoiler

[ERR 19:25:06.827] AssemblyLoader: Exception loading 'MultiAnimators': System.Reflection.ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
[2019-11-18 21:54:26]: 002_MultiAnimators, Version=1.1.0.2, Culture=neutral, PublicKeyToken=null
Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
  at (wrapper managed-to-native) System.Reflection.Assembly.GetTypes(System.Reflection.Assembly,bool)
  at System.Reflection.Assembly.GetTypes () [0x00000] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at KerboKatz.Utilities.LoopTroughAssemblies (System.Action`1[T] CheckType) [0x0001c] in <a9fd0328e42c42c683680f8ee94d4e7e>:0 
System.RuntimeType
Could not load file or assembly 'DMModuleScienceAnimateGeneric, Version=0.21.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
  at KerboKatz.ASS.AutomatedScienceSampler.CheckTypeForScienceActivator (System.Type type) [0x00060] in <5a8cf6fa51b341e5a2b9633bfcfe406f>:0 
  at KerboKatz.Utilities.LoopTroughAssemblies (System.Action`1[T] CheckType) [0x00030] in <a9fd0328e42c42c683680f8ee94d4e7e>:0 
System.RuntimeType
Could not load file or assembly 'StationScience, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
  at KerboKatz.ASS.AutomatedScienceSampler.CheckTypeForScienceActivator (System.Type type) [0x00060] in <5a8cf6fa51b341e5a2b9633bfcfe406f>:0 
  at KerboKatz.Utilities.LoopTroughAssemblies (System.Action`1[T] CheckType) [0x00030] in <a9fd0328e42c42c683680f8ee94d4e7e>:0 

[2019-11-18 21:56:40]: 002_MultiAnimators, Version=1.1.0.2, Culture=neutral, PublicKeyToken=null
Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
  at (wrapper managed-to-native) System.Reflection.Assembly.GetTypes(System.Reflection.Assembly,bool)
  at System.Reflection.Assembly.GetTypes () [0x00000] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at KerboKatz.Utilities.LoopTroughAssemblies (System.Action`1[T] CheckType) [0x0001c] in <a9fd0328e42c42c683680f8ee94d4e7e>:0 
System.RuntimeType
Could not load file or assembly 'DMModuleScienceAnimateGeneric, Version=0.21.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
  at KerboKatz.ASS.AutomatedScienceSampler.CheckTypeForScienceActivator (System.Type type) [0x00060] in <5a8cf6fa51b341e5a2b9633bfcfe406f>:0 
  at KerboKatz.Utilities.LoopTroughAssemblies (System.Action`1[T] CheckType) [0x00030] in <a9fd0328e42c42c683680f8ee94d4e7e>:0 
System.RuntimeType
Could not load file or assembly 'StationScience, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
  at KerboKatz.ASS.AutomatedScienceSampler.CheckTypeForScienceActivator (System.Type type) [0x00060] in <5a8cf6fa51b341e5a2b9633bfcfe406f>:0 
  at KerboKatz.Utilities.LoopTroughAssemblies (System.Action`1[T] CheckType) [0x00030] in <a9fd0328e42c42c683680f8ee94d4e7e>:0 

[2019-11-18 23:14:20]: 002_MultiAnimators, Version=1.1.0.2, Culture=neutral, PublicKeyToken=null
Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
  at (wrapper managed-to-native) System.Reflection.Assembly.GetTypes(System.Reflection.Assembly,bool)
  at System.Reflection.Assembly.GetTypes () [0x00000] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at KerboKatz.Utilities.LoopTroughAssemblies (System.Action`1[T] CheckType) [0x0001c] in <a9fd0328e42c42c683680f8ee94d4e7e>:0 
System.RuntimeType
Could not load file or assembly 'DMModuleScienceAnimateGeneric, Version=0.21.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
  at KerboKatz.ASS.AutomatedScienceSampler.CheckTypeForScienceActivator (System.Type type) [0x00060] in <5a8cf6fa51b341e5a2b9633bfcfe406f>:0 
  at KerboKatz.Utilities.LoopTroughAssemblies (System.Action`1[T] CheckType) [0x00030] in <a9fd0328e42c42c683680f8ee94d4e7e>:0 
System.RuntimeType
Could not load file or assembly 'StationScience, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
  at KerboKatz.ASS.AutomatedScienceSampler.CheckTypeForScienceActivator (System.Type type) [0x00060] in <5a8cf6fa51b341e5a2b9633bfcfe406f>:0 
  at KerboKatz.Utilities.LoopTroughAssemblies (System.Action`1[T] CheckType) [0x00030] in <a9fd0328e42c42c683680f8ee94d4e7e>:0 

[2019-11-18 23:17:44]: 002_MultiAnimators, Version=1.1.0.2, Culture=neutral, PublicKeyToken=null
Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
  at (wrapper managed-to-native) System.Reflection.Assembly.GetTypes(System.Reflection.Assembly,bool)
  at System.Reflection.Assembly.GetTypes () [0x00000] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at KerboKatz.Utilities.LoopTroughAssemblies (System.Action`1[T] CheckType) [0x0001c] in <a9fd0328e42c42c683680f8ee94d4e7e>:0 
System.RuntimeType
Could not load file or assembly 'DMModuleScienceAnimateGeneric, Version=0.21.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
  at KerboKatz.ASS.AutomatedScienceSampler.CheckTypeForScienceActivator (System.Type type) [0x00060] in <5a8cf6fa51b341e5a2b9633bfcfe406f>:0 
  at KerboKatz.Utilities.LoopTroughAssemblies (System.Action`1[T] CheckType) [0x00030] in <a9fd0328e42c42c683680f8ee94d4e7e>:0 
System.RuntimeType
Could not load file or assembly 'StationScience, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
  at KerboKatz.ASS.AutomatedScienceSampler.CheckTypeForScienceActivator (System.Type type) [0x00060] in <5a8cf6fa51b341e5a2b9633bfcfe406f>:0 
  at KerboKatz.Utilities.LoopTroughAssemblies (System.Action`1[T] CheckType) [0x00030] in <a9fd0328e42c42c683680f8ee94d4e7e>:0 

 

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...