From 27ad37a7c996d76b08d4fbfd931da8a9f80f488c Mon Sep 17 00:00:00 2001 From: asayre Date: Mon, 19 Jun 2006 05:51:44 +0000 Subject: [PATCH] -HaltOnWarning added --- Server/Main.cs | 8 ++++++++ Server/ScriptCompiler.cs | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/Server/Main.cs b/Server/Main.cs index ba12db72d..8b0603f03 100644 --- a/Server/Main.cs +++ b/Server/Main.cs @@ -50,6 +50,7 @@ namespace Server private static bool m_Service; private static bool m_Debug; private static bool m_Cache = true; + private static bool m_HaltOnWarning; private static MultiTextWriter m_MultiConOut; private static bool m_Profiling; @@ -96,6 +97,7 @@ namespace Server public static bool Service { get { return m_Service; } } public static bool Debug { get { return m_Debug; } } + internal static bool HaltOnWarning { get { return m_HaltOnWarning; } } public static List DataDirectories { get { return m_DataDirectories; } } public static Assembly Assembly { get { return m_Assembly; } set { m_Assembly = value; } } public static Process Process { get { return m_Process; } } @@ -343,6 +345,9 @@ namespace Server Profiling = true; else if( Insensitive.Equals( args[i], "-nocache" ) ) m_Cache = false; + else if( Insensitive.Equals( args[i], "-haltonwarning" ) ) + m_HaltOnWarning = true; + } try @@ -484,6 +489,9 @@ namespace Server if( !m_Cache ) Utility.Seperate( sb, "-nocache", " " ); + if( m_HaltOnWarning ) + Utility.Seperate( sb, "-haltonwarning", " " ); + return sb.ToString(); } } diff --git a/Server/ScriptCompiler.cs b/Server/ScriptCompiler.cs index 10e280491..d44929f90 100644 --- a/Server/ScriptCompiler.cs +++ b/Server/ScriptCompiler.cs @@ -218,6 +218,9 @@ namespace Server if( defines != null ) parms.CompilerOptions = string.Format( "/D:{0}", defines ); + if( Core.HaltOnWarning ) + parms.WarningLevel = 4; + CompilerResults results = provider.CompileAssemblyFromFile( parms, files ); m_AdditionalReferences.Add( path ); @@ -338,6 +341,9 @@ namespace Server if( defines != null ) parms.CompilerOptions = String.Format( "/D:{0}", defines ); + if( Core.HaltOnWarning ) + parms.WarningLevel = 4; + CompilerResults results = provider.CompileAssemblyFromFile( parms, files ); m_AdditionalReferences.Add( path );