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/chat-server/chathandler.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/chat-server/chathandler.cpp') diff --git a/src/chat-server/chathandler.cpp b/src/chat-server/chathandler.cpp index 0446fa30..63aaa43a 100644 --- a/src/chat-server/chathandler.cpp +++ b/src/chat-server/chathandler.cpp @@ -142,7 +142,6 @@ void ChatHandler::computerDisconnected(NetComputer *comp) void ChatHandler::processMessage(NetComputer *comp, MessageIn &message) { ChatClient &computer = *static_cast< ChatClient * >(comp); - MessageOut result; if (computer.characterName.empty()) { @@ -237,12 +236,10 @@ void ChatHandler::processMessage(NetComputer *comp, MessageIn &message) default: LOG_WARN("ChatHandler::processMessage, Invalid message type" << message.getId()); - result.writeInt16(XXMSG_INVALID); + MessageOut result(XXMSG_INVALID); + computer.send(result); break; } - - if (result.getLength() > 0) - computer.send(result); } void ChatHandler::handleCommand(ChatClient &computer, const std::string &command) -- cgit v1.2.3-70-g09d2