diff options
| author | mat <github@matdoes.dev> | 2021-12-08 00:41:42 -0600 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2021-12-08 00:41:42 -0600 |
| commit | c16d55ccddd741057bf532bd946b2854dc208c65 (patch) | |
| tree | e6ae8af47e1931ef98ea55913831197b8e65a7ee /minecraft-protocol/src/connection.rs | |
| parent | 4a44c58444c901d939a8594669c819ab2bfbac13 (diff) | |
| download | azalea-drasl-c16d55ccddd741057bf532bd946b2854dc208c65.tar.xz | |
start adding minecraft-chat
Diffstat (limited to 'minecraft-protocol/src/connection.rs')
| -rw-r--r-- | minecraft-protocol/src/connection.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/minecraft-protocol/src/connection.rs b/minecraft-protocol/src/connection.rs index a162bb6b..e0d781c8 100644 --- a/minecraft-protocol/src/connection.rs +++ b/minecraft-protocol/src/connection.rs @@ -64,7 +64,7 @@ impl Connection { // TODO // otherwise, read the rest of the packet and throw it away - let mut packet_data = Vec::with_capacity((packet_size - packet_id_size as u32) as usize); + let mut packet_data = Vec::with_capacity((packet_size - packet_id_size as i32) as usize); buf.read_buf(&mut packet_data).await.unwrap(); println!("packet {:?}", packet_data); @@ -80,7 +80,7 @@ impl Connection { // write the packet id let mut id_and_data_buf = vec![]; - mc_buf::write_varint(&mut id_and_data_buf, packet.get_id()); + mc_buf::write_varint(&mut id_and_data_buf, packet.get_id() as i32); packet.write(&mut id_and_data_buf); // write the packet data @@ -88,7 +88,7 @@ impl Connection { // make a new buffer that has the length at the beginning // and id+data at the end let mut complete_buf: Vec<u8> = Vec::new(); - mc_buf::write_varint(&mut complete_buf, id_and_data_buf.len() as u32); + mc_buf::write_varint(&mut complete_buf, id_and_data_buf.len() as i32); complete_buf.append(&mut id_and_data_buf); // finally, write and flush to the stream |
