diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-09-02 13:03:20 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-09-02 13:03:20 +0000 |
commit | 3bce14c324e1d7bbd058e18072acc7bd953d6475 (patch) | |
tree | e51a4c8fd00bd0be1c63faae4984aaf72a72a6bc /src/net/messagein.h | |
parent | 2b322bf18d80acb464a9dc1820e581e7204cca1e (diff) | |
download | mana-3bce14c324e1d7bbd058e18072acc7bd953d6475.tar.gz mana-3bce14c324e1d7bbd058e18072acc7bd953d6475.tar.bz2 mana-3bce14c324e1d7bbd058e18072acc7bd953d6475.tar.xz mana-3bce14c324e1d7bbd058e18072acc7bd953d6475.zip |
Removed pixel-based synchronisation. Added variable length move messages.
Diffstat (limited to 'src/net/messagein.h')
-rw-r--r-- | src/net/messagein.h | 13 |
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. */ |