aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/main.ha14
1 files changed, 12 insertions, 2 deletions
diff --git a/client/main.ha b/client/main.ha
index 242a101..4e6fb9f 100644
--- a/client/main.ha
+++ b/client/main.ha
@@ -99,8 +99,18 @@ export fn main() void = {
case let op: packet_reader::packet_drawop =>
const opc = op as drawing::op_circle;
drawing::perform(pictures, opc);
- case =>
- abort("other packet not supported yet");
+ case let packet: packet_reader::packet_sendchunk =>
+ fmt::println(packet.world_pos.0, packet.world_pos.1, len(packet.chunk_data))!;
+ let did_set = false;
+ for (let pic &.. pictures) {
+ if (pic.world_pos.0 == packet.world_pos.0 && pic.world_pos.1 == packet.world_pos.1) {
+ pic.d[..len(packet.chunk_data)] = packet.chunk_data[..];
+ fmt::printfln("setting {},{}",pic.world_pos.0,pic.world_pos.1)!;
+ did_set = true;
+ break;
+ };
+ };
+ if (!did_set) fmt::println("did not set anything {},{} ....",packet.world_pos.0,packet.world_pos.1)!;
};
};
};