summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-03 01:44:27 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-03 01:44:27 +0300
commit5066c50c2869d3f8b13138947eaa3f52accc5ad0 (patch)
tree713112eae36b62756d6f811c55909d2acf6358e2
parentff01386ce73890e96ec5418b409e51b433f3bb6c (diff)
downloadManaVerse-5066c50c2869d3f8b13138947eaa3f52accc5ad0.tar.gz
ManaVerse-5066c50c2869d3f8b13138947eaa3f52accc5ad0.tar.bz2
ManaVerse-5066c50c2869d3f8b13138947eaa3f52accc5ad0.tar.xz
ManaVerse-5066c50c2869d3f8b13138947eaa3f52accc5ad0.zip
If wrong packet come from network show packet id in crash message.
-rw-r--r--src/net/eathena/network.cpp7
-rw-r--r--src/net/tmwa/network.cpp7
2 files changed, 12 insertions, 2 deletions
diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp
index 57b450f1a..e03554ee2 100644
--- a/src/net/eathena/network.cpp
+++ b/src/net/eathena/network.cpp
@@ -191,7 +191,12 @@ void Network::dispatchMessages()
SDL_mutexV(mMutex);
if (len == 0)
- logger->safeError("Zero length packet received. Exiting.");
+ {
+ // need copy data for safty
+ std::string str = strprintf("Wrong packet %d ""received. Exiting.",
+ msgId);
+ logger->safeError(str);
+ }
if (msgId >= 0 && msgId < messagesSize)
{
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp
index 94a462aba..be91b5bc9 100644
--- a/src/net/tmwa/network.cpp
+++ b/src/net/tmwa/network.cpp
@@ -163,7 +163,12 @@ void Network::dispatchMessages()
SDL_mutexV(mMutex);
if (len == 0)
- logger->safeError("Zero length packet received. Exiting.");
+ {
+ // need copy data for safty
+ std::string str = strprintf("Wrong packet %d ""received. Exiting.",
+ msgId);
+ logger->safeError(str);
+ }
if (msgId >= 0 && msgId < messagesSize)
{