private static bool CompileProgram(string script, List <string> errors, ref Assembly assembly) { if (script != null && script.Length > 0) { ScriptProvider provider = new ScriptProvider(); StringBuilder program = new StringBuilder(); program.AppendLine(Header); program.AppendLine(script); program.AppendLine(Footer); if (VRage.Compiler.IlCompiler.CompileStringIngame(Path.Combine(VRage.FileSystem.MyFileSystem.UserDataPath, "IngameScript.dll"), new string[] { program.ToString() }, out assembly, errors)) { return(true); } } return(false); }
private static bool CompileProgram(string script, List<string> errors, ref Assembly assembly) { if (script != null && script.Length > 0) { ScriptProvider provider = new ScriptProvider(); StringBuilder program = new StringBuilder(); program.AppendLine(Header); program.AppendLine(script); program.AppendLine(Footer); if (VRage.Compiler.IlCompiler.CompileStringIngame(Path.Combine(VRage.FileSystem.MyFileSystem.UserDataPath, "IngameScript.dll"), new string[] { program.ToString() }, out assembly, errors)) { return true; } } return false; }