diff options
| author | mat <github@matdoes.dev> | 2021-12-11 18:03:07 -0600 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2021-12-11 18:03:07 -0600 |
| commit | 3763d086f6e6f6c49ac996ec2b787d9de0d3bab7 (patch) | |
| tree | 271bf8d78c36e282bf1c116290893232aed4ffa6 /minecraft-protocol/src/connection.rs | |
| parent | ba911a8a207eb47df7a055410570767b2e33c2ae (diff) | |
| download | azalea-drasl-3763d086f6e6f6c49ac996ec2b787d9de0d3bab7.tar.xz | |
misc polish
Diffstat (limited to 'minecraft-protocol/src/connection.rs')
| -rw-r--r-- | minecraft-protocol/src/connection.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/minecraft-protocol/src/connection.rs b/minecraft-protocol/src/connection.rs index 2fe03dfb..5b750802 100644 --- a/minecraft-protocol/src/connection.rs +++ b/minecraft-protocol/src/connection.rs @@ -50,13 +50,14 @@ impl Connection { // 1. reads the first 5 bytes, probably only some of this will be used to get the packet length // 2. how much we should read = packet length - 5 // 3. read the rest of the packet and add it to the cursor + // 4. figure out what packet this is and parse it // the first thing minecraft sends us is the length as a varint, which can be up to 5 bytes long let mut buf = BufReader::with_capacity(4 * 1024 * 1024, &mut self.stream); - println!("reading length varint"); + let (_packet_size, _packet_size_varint_size) = mc_buf::read_varint(&mut buf).await?; + // then, minecraft tells us the packet id as a varint - println!("reading id varint"); let (packet_id, _packet_id_size) = mc_buf::read_varint(&mut buf).await?; // if we recognize the packet id, parse it |
