Esempio n. 1
0
        public MyScriptCompiler()
        {
            AddReferencedAssemblies(
                this.GetType().Assembly.Location,
                typeof(int).Assembly.Location,
                typeof(System.Xml.XmlEntity).Assembly.Location,
                typeof(System.Collections.Generic.HashSet <>).Assembly.Location,
                typeof(System.Uri).Assembly.Location
                );

            AddImplicitIngameNamespacesFromTypes(
                typeof(System.Object),
                typeof(System.Text.StringBuilder),
                typeof(System.Collections.IEnumerable),
                typeof(System.Collections.Generic.IEnumerable <>)
                );

            AddUnblockableIngameExceptions(typeof(ScriptOutOfRangeException));

            m_debugCompilationOptions   = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel: OptimizationLevel.Debug, platform: Platform.X64);
            m_runtimeCompilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel: OptimizationLevel.Release, platform: Platform.X64);
            m_whitelist = new MyScriptWhitelist(this);
            m_ingameWhitelistDiagnosticAnalyzer = new WhitelistDiagnosticAnalyzer(m_whitelist, MyWhitelistTarget.Ingame);
            m_modApiWhitelistDiagnosticAnalyzer = new WhitelistDiagnosticAnalyzer(m_whitelist, MyWhitelistTarget.ModApi);
            m_conditionalParseOptions           = new CSharpParseOptions();
        }
Esempio n. 2
0
        public MyScriptCompiler()
        {
            AddReferencedAssemblies(
                this.GetType().Assembly.Location,
                typeof(int).Assembly.Location,
                typeof(System.Xml.XmlEntity).Assembly.Location,
                typeof(System.Collections.Generic.HashSet<>).Assembly.Location,
                typeof(System.Uri).Assembly.Location
                );

            AddImplicitIngameNamespacesFromTypes(
                typeof(System.Object),
                typeof(System.Text.StringBuilder),
                typeof(System.Collections.IEnumerable),
                typeof(System.Collections.Generic.IEnumerable<>)
                );

            AddUnblockableIngameExceptions(typeof(ScriptOutOfRangeException));

            m_debugCompilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel: OptimizationLevel.Debug, platform: Platform.X64);
            m_runtimeCompilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, optimizationLevel: OptimizationLevel.Release, platform: Platform.X64);
            m_whitelist = new MyScriptWhitelist(this);
            m_ingameWhitelistDiagnosticAnalyzer = new WhitelistDiagnosticAnalyzer(m_whitelist, MyWhitelistTarget.Ingame);
            m_modApiWhitelistDiagnosticAnalyzer = new WhitelistDiagnosticAnalyzer(m_whitelist, MyWhitelistTarget.ModApi);
            m_conditionalParseOptions = new CSharpParseOptions();
        }
            protected Batch(MyScriptWhitelist whitelist)
            {
                Whitelist = whitelist;
                var compilation = Whitelist.CreateCompilation();

                m_assemblyMap = compilation.References
                                .Select(compilation.GetAssemblyOrModuleSymbol)
                                .OfType <IAssemblySymbol>()
                                .ToDictionary(symbol => symbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat));
            }
Esempio n. 4
0
 public MyWhitelistBatch(MyScriptWhitelist whitelist) : base(whitelist)
 {}
Esempio n. 5
0
 protected Batch(MyScriptWhitelist whitelist)
 {
     Whitelist = whitelist;
     var compilation = Whitelist.CreateCompilation();
     m_assemblyMap = compilation.References
         .Select(compilation.GetAssemblyOrModuleSymbol)
         .OfType<IAssemblySymbol>()
         .ToDictionary(symbol => symbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat));
 }
 public MyWhitelistBatch(MyScriptWhitelist whitelist) : base(whitelist)
 {
 }