MudEngine:
- FileManager.GetData() method now checks to ensure that the supplied filename exists prior to attempting to reading data. - Adjusted Game.AutoSaveInterval to 60 minutes instead of 1 minute. - Placed all of the File reading code within Game.Load() into a Try/Catch to prevent exceptions if there was an error restoring the game from saved state. - GameWorld.Load() now places saved Realms that were created at runtime into the Games Realm Collection. This allows for hard-coded and dynamically created Realms to co-exist. - BaseObject.Filename now appends a file extension to the filename if a filename is set but the user forgets to add the file extension. This affects all classes inheriting from BaseObject - BaseCharacter updated to invoke commands by instancing a copy of the command and executing it, instead of injecting commands from the player. - Added EditRealm command. Allows for editing existing Realms properties. Currently has editing of Simple Descriptions, Detailed Descriptions, name and filename fully implemented. Example: EditRealm MyRealmName MudGame: - Removed Cali.Create() call. The MudGame no longer creates a hard-coded world. I want to get away from hard-coded environments all together. They should be built dynamically by admins.
This commit is contained in:
parent
abe11a5fd5
commit
9313611784
8 changed files with 610 additions and 32 deletions
|
@ -6,6 +6,8 @@ using System.Text;
|
|||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
using MudEngine.GameManagement;
|
||||
|
||||
namespace MudEngine.FileSystem
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -54,6 +56,11 @@ namespace MudEngine.FileSystem
|
|||
|
||||
public static String GetData(String filename, String name)
|
||||
{
|
||||
if (!File.Exists(filename))
|
||||
{
|
||||
Log.Write("Error: Failed attempting to load " + filename + ". File does not exist.");
|
||||
return "No data Found." ;
|
||||
}
|
||||
foreach (String line in File.ReadAllLines(filename))
|
||||
{
|
||||
//Ignore comments
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue