From bb9a9b9b0f4ec7cc6a9ca3a6bd2dc35b0b6541e7 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sat, 14 Apr 2012 12:59:54 +0200 Subject: Added debugging mode to the protocol Allows inspection of message data. It is off by default since it consumes additional bandwidth, but it can be turned on using the net_debugMode option in manaserv.xml. Currently the option only affects outgoing data for each host individually. In particular, enabling this debug mode for the server does not automatically make the client annotate its messages. Reviewed-by: Erik Schilling --- src/game-server/accountconnection.cpp | 2 ++ src/game-server/main-game.cpp | 3 +++ 2 files changed, 5 insertions(+) (limited to 'src/game-server') diff --git a/src/game-server/accountconnection.cpp b/src/game-server/accountconnection.cpp index 3d37ea67..3b58e347 100644 --- a/src/game-server/accountconnection.cpp +++ b/src/game-server/accountconnection.cpp @@ -115,6 +115,8 @@ void AccountConnection::sendCharacterData(Character *p) void AccountConnection::processMessage(MessageIn &msg) { + LOG_DEBUG("Received message " << msg << " from account server"); + switch (msg.getId()) { case AGMSG_REGISTER_RESPONSE: diff --git a/src/game-server/main-game.cpp b/src/game-server/main-game.cpp index 647a74ef..406e7c5b 100644 --- a/src/game-server/main-game.cpp +++ b/src/game-server/main-game.cpp @@ -347,6 +347,9 @@ int main(int argc, char *argv[]) options.port); } + bool debugNetwork = Configuration::getBoolValue("net_debugMode", false); + MessageOut::setDebugModeEnabled(debugNetwork); + // Make an initial attempt to connect to the account server // Try again after longer and longer intervals when connection fails. bool isConnected = false; -- cgit v1.2.3-70-g09d2