19 #ifndef __SERVERCONSOLE_H__ 20 #define __SERVERCONSOLE_H__ 22 #include <csutil/threading/thread.h> 26 #ifdef USE_ANSI_ESCAPE 27 #define COL_NORMAL "\033[m\017" 28 #define COL_RED "\033[31m" 29 #define COL_BLUE "\033[34m" 30 #define COL_YELLOW "\033[33m" 31 #define COL_CYAN "\033[36m" 32 #define COL_GREEN "\033[32m" 47 struct iObjectRegistry;
70 ServerConsole(iObjectRegistry *oreg,
const char *appname,
const char *prompt);
81 static void ExecuteScript(
const char* script);
99 cmdcatcher = cmdcatch;
void Trigger()
Abstract event processing function.
virtual csString ToString() const
Return a string with information about the event.
int execute_line(const char *line, csString *buffer)
static const char * prompt
Holds the prompt.
This defines an interface for intercepting commands instead of handling them locally in the server co...
csRef< CS::Threading::Thread > thread
The server console runs in its own thread.
bool stop
If true, the server is shutting down, and the main loop should stop.
iCommandCatcher * cmdcatcher
CommandCatcher intercepts typed commands without processing them here.
virtual void CatchCommand(const char *cmd)=0
This is a little class to store an array of commands and functions to call with each command...
void SetCommandCatcher(iCommandCatcher *cmdcatch)
Simple static class for controlled user output.
const COMMAND * find_command(const char *name)
This class is implements the user input and output console for the server.
virtual ~iCommandCatcher()
#define CPrintf
Allows other classes to print to the server console easily.
const char * appname
The name of this application. Only used for printing & readline.
psServerConsoleCommand(const char *command)
All scheduled events must inherit from this class.