예제 #1
0
        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);
        }
예제 #2
0
        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);
        }