public static void InitAddon(WCellAddonContext context) { var mgr = new InitMgr(); InitAddon(context, mgr); mgr.PerformInitialization(); }
public static void InitAddon(WCellAddonContext context) { InitMgr mgr = new InitMgr(); RealmAddonMgr.InitAddon(context, mgr); mgr.AddGlobalMgrsOfAsm(typeof(RealmAddonMgr).Assembly); mgr.PerformInitialization(); }
protected static void InitAddon(WCellAddonContext context, InitMgr mgr) { IWCellAddon addon = context.Addon; mgr.AddStepsOfAsm(context.Assembly); RealmCommandHandler.Instance.AddCmdsOfAsm(context.Assembly); if (addon == null || !(addon is WCellAddonBase)) { return; } ((WCellAddonBase)addon).InitAddon(context); }
protected static void InitAddon(WCellAddonContext context, InitMgr mgr) { var addon = context.Addon; // add all initialization steps of the Assembly mgr.AddStepsOfAsm(context.Assembly); // register all Commands of the Assembly AuthCommandHandler.Instance.AddCmdsOfAsm(context.Assembly); if (addon != null) { // init config if (addon is WCellAddonBase) { ((WCellAddonBase)addon).InitAddon(context); } } }
public override void Process(CmdTrigger <RealmServerCmdArgs> trigger) { string libName = trigger.Text.NextWord(); if (libName.Length == 0) { trigger.Reply("No Path given."); } else { trigger.Reply("Loading addon from " + libName + "..."); WCellAddonContext wcellAddonContext = WCellAddonMgr <RealmAddonMgr> .Instance.TryLoadAddon(libName); if (wcellAddonContext == null) { trigger.Reply("File does not exist or has invalid format: " + libName); } else { trigger.Reply("Done: " + (object)wcellAddonContext); } } }