static void CreatePlugin(Player p, string name, string language) { ICompiler engine = CompilerOperations.GetCompiler(p, language); if (engine == null) { return; } string path = engine.PluginPath(name); p.Message("Creating a plugin example source"); string creator = p.IsSuper ? Server.Config.Name : p.truename; string source = engine.GenExamplePlugin(name, creator); File.WriteAllText(path, source); }
Assembly CompileCommands(string path) { ICompiler compiler = GetCompiler(path); if (compiler == null) { Popup.Warning("Unsupported file '" + path + "'"); return(null); } ConsoleHelpPlayer p = new ConsoleHelpPlayer(); CompilerResults result = CompilerOperations.Compile(p, compiler, "Command", new[] { path }, null); if (result != null) { return(result.CompiledAssembly); } Popup.Error(Colors.StripUsed(p.Messages)); return(null); }