MudEngine:

- Converted all Types from C# types to .NET Types (such as bool changed to Boolean, and int changed to Int32).
 - Zone no longer gets saved from within GameWorld.Save, but rather in Realm.Save()
 - Room no longer gets saved from within GameWorld.Save(), but rather in Zone.Save();
 - Added new SaveWorld command that admins only can execute to force save the world. It's not fully implemented at this time.

MudGame:
 - began work on command execution from within the server while it's running.
This commit is contained in:
Scionwest_cp 2010-08-14 00:20:43 -07:00
parent 9585cede63
commit a52ccf8da9
36 changed files with 365 additions and 297 deletions

View file

@ -20,7 +20,7 @@ namespace MudEngine.GameObjects.Environment
[Category("Environment Information")]
[DefaultValue(0)]
[Description("The amount to drain each stat by if StatDrain is enabled.")]
public int StatDrainAmount
public Int32 StatDrainAmount
{
get;
set;
@ -29,7 +29,7 @@ namespace MudEngine.GameObjects.Environment
[Category("Environment Information")]
[Description("Enable or Disable the ability for draining stats while traversing.")]
[DefaultValue(false)]
public bool StatDrain
public Boolean StatDrain
{
get;
set;
@ -38,7 +38,7 @@ namespace MudEngine.GameObjects.Environment
[ReadOnly(true)]
[Category("Environment Information")]
[Description("The Realm that this Zone is assigned to. It is not required to be contained within a Realm.")]
public string Realm
public String Realm
{
get;
set;
@ -47,7 +47,7 @@ namespace MudEngine.GameObjects.Environment
[Category("Environment Information")]
[Description("Determins if the Player can be attacked within this Room or not.")]
[DefaultValue(false)]
public bool IsSafe
public Boolean IsSafe
{
get;
set;
@ -59,7 +59,7 @@ namespace MudEngine.GameObjects.Environment
[Category("Environment Information")]
[Description("Sets that this Zone is a starting Zone for the game.")]
[DefaultValue(false)]
public bool IsInitialZone
public Boolean IsInitialZone
{
get;
set;
@ -83,6 +83,28 @@ namespace MudEngine.GameObjects.Environment
Realm = "No Realm Associated.";
}
public override void Save(String path)
{
path = Path.Combine(path, Path.GetFileNameWithoutExtension(Filename));
base.Save(path);
String filename = Path.Combine(path, Filename);
FileManager.WriteLine(filename, this.IsInitialZone.ToString(), "IsInitialZone");
FileManager.WriteLine(filename, this.IsSafe.ToString(), "IsSafe");
FileManager.WriteLine(filename, this.Realm, "Realm");
FileManager.WriteLine(filename, this.StatDrain.ToString(), "StatDrain");
FileManager.WriteLine(filename, this.StatDrainAmount.ToString(), "StatDrainAmount");
FileManager.WriteLine(filename, this.InitialRoom.Filename, "InitialRoom");
foreach (Room r in RoomCollection)
{
FileManager.WriteLine(filename, r.Filename, "Room");
r.Save(path);
}
}
/// <summary>
/// Adds the supplied room into the Zones Room collection.
/// </summary>
@ -111,7 +133,7 @@ namespace MudEngine.GameObjects.Environment
room.Realm = Realm;
}
public List<Room> GetRoomByFilename(string filename)
public List<Room> GetRoomByFilename(String filename)
{
List<Room> rooms = new List<Room>();