fluffy-mods / ModManager

managing mods should be easy
Other
87 stars 32 forks source link

Log spam when used with steam version if game is started outside of steam #23

Closed neitsa closed 5 years ago

neitsa commented 6 years ago

Hi @FluffierThanThou !

First of all, thanks a lot for your mod!

This is similar to #20 but a bit different. I stumbled upon the bug while testing Manifest.XML for my mod. Also, I think this is probably a low-priority bug as I guess not a lot of people will start the steam version outside of steam.

Basically I have the steam version of the game, but I start it outside of steam (running it by clicking the executable rather than though the steam app).

Root level exception in Update(): System.TypeInitializationException: An exception was thrown by the type initializer for ModManager.CrossPromotionManager ---> System.InvalidOperationException: Steamworks is not initialized.
  at Steamworks.InteropHelp.TestIfAvailableClient () [0x00000] in <filename unknown>:0 
  at Steamworks.SteamUtils.GetAppID () [0x00000] in <filename unknown>:0 
  at ModManager.CrossPromotionManager..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
at ModManager.Page_BetterModConfig.WindowUpdate () <0x00047>
at Verse.WindowStack.WindowsUpdate () <0x0005c>
at Verse.UIRoot.UIRootUpdate () <0x00054>
at Verse.UIRoot_Entry.UIRootUpdate () <0x0001c>
at (wrapper dynamic-method) Verse.Root.Update_Patch1 (object) <0x0015b>

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Exception filling window for ModManager.Page_BetterModConfig: System.TypeInitializationException: An exception was thrown by the type initializer for ModManager.CrossPromotionManager ---> System.InvalidOperationException: Steamworks is not initialized.
  at Steamworks.InteropHelp.TestIfAvailableClient () [0x00000] in <filename unknown>:0 
  at Steamworks.SteamUtils.GetAppID () [0x00000] in <filename unknown>:0 
  at ModManager.CrossPromotionManager..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at ModManager.Page_BetterModConfig.WindowUpdate () [0x00000] in <filename unknown>:0 
  at Verse.WindowStack.WindowsUpdate () [0x00000] in <filename unknown>:0 
  at Verse.UIRoot.UIRootUpdate () [0x00000] in <filename unknown>:0 
  at Verse.UIRoot_Entry.UIRootUpdate () [0x00000] in <filename unknown>:0 
  at (wrapper dynamic-method) Verse.Root:Update_Patch1 (object)

Complete output log: output_log.txt

Note: you can reach me on the RimWorld modder discord if you wish.

FluffierThanThou commented 6 years ago

hmm, looks like basically the same issue. I probably missed a call to the steam API somewhere. Should be an easy fix, will look at it tonight

FluffierThanThou commented 6 years ago

note to self; encapsulate https://github.com/FluffierThanThou/ModManager/blob/master/Source/ModManager/CrossPromotion/CrossPromotionManager.cs#L23

and https://github.com/FluffierThanThou/ModManager/blob/master/Source/ModManager/CrossPromotion/CrossPromotionManager.cs#L29

probably should add separate init logic.

neitsa commented 6 years ago

ACK. Thanks a lot for your quick answer!

FluffierThanThou commented 5 years ago

Sorry this took me forever, it kindof dropped of my radar. Should be fixed now.