Never try to read long pings packets because that's just another packet

This commit is contained in:
NGnius (Graham) 2025-02-25 22:25:44 -05:00
parent 50df2d2296
commit fe94b27507

View file

@ -15,7 +15,7 @@ impl BinRead for Ping {
args: Self::Args<'_>, args: Self::Args<'_>,
) -> binrw::BinResult<Self> { ) -> binrw::BinResult<Self> {
let tick1 = i32::read_options(reader, endian, args)?; let tick1 = i32::read_options(reader, endian, args)?;
let mut tick2_buf = [0u8; 4]; /*let mut tick2_buf = [0u8; 4];
if let Ok(count) = reader.read(&mut tick2_buf) { if let Ok(count) = reader.read(&mut tick2_buf) {
if count == tick2_buf.len() { if count == tick2_buf.len() {
return Ok(Self { return Ok(Self {
@ -23,7 +23,7 @@ impl BinRead for Ping {
tick2: Some(i32::from_be_bytes(tick2_buf)), tick2: Some(i32::from_be_bytes(tick2_buf)),
}) })
} }
} }*/
Ok(Self { Ok(Self {
tick1, tick1,
tick2: None, tick2: None,