Added improved logging through the engine for the server console.

This commit is contained in:
Scionwest_cp 2012-03-08 19:44:18 -08:00
parent 43e93706ab
commit bcd9f46b0a
10 changed files with 115 additions and 27 deletions

View file

@ -6,6 +6,8 @@ using System.IO;
using Microsoft.CSharp;
#endif
using MudEngine.Core;
namespace MudEngine.Scripting
{
/// <summary>
@ -51,14 +53,18 @@ namespace MudEngine.Scripting
//Create an array of script files found within the ScriptRepository matching the ScriptExtension properties.
String[] scripts = Directory.GetFiles(scriptRepository, "*" + this.ScriptExtension, SearchOption.AllDirectories);
//Compile the scripts and provide the Results property with a reference to the compilation results.
Results = provider.CompileAssemblyFromFile(param, scripts);
//if the compiler has errors, return false.
if (Results.Errors.HasErrors)
return false;
if (scripts.Length > 0)
{
//Compile the scripts and provide the Results property with a reference to the compilation results.
Results = provider.CompileAssemblyFromFile(param, scripts);
//if the compiler has errors, return false.
if (Results.Errors.HasErrors)
return false;
else
return true;
}
else
return true;
return false;
}
/// <summary>

View file

@ -7,6 +7,9 @@ using System.Text;
#if WINDOWS_PC
using Microsoft.CSharp;
#endif
using MudEngine.Core;
namespace MudEngine.Scripting
{
/// <summary>
@ -170,7 +173,7 @@ namespace MudEngine.Scripting
this._CompileMessages = new string[] { "Compilation Failed.", "Unable to locate the specified compiler of Type '" + Compiler + "'." };
return false;
}
//Get the compiler parameters.
CompilerParameters param = GetParameters();
@ -407,7 +410,6 @@ namespace MudEngine.Scripting
}
}
return compiler;
}
#endif