From 227ba5511d50af8c7c46a47e09db7f55a0ed84b7 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 16 Dec 2021 17:51:05 -0600 Subject: add a few more login packets --- azalea-protocol/src/write.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'azalea-protocol/src/write.rs') diff --git a/azalea-protocol/src/write.rs b/azalea-protocol/src/write.rs index 3d8540eb..bf9fd0aa 100644 --- a/azalea-protocol/src/write.rs +++ b/azalea-protocol/src/write.rs @@ -10,7 +10,9 @@ pub async fn write_packet(packet: impl ProtocolPacket, stream: &mut TcpStream) { // write the packet id let mut id_and_data_buf = vec![]; - id_and_data_buf.write_varint(packet.id() as i32); + id_and_data_buf + .write_varint(packet.id() as i32) + .expect("Writing packet id failed"); packet.write(&mut id_and_data_buf); // write the packet data @@ -18,7 +20,9 @@ pub async fn write_packet(packet: impl ProtocolPacket, stream: &mut TcpStream) { // make a new buffer that has the length at the beginning // and id+data at the end let mut complete_buf: Vec = Vec::new(); - complete_buf.write_varint(id_and_data_buf.len() as i32); + complete_buf + .write_varint(id_and_data_buf.len() as i32) + .expect("Writing packet length failed"); complete_buf.append(&mut id_and_data_buf); // finally, write and flush to the stream -- cgit v1.2.3