public static void InitAll() { all.AddOtherPerms = true; Type[] types = Assembly.GetExecutingAssembly().GetTypes(); for (int i = 0; i < types.Length; i++) { Type type = types[i]; if (!type.IsSubclassOf(typeof(Command)) || type.IsAbstract) { continue; } Command cmd = (Command)Activator.CreateInstance(type); all.Add(cmd); CommandAlias[] aliases = cmd.Aliases; if (aliases == null) { continue; } foreach (CommandAlias alias in aliases) { string target = cmd.name + " " + alias.Args; Alias.coreAliases.Add(new Alias(alias.Trigger, target)); } } core.commands = new List <Command>(all.commands); Scripting.Autoload(); }
/// <summary> Automatically loads all .dll commands specified in the autoload file. </summary> public static void Autoload() { if (!File.Exists(AutoloadFile)) { File.Create(AutoloadFile); return; } string[] list = File.ReadAllLines(AutoloadFile); foreach (string cmdName in list) { if (cmdName == "") { continue; } string error = Scripting.Load("Cmd" + cmdName); if (error != null) { Server.s.Log(error); continue; } Server.s.Log("AUTOLOAD: Loaded Cmd" + cmdName + ".dll"); } }
public static void Autoload() { if (!File.Exists("text/cmdautoloadVB.txt")) { File.Create("text/cmdautoloadVB.txt"); return; } string[] autocmds = File.ReadAllLines("text/cmdautoloadVB.txt"); foreach (string cmd in autocmds) { if (cmd == "") { continue; } string error = Scripting.Load("Cmd" + cmd.ToLower()); if (error != null) { Server.s.Log(error); error = null; continue; } Server.s.Log("AUTOLOAD: Loaded [VB] " + cmd.ToLower() + ".dll"); } }
public static string Load(string command) { return(Scripting.Load(command)); }