Ignore known but unused packets

This commit is contained in:
Roderick van Domburg 2021-06-23 21:26:52 +02:00
parent 12365ae082
commit aa4cc0bee6
No known key found for this signature in database
GPG key ID: 7076AA781B43EFE6

View file

@ -203,25 +203,29 @@ impl Session {
self.debug_info();
self.send_packet(Pong, vec![0, 0, 0, 0]);
}
Some(PongAck) => {}
Some(CountryCode) => {
let country = String::from_utf8(data.as_ref().to_owned()).unwrap();
info!("Country: {:?}", country);
self.0.data.write().unwrap().country = country;
}
Some(StreamChunkRes) | Some(ChannelError) => {
self.channel().dispatch(packet_type.unwrap(), data)
self.channel().dispatch(packet_type.unwrap(), data);
}
Some(AesKey) | Some(AesKeyError) => {
self.audio_key().dispatch(packet_type.unwrap(), data)
self.audio_key().dispatch(packet_type.unwrap(), data);
}
Some(MercuryReq) | Some(MercurySub) | Some(MercuryUnsub) | Some(MercuryEvent) => {
self.mercury().dispatch(packet_type.unwrap(), data)
self.mercury().dispatch(packet_type.unwrap(), data);
}
Some(PongAck)
| Some(SecretBlock)
| Some(LegacyWelcome)
| Some(UnknownDataAllZeros)
| Some(ProductInfo)
| Some(LicenseVersion) => {}
_ => {
if let Some(packet_type) = PacketType::from_u8(cmd) {
trace!("Ignoring {:?} packet", packet_type);
trace!("Ignoring {:?} packet with data {:?}", packet_type, data);
} else {
trace!("Ignoring unknown packet {:x}", cmd);
}