diff --git a/MUDCompiler/bin/Debug/Scripts/Player.mud b/MUDCompiler/bin/Debug/Scripts/Player.mud
index af7ce04..3d8799b 100644
--- a/MUDCompiler/bin/Debug/Scripts/Player.mud
+++ b/MUDCompiler/bin/Debug/Scripts/Player.mud
@@ -1,6 +1,9 @@
-public class Player : MudEngine.GameObjects.Characters.Controlled.PlayerBasic
+public class Player : BaseCharacter
{
- public Player()
+ public Game _Game;
+
+ public Player(Game game) : base(game)
{
+ _Game = game;
}
}
\ No newline at end of file
diff --git a/MudDesigner.sln b/MudDesigner.sln
index 2ee3e10..1dd1f88 100644
--- a/MudDesigner.sln
+++ b/MudDesigner.sln
@@ -3,10 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C# Express 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MudEngine", "MudEngine\MudEngine.csproj", "{498943A8-DF5A-4DB0-B506-0BFF44788657}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MUDGame", "MUDGame\MUDGame.csproj", "{048E755C-DD05-47EC-930E-F45146B66F7C}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MudOfflineExample", "MudOfflineExample\MudOfflineExample.csproj", "{048E755C-DD05-47EC-930E-F45146B66F7C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MUDCompiler", "MUDCompiler\MUDCompiler.csproj", "{98E974DA-C650-4B88-B2F8-57AC7AE6C34F}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MudServer", "MudServer\MudServer.csproj", "{5BA65833-A99D-486C-8E74-C11A0713D44A}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -47,6 +49,16 @@ Global
{98E974DA-C650-4B88-B2F8-57AC7AE6C34F}.Release|Mixed Platforms.Build.0 = Release|x86
{98E974DA-C650-4B88-B2F8-57AC7AE6C34F}.Release|x86.ActiveCfg = Release|x86
{98E974DA-C650-4B88-B2F8-57AC7AE6C34F}.Release|x86.Build.0 = Release|x86
+ {5BA65833-A99D-486C-8E74-C11A0713D44A}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {5BA65833-A99D-486C-8E74-C11A0713D44A}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {5BA65833-A99D-486C-8E74-C11A0713D44A}.Debug|Mixed Platforms.Build.0 = Debug|x86
+ {5BA65833-A99D-486C-8E74-C11A0713D44A}.Debug|x86.ActiveCfg = Debug|x86
+ {5BA65833-A99D-486C-8E74-C11A0713D44A}.Debug|x86.Build.0 = Debug|x86
+ {5BA65833-A99D-486C-8E74-C11A0713D44A}.Release|Any CPU.ActiveCfg = Release|x86
+ {5BA65833-A99D-486C-8E74-C11A0713D44A}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {5BA65833-A99D-486C-8E74-C11A0713D44A}.Release|Mixed Platforms.Build.0 = Release|x86
+ {5BA65833-A99D-486C-8E74-C11A0713D44A}.Release|x86.ActiveCfg = Release|x86
+ {5BA65833-A99D-486C-8E74-C11A0713D44A}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/MudEngine/FileSystem/FileManager.cs b/MudEngine/FileSystem/FileManager.cs
index 152e784..de7ab6b 100644
--- a/MudEngine/FileSystem/FileManager.cs
+++ b/MudEngine/FileSystem/FileManager.cs
@@ -64,12 +64,11 @@ namespace MudEngine.FileSystem
string assemblyPath = System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName;
string assemblyName = System.IO.Path.GetFileName(assemblyPath);
string installBase = assemblyPath.Substring(0, assemblyPath.Length - assemblyName.Length);
- string rootPath = System.IO.Path.Combine(installBase, "Project");
if (DataType == SaveDataTypes.Root)
- return rootPath;
+ return installBase;
else
- return System.IO.Path.Combine(rootPath, DataType.ToString());
+ return System.IO.Path.Combine(installBase, DataType.ToString());
}
public static string GetDataPath(string Realm, string Zone)
@@ -77,11 +76,10 @@ namespace MudEngine.FileSystem
string assemblyPath = System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName;
string assemblyName = System.IO.Path.GetFileName(assemblyPath);
string installBase = assemblyPath.Substring(0, assemblyPath.Length - assemblyName.Length);
- string rootPath = System.IO.Path.Combine(installBase, "Project");
- string realmsPath = System.IO.Path.Combine(rootPath, "Realms");
- string requestRealm = Path.Combine(realmsPath, Realm);
- string requestedRealmZones = Path.Combine(requestRealm, "Zones");
- string requestedZone = Path.Combine(requestedRealmZones, Zone);
+ string realmsPath = System.IO.Path.Combine(installBase, "Realms");
+ string requestRealm = Path.Combine(installBase, Realm);
+ string requestedRealmZones = Path.Combine(installBase, "Zones");
+ string requestedZone = Path.Combine(installBase, Zone);
return requestedZone;
}
diff --git a/MudEngine/GameManagement/CommandEngine.cs b/MudEngine/GameManagement/CommandEngine.cs
index 590933f..529f293 100644
--- a/MudEngine/GameManagement/CommandEngine.cs
+++ b/MudEngine/GameManagement/CommandEngine.cs
@@ -3,6 +3,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.IO;
+using System.Reflection;
//MUD Engine
using MudEngine.GameObjects;
@@ -12,28 +14,27 @@ using MudEngine.GameManagement;
namespace MudEngine.GameManagement
{
- public class CommandEngine
+ public static class CommandEngine
{
///
/// Gets or Sets a Dictionary list of available commands to use.
///
- static internal Dictionary Commands { get; set; }
+ static internal Dictionary Commands { get { return _Commands; } set { _Commands = value; } }
+ static Dictionary _Commands = new Dictionary();
- public List GetCommands
+ public static List GetCommands()
{
- get
- {
- List temp = new List();
- foreach (string name in Commands.Keys)
- {
- temp.Add(name);
- }
+ List temp = new List();
- return temp;
+ foreach (string name in Commands.Keys)
+ {
+ temp.Add(name);
}
+
+ return temp;
}
- public bool GetCommand(string Name)
+ public static bool GetCommand(string Name)
{
if (Commands.ContainsKey(Name.ToLower()))
return true;
@@ -49,6 +50,9 @@ namespace MudEngine.GameManagement
public static CommandResults ExecuteCommand(string command, BaseCharacter player)
{
string commandKey = command.Insert(0, "Command");
+ if (Game.IsDebug)
+ Log.Write("Executing command: " + command);
+
foreach (string key in Commands.Keys)
{
if (commandKey.ToLower().Contains(key.ToLower()))
@@ -59,17 +63,55 @@ namespace MudEngine.GameManagement
return new CommandResults();
}
+
+ public static void LoadBaseCommands()
+ {
+ LoadCommandLibrary(Assembly.GetExecutingAssembly());
+ }
+
///
/// Dynamically loads the specified library into memory and stores all of the
/// classess inheriting from MudCreator.InputCommands.ICommand into the CommandEngines
/// commands dictionary for use with the project
///
///
- public static void LoadAllCommands()
+ public static void LoadCommandLibrary()
{
- System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
- Commands = new Dictionary();
- foreach (Type t in assembly.GetTypes())
+ LoadCommandLibrary(Assembly.GetExecutingAssembly());
+ }
+
+ public static void LoadCommandLibrary(string libraryFilename)
+ {
+ if (System.IO.File.Exists(libraryFilename))
+ {
+ Assembly assem = Assembly.LoadFile(libraryFilename);
+ LoadCommandLibrary(assem);
+ }
+ }
+
+ public static void LoadCommandLibrary(List commandLibraries)
+ {
+ foreach (Assembly lib in commandLibraries)
+ LoadCommandLibrary(lib);
+ }
+
+ public static void LoadCommandLibrary(Assembly commandLibrary)
+ {
+ LoadCommandLibrary(commandLibrary, false);
+ }
+
+ public static void LoadCommandLibrary(Assembly commandLibrary, bool purgeOldCommands)
+ {
+ //no assembly passed for whatever reason, don't attempt to enumerate through it.
+ if (commandLibrary == null)
+ return;
+
+ Log.Write("Loading commands within " + Path.GetFileName(commandLibrary.Location));
+
+ if (purgeOldCommands)
+ ClearCommands();
+
+ foreach (Type t in commandLibrary.GetTypes())
{
if (t.GetInterface(typeof(IGameCommand).FullName) != null)
{
@@ -100,6 +142,11 @@ namespace MudEngine.GameManagement
}
}
+ public static void ClearCommands()
+ {
+ _Commands = new Dictionary();
+ }
+
public static string GetCommand(object Parameter)
{
List