summaryrefslogtreecommitdiff
path: root/src/net/network.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-12-30 16:27:24 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-12-30 16:27:24 +0000
commitea653b2e9e1b46a07440833f96b3d2b788592c61 (patch)
tree252bb23d2064d14d4aa0796aa159f94873cb6419 /src/net/network.cpp
parent57d63f1dd5df0beb1a3d81f014686a2f80dfe7fc (diff)
downloadmana-ea653b2e9e1b46a07440833f96b3d2b788592c61.tar.gz
mana-ea653b2e9e1b46a07440833f96b3d2b788592c61.tar.bz2
mana-ea653b2e9e1b46a07440833f96b3d2b788592c61.tar.xz
mana-ea653b2e9e1b46a07440833f96b3d2b788592c61.zip
Added a new item, improved smooth login sequence, added a registration window (a lot of duplicated code to be removed).
Diffstat (limited to 'src/net/network.cpp')
-rw-r--r--src/net/network.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/net/network.cpp b/src/net/network.cpp
index e94acee7..4504a944 100644
--- a/src/net/network.cpp
+++ b/src/net/network.cpp
@@ -332,6 +332,31 @@ unsigned short readWord(int pos)
#endif
}
+bool packetReady()
+{
+ bool ret = false;
+ if (in_size >= 2)
+ {
+ int length = packet_lengths[readWord(0)];
+ if (length == -1)
+ {
+ if (in_size >= 4)
+ {
+ length = readWord(2);
+ if (in_size >= length)
+ {
+ ret = true;
+ }
+ }
+ }
+ else if (in_size >= length)
+ {
+ ret = true;
+ }
+ }
+ return ret;
+}
+
MessageIn
get_next_message()
{