summaryrefslogtreecommitdiff
path: root/src/game-server
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-04-14 12:59:54 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-05-05 22:51:32 +0200
commitbb9a9b9b0f4ec7cc6a9ca3a6bd2dc35b0b6541e7 (patch)
tree503dcb475ece8e72e2fbef2e78e82b2a881e6d23 /src/game-server
parent05669aae551820f2183984d1c706d3a82eb37be6 (diff)
downloadmanaserv-bb9a9b9b0f4ec7cc6a9ca3a6bd2dc35b0b6541e7.tar.gz
manaserv-bb9a9b9b0f4ec7cc6a9ca3a6bd2dc35b0b6541e7.tar.bz2
manaserv-bb9a9b9b0f4ec7cc6a9ca3a6bd2dc35b0b6541e7.tar.xz
manaserv-bb9a9b9b0f4ec7cc6a9ca3a6bd2dc35b0b6541e7.zip
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
Diffstat (limited to 'src/game-server')
-rw-r--r--src/game-server/accountconnection.cpp2
-rw-r--r--src/game-server/main-game.cpp3
2 files changed, 5 insertions, 0 deletions
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;