diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/trinitycore/CliRunnable.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/trinitycore/CliRunnable.cpp b/src/trinitycore/CliRunnable.cpp index 92923b3a6a4..0fca32e355f 100644 --- a/src/trinitycore/CliRunnable.cpp +++ b/src/trinitycore/CliRunnable.cpp @@ -393,6 +393,15 @@ void CliRunnable::run() { fflush(stdout); + // Safe exit thread + #ifdef linux + while (!kb_hit_return() && !World::IsStopped()) + // With this, we limit CLI to 10commands/second + usleep(100); + if (World::IsStopped()) + break; + #endif + char *command_str ; // = fgets(commandbuf,sizeof(commandbuf),stdin); #if PLATFORM == WINDOWS |