- Added BaseCharacter.FlushConsole() method. Sends a hex sequence to the clients telnet terminal that clears the screen. If IsMultiplayer=false then it just clears the C# Console. - Added a 'Clear' command for users to use. It invokes the new FlushConsole command. - Removed the need for a full file path and filename when calling an objects save method. Now it just needs the path. - Adjusted the Exit command, Login command and Save command to reflect the objects save parameter changes. - Removed the Unique ID from objects. - All objects now reference each other via their filenames rather than their object names. Allows for 3 objects with the name Bedroom to exist, but with different filenames such as Bedroom1, Bedroom2 etc. - Zone now has a GetRoomByName method that replace the removed GetRoomByID method. Returns a List<> collection of Rooms found with a matching filename. - BaseCharacter updated to work with the new Zone.GetRoomByName method. - Realm.GetZoneByID renamed to GetZoneByName()
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.IO;
|
|
|
|
using MudEngine.FileSystem;
|
|
using MudEngine.GameManagement;
|
|
using MudEngine.GameObjects;
|
|
using MudEngine.GameObjects.Characters;
|
|
|
|
namespace MudEngine.Commands
|
|
{
|
|
public class CommandSave : IGameCommand
|
|
{
|
|
public bool Override { get; set; }
|
|
public string Name { get; set; }
|
|
|
|
public CommandResults Execute(string command, BaseCharacter player)
|
|
{
|
|
/*
|
|
if (player.ActiveGame.PlayerCollection.Length != 0)
|
|
{
|
|
if (player.GetType().Name != "BaseCharacter")
|
|
{
|
|
Scripting.GameObject obj = player.ActiveGame.scriptEngine.GetObject(player.ActiveGame.PlayerCollection.GetType().Name);
|
|
|
|
obj.InvokeMethod("Save", new object[] { player.ActiveGame.DataPaths.Players });
|
|
}
|
|
}
|
|
else */
|
|
player.Save(player.ActiveGame.DataPaths.Players);
|
|
|
|
return new CommandResults();
|
|
}
|
|
}
|
|
}
|