Scriptloading overhaul (#163)

* - Added option to RunConfig.cs for mods to compile with non-publicized assemblies.
- Added default values attrib to RunConfig.cs
- Added thread sleeping to CsPackageManager.Dispose() to give time before generating a strong-ref to check acl unload status.

* - Added PrintWarning to ModUtils.cs
- Made previously unloaded ACLs warning only.
- Made plugins unload after lua script disposal.
- Small code cleanups.
- Cleared acl record references on unloading.
- Made ACL unload run via event hook.

* Made non-pub asm compilation name the same long-a** name in XML, as per Evil's request.
This commit is contained in:
MapleWheels
2023-10-24 17:51:48 -04:00
committed by GitHub
parent e984633ca5
commit 9e48dda739
7 changed files with 80 additions and 32 deletions
@@ -281,8 +281,6 @@ namespace Barotrauma
{
UserData.UnregisterType(type, true);
}
PluginPackageManager.UnloadPlugins(); // stop plugin code execution
if (Lua?.Globals is not null)
{
@@ -309,6 +307,9 @@ namespace Barotrauma
// we can only unload assemblies after clearing ModStore/references.
PluginPackageManager.Dispose();
#pragma warning disable CS0618
ACsMod.LoadedMods.Clear();
#pragma warning restore CS0618
Game = new LuaGame();
Networking = new LuaCsNetworking();