diff --git a/Assembly/ASMInfo.cs b/Assembly/ASMInfo.cs index 9a6f3b0..a3d43e8 100644 --- a/Assembly/ASMInfo.cs +++ b/Assembly/ASMInfo.cs @@ -6,7 +6,7 @@ using System.Reflection; [assembly: AssemblyCompany("ZNI")] [assembly: AssemblyAlgorithmId(System.Configuration.Assemblies.AssemblyHashAlgorithm.MD5)] [assembly: AssemblyCopyright("© 2020 Tara Piccari")] -[assembly: AssemblyFileVersion("5.2.010")] +[assembly: AssemblyFileVersion("5.2.011")] [assembly: AssemblyDescription("Second Life Bot - BotCore5")] @@ -15,7 +15,7 @@ namespace Bot.Assemble public class ASMInfo { public static string BotName = "ZBotCore"; - public static string BotVer = "5.2.010"; + public static string BotVer = "5.2.011"; public static string GitPassword { get diff --git a/Program.cs b/Program.cs index acbfdfd..df57add 100644 --- a/Program.cs +++ b/Program.cs @@ -291,20 +291,28 @@ namespace Bot PluginActivator PA = new PluginActivator(); Assembly asm = PA.LoadLibrary(fi.FullName); List plugins = PA.Activate(asm); - try + foreach(IProgram prog in plugins) { - - g_ZPrograms.AddRange(plugins); - }catch(Exception e) { } + try + { + Console.WriteLine("Plugin [" + prog.ProgramName + "] found (" + fi.FullName + ") loaded and activated"); + prog.run(client, MH, CommandRegistry.Instance); + g_ZPrograms.Add(prog); + }catch(Exception e) { } + } } } List main = new PluginActivator().Activate(Assembly.GetExecutingAssembly()); - try + foreach (IProgram prog in main) { - - g_ZPrograms.AddRange(main); + try + { + Console.WriteLine("Plugin [" + prog.ProgramName + "] found (" + Assembly.GetExecutingAssembly().FullName + ") loaded and activated"); + prog.run(client, MH, CommandRegistry.Instance); + g_ZPrograms.Add(prog); + } + catch (Exception e) { } } - catch (Exception e) { } CommandRegistry.Instance.LocateCommands(); @@ -407,17 +415,6 @@ namespace Bot try { - foreach (IProgram pluginKvp in g_ZPrograms) - { - IProgram plugin = pluginKvp; - plugin.run(client, MH, registry); // simulate constructor and set up other things - client.Self.IM += plugin.onIMEvent; - - Log.info(true, "Plugin: " + plugin.ProgramName + " activated"); - if (File.Exists(plugin.ProgramName + ".json")) - plugin.LoadConfiguration(); // will throw an error if BlankBot tries to load config - } - Log.info(true, g_ZPrograms.Count.ToString() + " programs linked"); //if (g_ZPrograms.Count > 0) msg(MessageHandler.Destinations.DEST_LOCAL, UUID.Zero, "Default Program [" + conf.MainProgramDLL + "] has been loaded, " + programCount.ToString() + " plugin(s) loaded"); registry.LocateCommands();