diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-05-01 22:38:07 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-05-05 22:30:00 +0200 |
commit | df9ed1ab4364fe29bf260cae51827cc2722eff78 (patch) | |
tree | 45324f700d2b2c87983fa4b8c5ed01ee2e68ba70 /src/net/manaserv/messagein.h | |
parent | 96abc4a9658b3318d0052dc5cd31a3c15d76a494 (diff) | |
download | mana-df9ed1ab4364fe29bf260cae51827cc2722eff78.tar.gz mana-df9ed1ab4364fe29bf260cae51827cc2722eff78.tar.bz2 mana-df9ed1ab4364fe29bf260cae51827cc2722eff78.tar.xz mana-df9ed1ab4364fe29bf260cae51827cc2722eff78.zip |
Added debugging mode to the protocol
This makes the client able to send and receive messages sent in debugging
mode, where the contents of the messages are annotated.
For messages sent from the client the debugging mode is currently always
enabled. Later on this could be an internal option or controlled from the
server side.
Reviewed-by: Erik Schilling
Diffstat (limited to 'src/net/manaserv/messagein.h')
-rw-r--r-- | src/net/manaserv/messagein.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/net/manaserv/messagein.h b/src/net/manaserv/messagein.h index ef0c29bf..89ae5ed8 100644 --- a/src/net/manaserv/messagein.h +++ b/src/net/manaserv/messagein.h @@ -22,6 +22,8 @@ #ifndef NET_MANASERV_MESSAGEIN_H #define NET_MANASERV_MESSAGEIN_H +#include "net/manaserv/manaserv_protocol.h" + #include <cstdint> #include <string> @@ -75,14 +77,16 @@ class MessageIn std::string readString(int length = -1); private: - const char *mData; /**< The message data. */ - unsigned int mLength; /**< The length of the data. */ - unsigned short mId; /**< The message ID. */ + bool readValueType(ManaServ::ValueType type); + + const char *mData; /**< The message data. */ + unsigned int mLength; /**< The length of the data. */ + unsigned short mId; /**< The message ID. */ + bool mDebugMode; /**< Includes debugging information. */ /** - * Actual position in the packet. From 0 to packet->length. - * A value bigger than packet->length means EOP was reached when - * reading it. + * Actual position in the packet. From 0 to packet->length. A value + * bigger than packet->length means EOP was reached when reading it. */ unsigned int mPos; }; |