diff options
author | ubq323 <ubq323@ubq323.website> | 2024-04-13 01:46:53 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-04-13 01:46:53 +0100 |
commit | 0fc5f56e6287541901dc956115f44e9bad93279d (patch) | |
tree | 8202b8edeb5ffe8761256665fa7fd96817afedd2 /client | |
parent | bf03e2a0d86a4b5202a72aa66da5dc0e2c0b412b (diff) |
server sends chunk data to client!!! code quality is declining steadily
Diffstat (limited to 'client')
-rw-r--r-- | client/main.ha | 14 |
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)!; }; }; }; |