summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-10 15:13:53 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-10 15:13:53 +0300
commit648b7bf6803ecb250fd095f60ed52c0ac75d0201 (patch)
tree984b1b79863d64af3aed6514f90167ff49805bec /src
parented908d9f4f15fadceeb9c1babab95f00b615004b (diff)
downloadmanaplus-648b7bf6803ecb250fd095f60ed52c0ac75d0201.tar.gz
manaplus-648b7bf6803ecb250fd095f60ed52c0ac75d0201.tar.bz2
manaplus-648b7bf6803ecb250fd095f60ed52c0ac75d0201.tar.xz
manaplus-648b7bf6803ecb250fd095f60ed52c0ac75d0201.zip
Improve logging for unknown and unsupported packets.
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/network.cpp7
-rw-r--r--src/net/tmwa/network.cpp7
2 files changed, 8 insertions, 6 deletions
diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp
index 2b716c2f8..96675002d 100644
--- a/src/net/eathena/network.cpp
+++ b/src/net/eathena/network.cpp
@@ -118,8 +118,9 @@ void Network::dispatchMessages()
if (len == 0)
{
// need copy data for safty
- std::string str = strprintf("Wrong packet %u ""received. Exiting.",
- msgId);
+ std::string str = strprintf(
+ "Wrong packet %u 0x%x received. Exiting.",
+ msgId, msgId);
logger->safeError(str);
}
@@ -129,7 +130,7 @@ void Network::dispatchMessages()
if (handler)
handler->handleMessage(msg);
else
- logger->log("Unhandled packet: %x", msgId);
+ logger->log("Unhandled packet: %u 0x%x", msgId, msgId);
}
skip(len);
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp
index fa7565e46..3e0f0e3db 100644
--- a/src/net/tmwa/network.cpp
+++ b/src/net/tmwa/network.cpp
@@ -119,8 +119,9 @@ void Network::dispatchMessages()
if (len == 0)
{
// need copy data for safty
- std::string str = strprintf("Wrong packet %u ""received. Exiting.",
- msgId);
+ std::string str = strprintf(
+ "Wrong packet %u 0x%x received. Exiting.",
+ msgId, msgId);
logger->safeError(str);
}
@@ -130,7 +131,7 @@ void Network::dispatchMessages()
if (handler)
handler->handleMessage(msg);
else
- logger->log("Unhandled packet: %x", msgId);
+ logger->log("Unhandled packet: %u 0x%x", msgId, msgId);
}
skip(len);