MudEngine:

- Realm, Room and Zone editing no longer closes the menu once a task is finished. Use the Exit menu option to close the editing menu
 - Revised how the Game checks for existing InitialLocations. If a InitialLocation does not exist, but is created during server runtime, new players will automatically be placed there without the need to restart the server.
 - Improved the List command.
This commit is contained in:
Scionwest_cp 2010-09-12 16:18:28 -07:00
parent b3238d0227
commit 304b2d07eb
7 changed files with 155 additions and 91 deletions

View file

@ -195,6 +195,7 @@ namespace MudEngine.GameManagement
scriptEngine = new Scripting.ScriptEngine(this);
World = new GameWorld(this);
WorldTime = new GameTime(this);
InitialRealm = new Realm(this);
//Prepare the Save Paths for all of our Game objects.
DataPaths = new SaveDataPaths("World", "Player");
@ -279,6 +280,17 @@ namespace MudEngine.GameManagement
//Load the game and world if it was previously saved.
Load();
String[] env = InitialRealm.InitialZone.InitialRoom.RoomLocation.Split('>');
if (env.Length == 3)
{
if ((String.IsNullOrEmpty(env[0])) || (String.IsNullOrEmpty(env[1])) || (String.IsNullOrEmpty(env[2])))
{
Log.Write("Error: No starting location defined!");
}
}
else
Log.Write("Error: No starting location defined!");
Log.Write("Game startup complete.");
return true;
}
@ -429,6 +441,16 @@ namespace MudEngine.GameManagement
//Restore the world.
World.Load();
//Check if any the initial room exists or not.
if ((this.InitialRealm == null) || (this.InitialRealm.InitialZone == null) || (this.InitialRealm.InitialZone.InitialRoom == null))
{
Log.Write("ERROR: No initial location defined. Game startup failed!");
Log.Write("Players will start in the Abyss. Each player will contain their own instance of this room.");
//return false;
}
else
Log.Write("Initial Location loaded: " + this.InitialRealm.InitialZone.InitialRoom.RoomLocationWithoutExtension);
Log.Write("Game Restore complete.");
}