- Improvements to the EditRealm command. Bug fixes and tweaks - EditRealm command now updates All Zones and Rooms within other Realms when its Realm.name is changed instead of only child Zones/Rooms. - Realms, Zones and Rooms will now append a file extension if no file extension is supplied during GetRealm(), GetZone() and GetRoom() method invokes. - Realm.InitialZone is no longer read-only - Zone.InitialRoom is no longer read-only. - Added EditZone command. Allows for editing pre-existing Zones. Zones can be created via the Create command. - Added EditRoom command. Allows for editing pre-existing Rooms. Rooms can be created via the Create command. MudGame: - Re-organized the Scripts directory. All Admin commands are now placed within a 'AdminCommands' folder while the player based commands are in a 'PlayerCommands' folder. All remaining scripts reside within the Scripts root folder.
47 lines
No EOL
1.9 KiB
C#
47 lines
No EOL
1.9 KiB
C#
/// <summary>
|
|
/// The GetTime command is used to print the current in-game time to the player.
|
|
/// This command will print the day, month and year along with hour, minute and seconds.
|
|
/// </summary>
|
|
public class CommandGetTime : IGameCommand
|
|
{
|
|
/// <summary>
|
|
/// Used by the Command Engine to allow for overriding any other commands that contain the same name.
|
|
/// TODO: Does Overriding Commands still work? This is part of some old code I wrote several years back and might be broke.
|
|
/// </summary>
|
|
public Boolean Override { get; set; }
|
|
|
|
/// <summary>
|
|
/// The name of the command.
|
|
/// If Override is set to true, this command will override any other command that contains the same name.
|
|
/// </summary>
|
|
public String Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// A collection of strings that contains helpfull information for this Command.
|
|
/// When the user enteres 'Help Exit' the game will print the content of this collection.
|
|
/// This is treated like a virtual book, each entry in the collection is printed as a new line.
|
|
/// </summary>
|
|
public List<String> Help { get; set; }
|
|
|
|
/// <summary>
|
|
/// Constructor for the class.
|
|
/// </summary>
|
|
public CommandGetTime()
|
|
{
|
|
//Instance the help collection and add our help information to it.
|
|
Help = new List<string>();
|
|
Help.Add("Gives you the current time and date in the game world.");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Executes the Command.
|
|
/// This method is called from the Command Engine, it is not recommended that you call this method directly.
|
|
/// </summary>
|
|
/// <param name="command"></param>
|
|
/// <param name="player"></param>
|
|
public void Execute(String command, BaseCharacter player)
|
|
{
|
|
//Send the returned String containing the World Time to the player.
|
|
player.Send(player.ActiveGame.WorldTime.GetCurrentWorldTime());
|
|
}
|
|
} |