public static void Initialize(InitMgr mgr) { if (RealmAddonMgr.inited) { return; } RealmAddonMgr.inited = true; WCellAddonMgr.LoadAddons(RealmServerConfiguration.BinaryRoot + RealmAddonMgr.AddonDir, RealmAddonMgr.IgnoredAddonFiles); if (WCellAddonMgr.Contexts.Count > 0) { RealmAddonMgr.log.Info("Found {0} Addon(s):", WCellAddonMgr.Contexts.Count); foreach (WCellAddonContext context in (IEnumerable <WCellAddonContext>)WCellAddonMgr.Contexts) { RealmAddonMgr.log.Info(" Loaded: " + (context.Addon != null ? context.Addon.GetDefaultDescription() : context.Assembly.GetName().Name)); RealmAddonMgr.InitAddon(context, mgr); } } else { RealmAddonMgr.log.Info("No addons found."); } }
public static IConfiguration GetConfig(IConfiguration deflt, ITriggerer trigger) { IConfiguration configuration; if (trigger.Text.NextModifiers() == "a") { string shortName = trigger.Text.NextWord(); IWCellAddon addon = WCellAddonMgr.GetAddon(shortName); if (addon == null) { trigger.Reply("Did not find any Addon matching: " + shortName); return((IConfiguration)null); } configuration = addon.Config; if (configuration == null) { trigger.Reply("Addon does not have a Configuration: " + (object)addon); return((IConfiguration)null); } } else { configuration = deflt; } return(configuration); }
public static IConfiguration GetConfig(IConfiguration deflt, ITriggerer trigger) { IConfiguration cfg; if (trigger.Text.NextModifiers() == "a") { var shortName = trigger.Text.NextWord(); var addon = WCellAddonMgr.GetAddon(shortName); if (addon == null) { trigger.Reply("Did not find any Addon matching: " + shortName); return(null); } cfg = addon.Config; if (cfg == null) { trigger.Reply("Addon does not have a Configuration: " + addon); return(null); } } else { cfg = deflt; } return(cfg); }