diff --git a/MudEngine/Scripting/MudScriptCompiler.cs b/MudEngine/Scripting/MudScriptCompiler.cs index 28001dd..a04d8c2 100644 --- a/MudEngine/Scripting/MudScriptCompiler.cs +++ b/MudEngine/Scripting/MudScriptCompiler.cs @@ -60,10 +60,9 @@ namespace MudEngine.Scripting //Make sure we have a compiler version supplied. if (!CompilerOptions.ContainsKey("CompilerVersion")) CompilerOptions.Add("CompilerVersion", "v4.0"); - //Instance a reference to the C# code provider, this is what will perform the compiling. CSharpCodeProvider provider = new CSharpCodeProvider(CompilerOptions); - + //Create an array of script files found within the ScriptRepository matching the ScriptExtension properties. String[] baseScripts = Directory.GetFiles(scriptRepository, "*" + this.ScriptExtension, SearchOption.AllDirectories); String modifiedScriptsPath = "temp"; @@ -75,6 +74,7 @@ namespace MudEngine.Scripting "using System.Collections.Generic;", "using System.Text;", "using System.Linq;", + "using MudEngine.Commands;", "using MudEngine.GameObjects;", "using MudEngine.GameObjects.Characters;", "using MudEngine.GameObjects.Environment;", @@ -118,7 +118,8 @@ namespace MudEngine.Scripting String[] ConvertedScripts = Directory.GetFiles("temp", "*" + this.ScriptExtension, SearchOption.AllDirectories); //Compile the scripts and provide the Results property with a reference to the compilation results. - Results = provider.CompileAssemblyFromFile(param, baseScripts); + param.GenerateInMemory = false; + Results = provider.CompileAssemblyFromFile(param, ConvertedScripts); System.IO.Directory.Delete(modifiedScriptsPath, true); //if the compiler has errors, return false. diff --git a/MudGame/Scripts/AdminCommands/CommandCreate.cs b/MudGame/Scripts/AdminCommands/CommandCreate.cs index b9dd11e..271590d 100644 --- a/MudGame/Scripts/AdminCommands/CommandCreate.cs +++ b/MudGame/Scripts/AdminCommands/CommandCreate.cs @@ -35,7 +35,7 @@ public class CommandCreate : IGameCommand /// public CommandCreate() { - Help = new List(); + Help = new List(); Help.Add("Provides Admins the ability to create content dynamically within the game world."); Help.Add("Content is created at run-time while the server/game is running and players are connected."); Help.Add("Newly created content will be available for players to use/traverse immediately after creation is completed."); @@ -62,7 +62,7 @@ public class CommandCreate : IGameCommand return; } - //Split the supplied string up. It wil give us an array of strings with the supplied + //Split the supplied String up. It wil give us an array of strings with the supplied //object names if the admin has specified environment objects for creation. String[] env = command.Substring("Create ".Length).Split('>'); diff --git a/MudGame/Scripts/AdminCommands/CommandCreateRoom.cs b/MudGame/Scripts/AdminCommands/CommandCreateRoom.cs index db7fa49..71eedcc 100644 --- a/MudGame/Scripts/AdminCommands/CommandCreateRoom.cs +++ b/MudGame/Scripts/AdminCommands/CommandCreateRoom.cs @@ -30,7 +30,7 @@ class CommandCreateRoom : IGameCommand /// public CommandCreateRoom() { - Help = new List(); + Help = new List(); Help.Add("Creates a Room within the Admin's current Realm>Zone"); } diff --git a/MudGame/Scripts/AdminCommands/CommandLinkRoom.cs b/MudGame/Scripts/AdminCommands/CommandLinkRoom.cs index 3fb5180..b378724 100644 --- a/MudGame/Scripts/AdminCommands/CommandLinkRoom.cs +++ b/MudGame/Scripts/AdminCommands/CommandLinkRoom.cs @@ -31,7 +31,7 @@ public class CommandLinkRoom : IGameCommand public CommandLinkRoom() { //Instance the help collection and add our help information to it. - Help = new List(); + Help = new List(); Help.Add("Use this to link two previously created Rooms together."); //Incase Admins try to use the command, they will know that it's broken. //Don't convert this class into a Script until it is fully completed. @@ -64,7 +64,7 @@ public class CommandLinkRoom : IGameCommand player.Send("2: Exit"); //Read the input from the Admin. - string input = player.ReadInput(); + String input = player.ReadInput(); Int32 value = 0; //Attempt to convert their input from a String into a numerical value. @@ -365,7 +365,7 @@ public class CommandLinkRoom : IGameCommand //to the screen for the user to see and select from. foreach (Int32 v in values) { - //Since enum values are not strings, we can't simply assign a string value to the enum. + //Since enum values are not strings, we can't simply assign a String value to the enum. //The enum needs to be queried to retrieve a value that matches that of 'v' and convert it to a String String displayName = Enum.GetName(typeof(AvailableTravelDirections), v); @@ -381,7 +381,7 @@ public class CommandLinkRoom : IGameCommand //Loop through each value found in our original array or values acquired from the AvailableTravelDirections enum. foreach (Int32 v in values) { - //Since enum values are not strings, we can't simply assign a string value to the enum. + //Since enum values are not strings, we can't simply assign a String value to the enum. //The enum needs to be queried to retrieve a value that matches that of 'v' and convert it to a String String displayName = Enum.GetName(typeof(AvailableTravelDirections), v); diff --git a/MudGame/Scripts/AdminCommands/CommandList.cs b/MudGame/Scripts/AdminCommands/CommandList.cs index 10c62ee..773d2ca 100644 --- a/MudGame/Scripts/AdminCommands/CommandList.cs +++ b/MudGame/Scripts/AdminCommands/CommandList.cs @@ -24,7 +24,7 @@ public class CommandList : IGameCommand public CommandList() { - Help = new List(); + Help = new List(); Help.Add("Using the List command, you can view a generated list of filenames that pertain to a supplied object type."); Help.Add("Usage: List 'ItemType'"); Help.Add("Usage: List 'ItemName>ItemType'"); diff --git a/MudGame/Scripts/AdminCommands/CommandTeleport.cs b/MudGame/Scripts/AdminCommands/CommandTeleport.cs index 6421d31..58eb29e 100644 --- a/MudGame/Scripts/AdminCommands/CommandTeleport.cs +++ b/MudGame/Scripts/AdminCommands/CommandTeleport.cs @@ -24,7 +24,7 @@ public class CommandTeleport : IGameCommand public CommandTeleport() { - Help = new List(); + Help = new List(); Help.Add("The Teleport command will teleport a player to a specified Room, regardless of where they are at."); Help.Add("Usage: Teleport playername FullyQualifiedRoomPath"); Help.Add("Example: Teleport Billy MyRealm>MyZone>MyRoom"); diff --git a/MudGame/Scripts/PlayerCommands/CommandExit.cs b/MudGame/Scripts/PlayerCommands/CommandExit.cs index c4f1b0c..5ffb08c 100644 --- a/MudGame/Scripts/PlayerCommands/CommandExit.cs +++ b/MudGame/Scripts/PlayerCommands/CommandExit.cs @@ -32,7 +32,7 @@ public class CommandExit : IGameCommand //Instance the help collection and add our help information to it. //Typically the Help content is placed within the constructor, but this particular help document //needs to access information from the player, so we will build our Help collection in the Execute command. - Help = new List(); + Help = new List(); Help.Add("Exits the game."); } diff --git a/MudGame/Scripts/PlayerCommands/CommandGetTime.cs b/MudGame/Scripts/PlayerCommands/CommandGetTime.cs index ea9b35d..d2c97ac 100644 --- a/MudGame/Scripts/PlayerCommands/CommandGetTime.cs +++ b/MudGame/Scripts/PlayerCommands/CommandGetTime.cs @@ -29,7 +29,7 @@ public class CommandGetTime : IGameCommand public CommandGetTime() { //Instance the help collection and add our help information to it. - Help = new List(); + Help = new List(); Help.Add("Gives you the current time and date in the game world."); } diff --git a/MudGame/Scripts/PlayerCommands/CommandHelp.cs b/MudGame/Scripts/PlayerCommands/CommandHelp.cs index 67ef6d3..2aa96d7 100644 --- a/MudGame/Scripts/PlayerCommands/CommandHelp.cs +++ b/MudGame/Scripts/PlayerCommands/CommandHelp.cs @@ -42,7 +42,7 @@ public class CommandHelp : IGameCommand { //Check if we have a topic that the player wants help with. If there is nothing after the Help word //in the command, then the user didn't supply us with a topic. - string topic = command.Substring("Help".Length); + String topic = command.Substring("Help".Length); //if the user did not supply us with a topic, we will print every command currently loaded in the engine //and tell the user how they can access help information regarding that command. @@ -70,7 +70,7 @@ public class CommandHelp : IGameCommand else topic = topic.Trim(); - //Get a reference to the command the player wants help with. We must insert the 'Command' string into the topic, + //Get a reference to the command the player wants help with. We must insert the 'Command' String into the topic, //as all Commands start with the word Command, however the player never sees the word Command. It's internal only. IGameCommand gc = CommandEngine.GetCommand("Command" + topic); diff --git a/MudGame/Scripts/PlayerCommands/CommandSay.cs b/MudGame/Scripts/PlayerCommands/CommandSay.cs index 2034259..d6e47ca 100644 --- a/MudGame/Scripts/PlayerCommands/CommandSay.cs +++ b/MudGame/Scripts/PlayerCommands/CommandSay.cs @@ -48,7 +48,7 @@ public class CommandSay : IGameCommand return; //nothing to say, don't say anything at all. } - //Get the message out of the command string. + //Get the message out of the command String. String message = command.Substring("Say ".Length); //Query the game world and find what players are within the same location as the chatting player. diff --git a/MudGame/Scripts/PlayerCommands/CommandWalk.cs b/MudGame/Scripts/PlayerCommands/CommandWalk.cs index 56b8f31..05f304a 100644 --- a/MudGame/Scripts/PlayerCommands/CommandWalk.cs +++ b/MudGame/Scripts/PlayerCommands/CommandWalk.cs @@ -35,7 +35,7 @@ public class CommandWalk : IGameCommand Help.Add("You may use the Look command to see a description of the current Room, and decide where you would like to walk."); Help.Add("Usage: Walk 'Direction' where Direction may equal one of the following:"); - //We will construct a string that contains all of the available travel directions for the player. + //We will construct a String that contains all of the available travel directions for the player. StringBuilder directions = new StringBuilder(); //Store a array of existing values within the AvailableTravelDirection enum. @@ -46,11 +46,11 @@ public class CommandWalk : IGameCommand //to the screen for the user to see and select from. foreach (Int32 v in values) { - //Since enum values are not strings, we can't simply assign a string value to the enum. + //Since enum values are not strings, we can't simply assign a String value to the enum. //The enum needs to be queried to retrieve a value that matches that of 'v' and convert it to a String String displayName = Enum.GetName(typeof(AvailableTravelDirections), v); - //Add the current travel direction to our string for later use. + //Add the current travel direction to our String for later use. directions.Append(displayName + ", "); }