diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/gui/windows/chatwindow.cpp | 1 | ||||
-rw-r--r-- | src/logger.cpp | 11 | ||||
-rw-r--r-- | src/logger.h | 5 |
4 files changed, 18 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 86e1355da..076ce7b80 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -51,6 +51,8 @@ dyecmd_SOURCES = gui/cliprect.cpp \ navigationmanager.h \ settings.cpp \ settings.h \ + listeners/debugmessagelistener.cpp \ + listeners/debugmessagelistener.h \ resources/map/walklayer.cpp \ resources/map/walklayer.h \ render/graphics.cpp \ diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index dd1c4d5f7..b1c0f6982 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -2128,7 +2128,6 @@ bool ChatWindow::isTabPresent(const ChatTab *const tab) const void ChatWindow::debugMessage(const std::string &msg) { - logger->log(msg); if (debugChatTab) debugChatTab->chatLog(msg, ChatMsgType::BY_SERVER); } diff --git a/src/logger.cpp b/src/logger.cpp index 8417a3c83..e5b7264cf 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -24,6 +24,10 @@ #include "settings.h" +#include "listeners/debugmessagelistener.h" + +#include "utils/stringutils.h" + #include <iostream> #include <sstream> @@ -351,3 +355,10 @@ void Logger::error(const std::string &error_text) #endif exit(1); } + +void Logger::unimplimented(const int id) +{ + const std::string str = strprintf("Unimplimented packet: %d", id); + DebugMessageListener::distributeEvent(str); + log(str); +} diff --git a/src/logger.h b/src/logger.h index 5a44c959a..4ddf28818 100644 --- a/src/logger.h +++ b/src/logger.h @@ -46,6 +46,9 @@ #define IGNOREDEBUGLOG {} #endif +#define UNIMPLIMENTEDPACKET \ + logger->unimplimented(msg.getId()) + /** * The Log Class : Useful to write debug or info messages */ @@ -140,6 +143,8 @@ class Logger final void safeError(const std::string &error_text) __attribute__ ((noreturn)); + void unimplimented(const int id); + private: std::ofstream mLogFile; std::vector<std::string> mDelayedLog; |