diff options
author | ubq323 <ubq323@ubq323.website> | 2024-04-22 01:21:38 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-04-22 01:21:38 +0100 |
commit | 4c7156d0b20447e29f354679acdcd28480df91bc (patch) | |
tree | fdcaca21c06781a8732e50c6081cbc8ea30c3fc8 /client | |
parent | 11c8b134d7de3d7b2249d74b26a87bc9d6acc27d (diff) |
rlerle
Diffstat (limited to 'client')
-rw-r--r-- | client/main.ha | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/client/main.ha b/client/main.ha index 0f4b1b8..081c422 100644 --- a/client/main.ha +++ b/client/main.ha @@ -119,13 +119,15 @@ export fn main() void = { const n = poll::poll(pollfd, poll::NONBLOCK)!; if (n > 0) { packet_reader::read(&packet_reader, conn)!; - for (const packet => packet_reader::next(&packet_reader)!) { - match (packet) { - case let op: packet_reader::packet_drawop => - perform_drawop(&pmgr, op); - case let packet: packet_reader::packet_sendchunk => - enact_chunkdata(&pmgr, packet, camera_pos); - }; + for (true) match (packet_reader::next(&packet_reader)) { + case done => break; + case let e: packet_reader::error => + fmt::fatalf("death: packet_reader: {}", e); + case let op: packet_reader::packet_drawop => + perform_drawop(&pmgr, op); + case let packet: packet_reader::packet_sendchunk => + enact_chunkdata(&pmgr, packet, camera_pos); + free(packet.chunk_data); }; }; |