summaryrefslogtreecommitdiff
path: root/src/net/messagein.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/messagein.hpp')
-rw-r--r--src/net/messagein.hpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/net/messagein.hpp b/src/net/messagein.hpp
index c582d056..79063f97 100644
--- a/src/net/messagein.hpp
+++ b/src/net/messagein.hpp
@@ -39,16 +39,11 @@ class MessageIn
*/
MessageIn(const char *data, int length);
- /**
- * Destructor.
- */
- ~MessageIn();
-
- short getId() { return mId; } /**< Returns the message ID. */
+ int getId() { return mId; } /**< Returns the message ID. */
- char readByte(); /**< Reads a byte. */
- short readShort(); /**< Reads a short. */
- long readLong(); /**< Reads a long. */
+ int readByte(); /**< Reads a byte. */
+ int readShort(); /**< Reads a short. */
+ int readLong(); /**< Reads a long. */
/**
* Reads a string. If a length is not given (-1), it is assumed
@@ -60,18 +55,18 @@ class MessageIn
/**
* Returns the length of unread data.
*/
- unsigned getUnreadLength() { return mLength - mPos; }
+ int getUnreadLength() { return mLength - mPos; }
private:
const char *mData; /**< Packet data */
- unsigned int mLength; /**< Length of data in bytes */
- short mId; /**< The message ID. */
+ unsigned short mLength; /**< Length of data in bytes */
+ unsigned short mId; /**< The message ID. */
/**
* 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;
+ unsigned short mPos;
};
#endif