mirror of
https://github.com/modernuo/ModernUO
synced 2026-08-11 22:23:06 -04:00
### Summary * Adds console command support. * Adds `save`, `restart`, and `shutdown` commands.
27 lines
612 B
C#
27 lines
612 B
C#
using Server.Saves;
|
|
|
|
namespace Server.Misc;
|
|
|
|
public static class ConsoleCommands
|
|
{
|
|
public static void Configure()
|
|
{
|
|
ConsoleInputHandler.RegisterCommand(
|
|
["save", "s"],
|
|
"Saves the world",
|
|
_ => Core.LoopContext.Post(AutoSave.Save)
|
|
);
|
|
|
|
ConsoleInputHandler.RegisterCommand(
|
|
["shutdown", "sh"],
|
|
"Shuts down the server.",
|
|
_ => Core.Kill()
|
|
);
|
|
|
|
ConsoleInputHandler.RegisterCommand(
|
|
["restart", "r"],
|
|
"Restarts the server.",
|
|
_ => Core.Kill(true)
|
|
);
|
|
}
|
|
}
|