summaryrefslogtreecommitdiff
path: root/packet_reader
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-04-15 21:40:17 +0100
committerubq323 <ubq323@ubq323.website>2024-04-15 21:40:17 +0100
commit5333dc18382ecb0a2286712718ac3b4225fedf64 (patch)
tree4d1541a9c59c12bf59e552c49f425055f7671593 /packet_reader
parentd3eaceebe43cbb6b85125f73fbef3cf2241fe452 (diff)
implement stroke operation
Diffstat (limited to 'packet_reader')
-rw-r--r--packet_reader/packet_reader.ha6
1 files changed, 4 insertions, 2 deletions
diff --git a/packet_reader/packet_reader.ha b/packet_reader/packet_reader.ha
index e4cbcf2..6d8c315 100644
--- a/packet_reader/packet_reader.ha
+++ b/packet_reader/packet_reader.ha
@@ -91,8 +91,10 @@ export fn next(pr: *packet_reader) (packet | done | error) = {
const payload = packet_bytes[8..];
switch (ty) {
case packet_type::DRAW_OP =>
- const op = drawing::deser_op(payload);
- return op: packet_drawop;
+ match (drawing::deser_op(payload)) {
+ case let o: drawing::op => return o;
+ case drawing::deser_fail => return "deser fail": error;
+ };
case packet_type::SEND_CHUNK =>
// return value is BORROWED from the BUFFER
const pos_bytes = payload[0..8];