From 5066c50c2869d3f8b13138947eaa3f52accc5ad0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 3 Apr 2013 01:44:27 +0300 Subject: If wrong packet come from network show packet id in crash message. --- src/net/eathena/network.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/net/eathena/network.cpp') 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) { -- cgit v1.2.3-70-g09d2