summaryrefslogtreecommitdiff
path: root/src/net/network.cpp
diff options
context:
space:
mode:
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()
{