/// <summary> /// Intialise module /// </summary> /// <param name="module"></param> public static void InitialiseMod(Module module) { if (string.IsNullOrEmpty(module.Name)) { Syslog.Log("This module has invalid name and was terminated to prevent troubles", true); throw new Exception("Invalid name"); } module.Date = DateTime.Now; if (Module.Exist(module.Name)) { Syslog.Log("This module is already registered " + module.Name + " this new instance was terminated to prevent troubles", true); throw new Exception("This module is already registered"); } try { lock (module) { Syslog.Log("Loading module: " + module.Name + " v" + module.Version); ExtensionHandler.Extensions.Add(module); } module.Init(); } catch (Exception fail) { module.IsWorking = false; Syslog.Log("Unable to create instance of " + module.Name); Core.HandleException(fail); } }
/// <summary> /// Intialise module /// </summary> /// <param name="module"></param> public static void InitialiseMod(Module module) { if (module.Name == null || module.Name == "") { core.Log("This module has invalid name and was terminated to prevent troubles", true); throw new Exception("Invalid name"); } module.Date = DateTime.Now; if (Module.Exist(module.Name)) { core.Log("This module is already registered " + module.Name + " this new instance was terminated to prevent troubles", true); throw new Exception("This module is already registered"); } try { lock (module) { core.Log("Loading module: " + module.Name + " v" + module.Version); Module.module.Add(module); } if (module.start) { module.Init(); } } catch (Exception fail) { module.working = false; core.Log("Unable to create instance of " + module.Name); core.handleException(fail); } }
public override bool Construct() { m = this; Name = "Feed"; Version = "1.0.12.26"; return true; }
/// <summary> /// Constructor /// </summary> /// <param name="database"></param> /// <param name="channel"></param> public Infobot(string database, Channel channel, Module module, bool sensitive = true) { Sensitive = sensitive; datafile_xml = database + ".xml"; datafile_raw = database; pChannel = channel; Parent = module; prefix = Module.GetConfig(pChannel, "Infobot.Prefix", DefaultPrefix); LoadData(); }
public override bool Construct() { ptrModule = this; Name = "RC"; Version = "1.2.0.5"; return true; }
public override bool Construct() { ptrModule = this; Version = new Version(1, 2, 0, 6); return true; }