Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-08-03 18:15:41 +0000
committerStijn Buys <ingar@osirion.org>2008-08-03 18:15:41 +0000
commit611e311124523cb8add6960e894d92b5d909d2ad (patch)
tree122efe9d2c268f197732e53a8834dac99c5b7289 /src
parente685db34cb94e4bef564da4afdaa7a18b1819c09 (diff)
dump console content on server shutdown
Diffstat (limited to 'src')
-rw-r--r--src/server/console.cc13
-rw-r--r--src/server/console.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/src/server/console.cc b/src/server/console.cc
index 1fb7f38..c4e63e3 100644
--- a/src/server/console.cc
+++ b/src/server/console.cc
@@ -82,10 +82,23 @@ void Console::shutdown()
server_console.draw();
endwin();
console_initialized = false;
+
+ server_console.dump();
#endif
}
#ifdef HAVE_CURSES
+void Console::dump()
+{
+ flush();
+
+ // dump console content
+ for (std::deque<std::string>::iterator it = consoleinterface_text.begin(); it != consoleinterface_text.end(); it++) {
+ print_ansi((*it).c_str());
+ std::cout << std::endl;
+ }
+}
+
void Console::resize()
{
if (!console_initialized)
diff --git a/src/server/console.h b/src/server/console.h
index ed15c79..b96f593 100644
--- a/src/server/console.h
+++ b/src/server/console.h
@@ -34,6 +34,8 @@ protected:
void draw_text();
/// draw the console input (ncurses)
void draw_input();
+ /// dump console content to cout
+ void dump();
private:
/// set ncurses drawing color