Planeshift
|
This class is implements the user input and output console for the server. More...
#include <serverconsole.h>
Public Member Functions | |
void | MainLoop () |
The main server console loop. | |
void | Run () |
Starts the server console, first looking if there's a script passed via -run=file on the command line, then entering the main loop. | |
ServerConsole (iObjectRegistry *oreg, const char *appname, const char *prompt) | |
void | SetCommandCatcher (iCommandCatcher *cmdcatch) |
~ServerConsole () | |
Static Public Member Functions | |
static void | ExecuteScript (const char *script) |
Executes a script of commands. | |
Static Public Attributes | |
static const char * | prompt |
Holds the prompt. | |
Protected Attributes | |
const char * | appname |
The name of this application. Only used for printing & readline. | |
iCommandCatcher * | cmdcatcher |
CommandCatcher intercepts typed commands without processing them here. | |
iObjectRegistry * | objreg |
bool | stop |
If true, the server is shutting down, and the main loop should stop. | |
csRef< CS::Threading::Thread > | thread |
The server console runs in its own thread. |
This class is implements the user input and output console for the server.
Definition at line 67 of file serverconsole.h.
ServerConsole::ServerConsole | ( | iObjectRegistry * | oreg, |
const char * | appname, | ||
const char * | prompt | ||
) |
ServerConsole::~ServerConsole | ( | ) |
static void ServerConsole::ExecuteScript | ( | const char * | script | ) | [static] |
Executes a script of commands.
The script is passed in as a char array buffer (NOT a filename). This function goes through the char array script line at a time and executes the given server command. It also allows for commenting the script using the #comment...
void ServerConsole::MainLoop | ( | ) |
The main server console loop.
This waits for a user to enter a line of data and executes the command that the user entered.
void ServerConsole::Run | ( | ) |
Starts the server console, first looking if there's a script passed via -run=file on the command line, then entering the main loop.
void ServerConsole::SetCommandCatcher | ( | iCommandCatcher * | cmdcatch | ) | [inline] |
Definition at line 97 of file serverconsole.h.
const char* ServerConsole::appname [protected] |
The name of this application. Only used for printing & readline.
Definition at line 107 of file serverconsole.h.
iCommandCatcher* ServerConsole::cmdcatcher [protected] |
CommandCatcher intercepts typed commands without processing them here.
Definition at line 116 of file serverconsole.h.
iObjectRegistry* ServerConsole::objreg [protected] |
Definition at line 118 of file serverconsole.h.
const char* ServerConsole::prompt [static] |
Holds the prompt.
Definition at line 103 of file serverconsole.h.
bool ServerConsole::stop [protected] |
If true, the server is shutting down, and the main loop should stop.
Definition at line 113 of file serverconsole.h.
csRef<CS::Threading::Thread> ServerConsole::thread [protected] |
The server console runs in its own thread.
Definition at line 110 of file serverconsole.h.