diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-12-29 19:46:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-12-29 19:46:39 +0300 |
commit | deca767aa228a9b05cd87d2fd8ff536079000893 (patch) | |
tree | 9097658c96f74191856b02b0f92aeb52939f4c7d /src | |
parent | f4c2f2e5300c4504e555760094ad4929e2ed2d13 (diff) | |
download | manaplus-deca767aa228a9b05cd87d2fd8ff536079000893.tar.gz manaplus-deca767aa228a9b05cd87d2fd8ff536079000893.tar.bz2 manaplus-deca767aa228a9b05cd87d2fd8ff536079000893.tar.xz manaplus-deca767aa228a9b05cd87d2fd8ff536079000893.zip |
Add chat command to dump environment variables to log.
New chat command:
/dumpe
Diffstat (limited to 'src')
-rw-r--r-- | src/commands.cpp | 11 | ||||
-rw-r--r-- | src/commands.h | 2 | ||||
-rw-r--r-- | src/gui/chatwindow.cpp | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/src/commands.cpp b/src/commands.cpp index 600b86f4b..ddc07ad90 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -81,6 +81,7 @@ ChatTab *const tab) extern std::string tradePartnerName; +extern char **environ; namespace Commands { @@ -1007,6 +1008,16 @@ impHandler2(dumpGraphics) outStringNormal(tab, str, str); } +impHandler0(dumpEnvironment) +{ + logger->log("Start environment variables"); + for (char **env = environ; *env; ++ env) + logger->log(*env); + logger->log("End environment variables"); + if (debugChatTab) + debugChatTab->chatLog(_("Environment variables dumped")); +} + impHandler2(dumpTests) { std::string str = config.getStringValue("testInfo"); diff --git a/src/commands.h b/src/commands.h index 2f746b9e2..ce357feed 100644 --- a/src/commands.h +++ b/src/commands.h @@ -108,6 +108,7 @@ namespace Commands decHandler(open); decHandler(dump); decHandler(dumpGraphics); + decHandler(dumpEnvironment); decHandler(dumpTests); decHandler(dumpOGL); decHandler(cacheInfo); @@ -182,6 +183,7 @@ static const CommandInfo commands[] = {"setdrop", &Commands::setDrop}, {"error", &Commands::error}, {"dumpg", &Commands::dumpGraphics}, + {"dumpe", &Commands::dumpEnvironment}, {"dumpt", &Commands::dumpTests}, {"dumpogl", &Commands::dumpOGL}, {"url", &Commands::url}, diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 7f1aeaa54..c9c061be2 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -341,6 +341,7 @@ void ChatWindow::fillCommands() mCommands.push_back("/serverunignoreall"); mCommands.push_back("/dumpg"); mCommands.push_back("/dumpt"); + mCommands.push_back("/dumpe"); mCommands.push_back("/dumpogl"); mCommands.push_back("/pseudoaway "); mCommands.push_back("<PLAYER>"); |