summaryrefslogtreecommitdiff
path: root/src/net/messagein.h
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-09-02 13:03:20 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-09-02 13:03:20 +0000
commit3bce14c324e1d7bbd058e18072acc7bd953d6475 (patch)
treee51a4c8fd00bd0be1c63faae4984aaf72a72a6bc /src/net/messagein.h
parent2b322bf18d80acb464a9dc1820e581e7204cca1e (diff)
downloadmana-client-3bce14c324e1d7bbd058e18072acc7bd953d6475.tar.gz
mana-client-3bce14c324e1d7bbd058e18072acc7bd953d6475.tar.bz2
mana-client-3bce14c324e1d7bbd058e18072acc7bd953d6475.tar.xz
mana-client-3bce14c324e1d7bbd058e18072acc7bd953d6475.zip
Removed pixel-based synchronisation. Added variable length move messages.
Diffstat (limited to 'src/net/messagein.h')
-rw-r--r--src/net/messagein.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/net/messagein.h b/src/net/messagein.h
index d5a7593f..68bbb933 100644
--- a/src/net/messagein.h
+++ b/src/net/messagein.h
@@ -26,6 +26,8 @@
#include <string>
+#include <SDL_types.h>
+
/**
* Used for parsing an incoming message.
*/
@@ -49,6 +51,11 @@ class MessageIn
long readLong(); /**< Reads a long. */
/**
+ * Reads a 3-byte block containing tile-based coordinates.
+ */
+ void readCoordinates(Uint16 &x, Uint16 &y);
+
+ /**
* Reads a string. If a length is not given (-1), it is assumed
* that the length of the string is stored in a short at the
* start of the string.
@@ -61,6 +68,12 @@ class MessageIn
unsigned int
getLength() { return mLength; }
+ /**
+ * Returns the length of unread data.
+ */
+ unsigned int
+ getUnreadLength() { return mLength - mPos; }
+
private:
const char* mData; /**< The message data. */
unsigned int mLength; /**< The length of the data. */