MudEngine:
- Deleted GameObjects.Characters.Controlled and GameObjects.Characters.NPC namespaces. - Deleted PlayerBasic & PlayerAdmin classes. - BaseCharacter now contains IsAdmin property for providing admin privileges to users. - BaseCharacter now contains IsControlled property for setting user control or AI controlled - Added startup.dat - This will supply information to the engine as to what Types will be used during runtime. Allowing for custom Types via scripts to be instanced and used (such as a custom player class rather than the default one).
This commit is contained in:
parent
1a4655c30e
commit
0587b4a475
10 changed files with 38 additions and 44 deletions
|
@ -9,6 +9,7 @@ using System.IO;
|
|||
using System.Text;
|
||||
using System.Reflection;
|
||||
|
||||
using MudEngine.GameObjects;
|
||||
|
||||
namespace MudEngine.Scripting
|
||||
{
|
||||
|
@ -97,7 +98,11 @@ namespace MudEngine.Scripting
|
|||
Directory.Delete("temp", true);
|
||||
|
||||
Directory.CreateDirectory("temp");
|
||||
string source = "namespace MudScripts\n{\n}";
|
||||
|
||||
//Setup the additional sourcecode that's needed in the script.
|
||||
string[] usingStatements = new string[] { "using System;", "using MudEngine.GameObjects;", "using MudEngine.FileSystem;" };
|
||||
string source = "\nnamespace MudScripts{\n}";
|
||||
|
||||
foreach (string script in scripts)
|
||||
{
|
||||
string tempPath = "temp";
|
||||
|
@ -108,6 +113,9 @@ namespace MudEngine.Scripting
|
|||
StreamReader sr = new StreamReader(fr, System.Text.Encoding.Default);
|
||||
|
||||
string content = sr.ReadToEnd();
|
||||
foreach (string statement in usingStatements)
|
||||
source = source.Insert(0, statement);
|
||||
|
||||
source = source.Insert(source.Length - 1, content);
|
||||
sw.Write(source);
|
||||
sr.Close();
|
||||
|
@ -135,7 +143,7 @@ namespace MudEngine.Scripting
|
|||
results = codeProvider.CompileAssemblyFromFile(param, scripts);
|
||||
|
||||
//Delete the temp folder
|
||||
Directory.Delete("temp", true);
|
||||
//Directory.Delete("temp", true);
|
||||
ScriptPath = oldPath;
|
||||
|
||||
//if we encountered errors we need to log them to our ErrorMessages property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue