egocarib / Vintage-Story-Mods

GNU General Public License v2.0
1 stars 3 forks source link

Dependency on VSEssentials.dll breaks when using --addModPath #1

Closed JyeGuru closed 3 years ago

JyeGuru commented 3 years ago

When launching a server using --addModPath to store mods somewhere other than the server's actual mod folder, this mod fails to load:

6.7.2021 00:44:48 [Error] [egocaribautomapmarkers] An exception was thrown when trying to start the mod:
System.IO.FileNotFoundException: Could not load file or assembly 'VSEssentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'VSEssentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
   at egocarib_AutoMapMarkers.MapMarkerMod.Start(ICoreAPI api)
   at Vintagestory.Common.ModLoader.TryStartSystem(Mod mod, ModSystem system, ICoreAPI api, ModEventPhase phase)

Workaround is to copy VSEssentials.dll into the same additional mod path folder alongside the mod zip, however this also generates a warning because the game attempts to load Essentials twice.

Reproduction steps:

Why/Use Case: I host multiple instances of VS on the server I run for friends with different sets of mods. Using --addModPath along with --dataPath I can use the single install of the game to do this and store separate configs.

egocarib commented 3 years ago

@JyeGuru Thanks for the notes!

This should hopefully be fixed in the next version that I'm working on - the mod is now compiled into a .dll with assets, so I believe that should fix the reference error. In general I've made a number of other improvements to ensure the mod can work better on a multiplayer server (and I've been testing it out myself with a local server). I'll try this scenario out too before I release the next version.

egocarib commented 3 years ago

Should be fixed now in the latest version - I tested it on my local server without issues.