diff options
Diffstat (limited to 'Minecraft.Server/Console/commands/stop')
| -rw-r--r-- | Minecraft.Server/Console/commands/stop/CliCommandStop.cpp | 32 | ||||
| -rw-r--r-- | Minecraft.Server/Console/commands/stop/CliCommandStop.h | 16 |
2 files changed, 48 insertions, 0 deletions
diff --git a/Minecraft.Server/Console/commands/stop/CliCommandStop.cpp b/Minecraft.Server/Console/commands/stop/CliCommandStop.cpp new file mode 100644 index 00000000..29e42cd9 --- /dev/null +++ b/Minecraft.Server/Console/commands/stop/CliCommandStop.cpp @@ -0,0 +1,32 @@ +#include "stdafx.h" + +#include "CliCommandStop.h" + +#include "..\..\ServerCliEngine.h" + +namespace ServerRuntime +{ + const char *CliCommandStop::Name() const + { + return "stop"; + } + + const char *CliCommandStop::Usage() const + { + return "stop"; + } + + const char *CliCommandStop::Description() const + { + return "Stop the dedicated server."; + } + + bool CliCommandStop::Execute(const ServerCliParsedLine &line, ServerCliEngine *engine) + { + (void)line; + engine->LogInfo("Stopping server..."); + engine->RequestShutdown(); + return true; + } +} + diff --git a/Minecraft.Server/Console/commands/stop/CliCommandStop.h b/Minecraft.Server/Console/commands/stop/CliCommandStop.h new file mode 100644 index 00000000..2297c673 --- /dev/null +++ b/Minecraft.Server/Console/commands/stop/CliCommandStop.h @@ -0,0 +1,16 @@ +#pragma once + +#include "..\IServerCliCommand.h" + +namespace ServerRuntime +{ + class CliCommandStop : public IServerCliCommand + { + public: + virtual const char *Name() const; + virtual const char *Usage() const; + virtual const char *Description() const; + virtual bool Execute(const ServerCliParsedLine &line, ServerCliEngine *engine); + }; +} + |
