From bdd98820e790197a1fff0ff81355893457b547bb Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 21 Jun 2025 14:04:09 -0400 Subject: [PATCH] Stop panicking when receiving None segments from the client This apparently happens when you send chat messages super quick, and they seem harmless to ignore. Fixes #40 --- src/bin/kawari-world.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/kawari-world.rs b/src/bin/kawari-world.rs index 4a93718..fee8d08 100644 --- a/src/bin/kawari-world.rs +++ b/src/bin/kawari-world.rs @@ -150,6 +150,7 @@ async fn client_loop( let (segments, connection_type) = connection.parse_packet(&buf[..n]).await; for segment in &segments { match &segment.data { + SegmentData::None() => {}, SegmentData::Setup { ticket } => { // for some reason they send a string representation let actor_id = ticket.parse::().unwrap(); @@ -807,7 +808,7 @@ async fn client_loop( } SegmentData::KawariIpc { data } => handle_custom_ipc(&mut connection, data).await, _ => { - panic!("The server is recieving a response or unknown packet!") + panic!("The server is recieving a response or unknown packet: {segment:#?}") } } }