mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
[Commands] Cleanup #shutdown Command (#3830)
# Notes - Cleanup messages and logic. - Add a confirmation so operators don't accidentally shutdown the zone they're in thinking this is `#worldshutdown` instead.
This commit is contained in:
parent
259add68f5
commit
47ab8910a3
@ -3,6 +3,22 @@
|
||||
|
||||
void command_shutdown(Client *c, const Seperator *sep)
|
||||
{
|
||||
CatchSignal(2);
|
||||
}
|
||||
const int arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Using this command will shut down your current zone. Please {} this is what you want to do.",
|
||||
Saylink::Silent("#shutdown confirm", "confirm")
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const bool is_confirm = !strcasecmp(sep->arg[1], "confirm");
|
||||
|
||||
if (is_confirm) {
|
||||
c->Message(Chat::White, "Shutting down your current zone.");
|
||||
CatchSignal(2);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user