Replace with auto generation impl
This commit is contained in:
parent
73528233eb
commit
0287fadb1e
@ -115,7 +115,7 @@ impl LoginStart {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Packet, Debug)]
|
||||
pub struct EncryptionResponse {
|
||||
pub shared_secret: Vec<u8>,
|
||||
pub verify_token: Vec<u8>,
|
||||
@ -132,28 +132,6 @@ impl EncryptionResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::Encoder for EncryptionResponse {
|
||||
fn encode<W: std::io::Write>(&self, writer: &mut W) -> Result<(), crate::EncodeError> {
|
||||
crate::Encoder::encode(&self.shared_secret, writer)?;
|
||||
crate::Encoder::encode(&self.verify_token, writer)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::Decoder for EncryptionResponse {
|
||||
type Output = Self;
|
||||
|
||||
fn decode<R: std::io::Read>(reader: &mut R) -> Result<Self::Output, crate::DecodeError> {
|
||||
let shared_secret = <Vec<u8> as crate::Decoder>::decode(reader)?;
|
||||
let verify_token = <Vec<u8> as crate::Decoder>::decode(reader)?;
|
||||
|
||||
Ok(EncryptionResponse {
|
||||
shared_secret,
|
||||
verify_token,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Packet, Debug)]
|
||||
pub struct LoginPluginResponse {
|
||||
#[packet(with = "var_int")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user