summaryrefslogtreecommitdiff
path: root/src/logger.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-10 16:36:52 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-10 16:36:52 +0300
commitb3f38fd1cac82b68fb057db5cf6c6e80e0cdfd90 (patch)
tree07a2236398d464bc81ed38beb2e1b675a92fcdf6 /src/logger.cpp
parent3131f766339fa58875bce8257f6127136c217a30 (diff)
downloadmanaplus-b3f38fd1cac82b68fb057db5cf6c6e80e0cdfd90.tar.gz
manaplus-b3f38fd1cac82b68fb057db5cf6c6e80e0cdfd90.tar.bz2
manaplus-b3f38fd1cac82b68fb057db5cf6c6e80e0cdfd90.tar.xz
manaplus-b3f38fd1cac82b68fb057db5cf6c6e80e0cdfd90.zip
For unknown packet field values show packet id and field value.
Diffstat (limited to 'src/logger.cpp')
-rw-r--r--src/logger.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/logger.cpp b/src/logger.cpp
index 5b8b7819b..71f26fe25 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -384,7 +384,23 @@ void Logger::unimplimented(const int id)
return;
const std::string str = strprintf("Unimplimented packet: %d (0x%x)",
- id, CAST_U32(id));
+ id,
+ CAST_U32(id));
+ DebugMessageListener::distributeEvent(str);
+ log(str);
+}
+
+void Logger::unimplimented(const int id,
+ const int id2)
+{
+ if (!mReportUnimplimented)
+ return;
+
+ const std::string str = strprintf(
+ "Unimplimented field value %d for packet %d (0x%x)",
+ id2,
+ id,
+ CAST_U32(id));
DebugMessageListener::distributeEvent(str);
log(str);
}