diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-30 22:03:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-30 22:03:25 +0300 |
commit | 0fc75f671dace65f1ed8d5b6a66b17b9ab15a9c2 (patch) | |
tree | 35796ebd3fb85ca0589f239bc93e7637cb124783 /src | |
parent | c2351483dc7c918a592f2a1f52745c6552fb7d0c (diff) | |
download | manaverse-0fc75f671dace65f1ed8d5b6a66b17b9ab15a9c2.tar.gz manaverse-0fc75f671dace65f1ed8d5b6a66b17b9ab15a9c2.tar.bz2 manaverse-0fc75f671dace65f1ed8d5b6a66b17b9ab15a9c2.tar.xz manaverse-0fc75f671dace65f1ed8d5b6a66b17b9ab15a9c2.zip |
Clear char logger on server disconnect.
Diffstat (limited to 'src')
-rw-r--r-- | src/chatlogger.cpp | 8 | ||||
-rw-r--r-- | src/chatlogger.h | 2 | ||||
-rw-r--r-- | src/client.cpp | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/src/chatlogger.cpp b/src/chatlogger.cpp index ad86de8e9..33763e561 100644 --- a/src/chatlogger.cpp +++ b/src/chatlogger.cpp @@ -39,7 +39,6 @@ #include "logger.h" #include "configuration.h" - #include "utils/mkdir.h" #include "utils/stringutils.h" @@ -204,3 +203,10 @@ void ChatLogger::loadLast(std::string name, std::list<std::string> &list, if (logFile.is_open()) logFile.close(); } + +void ChatLogger::clear() +{ + mLogDir = ""; + mServerName = ""; + mLogFileName = ""; +} diff --git a/src/chatlogger.h b/src/chatlogger.h index 91805a8bc..bb02d8127 100644 --- a/src/chatlogger.h +++ b/src/chatlogger.h @@ -59,6 +59,8 @@ class ChatLogger void setBaseLogDir(const std::string &logDir) { mBaseLogDir = logDir; } + void clear(); + private: /** * Sets the file to log to and opens it diff --git a/src/client.cpp b/src/client.cpp index 18318acb6..835bbc965 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -999,6 +999,8 @@ int Client::gameExec() Net::getNpcHandler()->clearDialogs(); Net::getGuildHandler()->clear(); Net::getPartyHandler()->clear(); + if (chatLogger) + chatLogger->clear(); } mOldState = mState; |