mirror of
https://github.com/redstrate/Kawari.git
synced 2025-06-30 11:47:45 +00:00
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
This commit is contained in:
parent
0d37dd7b6e
commit
bdd98820e7
1 changed files with 2 additions and 1 deletions
|
@ -150,6 +150,7 @@ async fn client_loop(
|
||||||
let (segments, connection_type) = connection.parse_packet(&buf[..n]).await;
|
let (segments, connection_type) = connection.parse_packet(&buf[..n]).await;
|
||||||
for segment in &segments {
|
for segment in &segments {
|
||||||
match &segment.data {
|
match &segment.data {
|
||||||
|
SegmentData::None() => {},
|
||||||
SegmentData::Setup { ticket } => {
|
SegmentData::Setup { ticket } => {
|
||||||
// for some reason they send a string representation
|
// for some reason they send a string representation
|
||||||
let actor_id = ticket.parse::<u32>().unwrap();
|
let actor_id = ticket.parse::<u32>().unwrap();
|
||||||
|
@ -807,7 +808,7 @@ async fn client_loop(
|
||||||
}
|
}
|
||||||
SegmentData::KawariIpc { data } => handle_custom_ipc(&mut connection, data).await,
|
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:#?}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue