|
|
@ -98,8 +98,13 @@ impl<S, R> Client<S, R> where |
|
|
|
let pkt_data = self.incoming_data.drain(..pkt_len).collect::<Vec<_>>();
|
|
|
|
|
|
|
|
trace!("[recv buf from {:?}] {:?}", self.id, pkt_data);
|
|
|
|
let pkt = R::from_bytes(&pkt_data[..pkt_size])
|
|
|
|
.map_err(|err| -> PacketNetworkError { err.into() })?;
|
|
|
|
let pkt = match R::from_bytes(&pkt_data[..pkt_size]) {
|
|
|
|
Ok(p) => p,
|
|
|
|
Err(err) => {
|
|
|
|
warn!("error RecvServerPacket::from_bytes: {:?}", err);
|
|
|
|
continue
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
trace!("[recv from {:?}] {:?}", self.id, pkt);
|
|
|
|
result.push(pkt);
|
|
|
|