diff --git a/MudEngine/Commands/CommandLogin.cs b/MudEngine/Commands/CommandLogin.cs
index 1ac88c6..cbb5977 100644
--- a/MudEngine/Commands/CommandLogin.cs
+++ b/MudEngine/Commands/CommandLogin.cs
@@ -53,6 +53,7 @@ namespace MudEngine.Commands
}
player.Send("Welcome " + player.Name + "!");
+ player.CommandSystem.ExecuteCommand("Look", player);
return new CommandResults();
}
}
diff --git a/MudEngine/Commands/CommandLook.cs b/MudEngine/Commands/CommandLook.cs
index 7cc8b67..6960eee 100644
--- a/MudEngine/Commands/CommandLook.cs
+++ b/MudEngine/Commands/CommandLook.cs
@@ -19,16 +19,22 @@ namespace MudEngine.Commands
public CommandResults Execute(string command, BaseCharacter player)
{
- StringBuilder desc = new StringBuilder();
-
if (player.CurrentRoom == null)
{
return new CommandResults("Not within a created Room.");
}
- desc.AppendLine(player.CurrentRoom.Description);
+ if (player.CurrentRoom.DetailedDescription.Count == 0)
+ player.Send(player.CurrentRoom.Description);
+ else
+ {
+ foreach(string entry in player.CurrentRoom.DetailedDescription)
+ {
+ player.Send(entry);
+ }
+ }
- return new CommandResults(desc.ToString());
+ return new CommandResults();
}
}
}
diff --git a/MudEngine/Commands/CommandRestart.cs b/MudEngine/Commands/CommandRestart.cs
index 26d4cf1..58bb048 100644
--- a/MudEngine/Commands/CommandRestart.cs
+++ b/MudEngine/Commands/CommandRestart.cs
@@ -32,8 +32,17 @@ namespace MudEngine.Commands
string filename = Path.Combine(path, player.ActiveGame.PlayerCollection[i].Filename);
player.ActiveGame.PlayerCollection[i].Save(filename);
}
- player.ActiveGame.Server.EndServer();
+
+ //player.ActiveGame.Server.EndServer(); //-Handled in Game.Shutdown() below.
+ player.ActiveGame.Shutdown();
+ player.ActiveGame.Start();
+ /* Game.Start() calls this, do we need a reference to the playercollection?
+ * They should be unloaded anyway and re-loaded during game.start to force a clean restart of all objects.
player.ActiveGame.Server.Initialize(555, ref player.ActiveGame.PlayerCollection);
+ */
+
+ Console.WriteLine("Server Restart Completed.");
+ //This is never printed as CommandResults is no longer outputted to the player console, player.Send is used
return new CommandResults("Server Restarted.");
}
return new CommandResults("Access Denied.");
diff --git a/MudEngine/Commands/CommandWalk.cs b/MudEngine/Commands/CommandWalk.cs
index cd91ff4..a3cbda9 100644
--- a/MudEngine/Commands/CommandWalk.cs
+++ b/MudEngine/Commands/CommandWalk.cs
@@ -33,13 +33,9 @@ namespace MudEngine.Commands
//Move the player into their new room
player.Move(door.TravelDirection);
- CommandResults cmd = player.CommandSystem.ExecuteCommand("Look", player);
- string lookValue = "";
+ player.CommandSystem.ExecuteCommand("Look", player);
- if (cmd.Result.Length != 0)
- lookValue = cmd.Result[0].ToString();
-
- return new CommandResults(new object[] { lookValue, player.CurrentRoom });
+ return null;
}
}
}
diff --git a/MudEngine/GameManagement/CommandEngine.cs b/MudEngine/GameManagement/CommandEngine.cs
index 76f54d7..92c3864 100644
--- a/MudEngine/GameManagement/CommandEngine.cs
+++ b/MudEngine/GameManagement/CommandEngine.cs
@@ -19,23 +19,23 @@ namespace MudEngine.GameManagement
///
/// Gets or Sets a Dictionary list of available commands to use.
///
- public Dictionary CommandCollection { get; set; }
+ public static Dictionary CommandCollection { get; set; }
- internal Dictionary _Commands { get; set; }
+ internal Dictionary __Commands { get; set; }
public CommandEngine()
{
- if ((CommandCollection == null) || (CommandCollection.Count == 0))
- LoadBaseCommands();
+ if ((CommandEngine.CommandCollection == null) || (CommandEngine.CommandCollection.Count == 0))
+ CommandEngine.LoadBaseCommands();
- _Commands = CommandCollection;
+ //_Commands = CommandEngine.CommandCollection;
}
- public List GetCommands()
+ public static List GetCommands()
{
List temp = new List();
- foreach (string name in CommandCollection.Keys)
+ foreach (string name in CommandEngine.CommandCollection.Keys)
{
temp.Add(name);
}
@@ -43,20 +43,21 @@ namespace MudEngine.GameManagement
return temp;
}
- public string GetCommand(object Parameter)
+ public static IGameCommand GetCommand(string command)
{
- List