summaryrefslogtreecommitdiff
path: root/packet_reader
diff options
context:
space:
mode:
Diffstat (limited to 'packet_reader')
-rw-r--r--packet_reader/packet_reader.ha5
1 files changed, 5 insertions, 0 deletions
diff --git a/packet_reader/packet_reader.ha b/packet_reader/packet_reader.ha
index 02ecdba..30911df 100644
--- a/packet_reader/packet_reader.ha
+++ b/packet_reader/packet_reader.ha
@@ -69,9 +69,12 @@ export fn next(pr: *packet_reader) (packet | done | error) = {
// and return the packet,
// or, ascertain there is no full packet, and return done
if (len(pr.good) < size(u32)) return done;
+ fmt::println("a")!;
const packet_len = endian::legetu32(pr.good[0..4]);
if (packet_len < 8) return "packet size field too small": error;
+ fmt::println("b")!;
if (len(pr.good) < packet_len) return done;
+ fmt::println("c")!;
const packet_bytes = pr.good[..packet_len];
pr.good = pr.good[packet_len..];
@@ -80,6 +83,7 @@ export fn next(pr: *packet_reader) (packet | done | error) = {
switch (ty) {
case packet_type::DRAW_OP =>
const op = drawing::deser_op(packet_bytes[8..]);
+ fmt::println("d")!;
return op: packet_drawop;
case packet_type::SEND_CHUNK =>
// return value is BORROWED from the BUFFER
@@ -91,6 +95,7 @@ export fn next(pr: *packet_reader) (packet | done | error) = {
): drawing::pos;
const d = cast_u8s_to_u32s(chunk_data_bytes);
assert(len(d) == 512*512,"wrong chunk size??");
+ fmt::println("e")!;
return packet_sendchunk { world_pos = pos, chunk_data = d };
};
};