diff options
author | Andrei Karas <akaras@inbox.ru> | 2010-05-01 21:27:58 +0300 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-05-01 17:06:27 -0600 |
commit | 844e9a7a72faca6a212e788a3adc45e17f41dca6 (patch) | |
tree | f488e4c149687ea3d60f39c042c241df7275b581 /src/client.cpp | |
parent | c22ea2f169f58e765fc699fcd71bfd3a3cd4f859 (diff) | |
download | mana-844e9a7a72faca6a212e788a3adc45e17f41dca6.tar.gz mana-844e9a7a72faca6a212e788a3adc45e17f41dca6.tar.bz2 mana-844e9a7a72faca6a212e788a3adc45e17f41dca6.tar.xz mana-844e9a7a72faca6a212e788a3adc45e17f41dca6.zip |
Add chat logging.
Add option in players setup page.
Add command line option.
Signed-off-by: Jared Adams <jaxad0127@gmail.com>
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp index 44df362e..afc1ae1d 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -22,6 +22,7 @@ #include "client.h" #include "main.h" +#include "chatlog.h" #include "configuration.h" #include "emoteshortcut.h" #include "game.h" @@ -110,6 +111,7 @@ LoginData loginData; Configuration config; /**< XML file configuration reader */ Configuration branding; /**< XML branding information reader */ Logger *logger; /**< Log object */ +ChatLogger *chatLogger; /**< Chat log object */ KeyboardConfig keyboard; UserPalette *userPalette; @@ -219,6 +221,12 @@ Client::Client(const Options &options): initHomeDir(); initConfiguration(); + chatLogger = new ChatLogger; + if (options.chatLogDir == "") + chatLogger->setLogDir(mLocalDataDir + std::string("/logs/")); + else + chatLogger->setLogDir(options.chatLogDir); + // Configure logger logger->setLogFile(mLocalDataDir + std::string("/mana.log")); logger->setLogToStandardOut(config.getValue("logToStandardOut", 0)); @@ -400,6 +408,9 @@ Client::Client(const Options &options): branding.getValue("defaultServerType", "eathena")); } + if (chatLogger) + chatLogger->setServerName(mCurrentServer.hostname); + if (loginData.username.empty() && loginData.remember) loginData.username = config.getValue("username", ""); |