From a3934e1b9689556e790e0113a98b91ed2d046092 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sat, 27 Jun 2020 18:27:20 -0700 Subject: [PATCH] Add 1.16 (735), same packets as 1.16.1 (736) --- README.md | 2 ++ protocol/src/protocol/mod.rs | 4 ++-- protocol/src/protocol/versions.rs | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4c89935..d82eb85 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ Join with your favorite IRC client or [Matrix](https://matrix.to/#/#_espernet_#s | Game version | Protocol version | Supported? | | ------ | --- | --- | +| 1.16.1 | 736 | ✓ | +| 1.16 | 735 | ✓ | | 1.15.2 | 578 | ✓ | | 1.15.1 | 575 | ✓ | | 1.14.4 | 498 | ✓ | diff --git a/protocol/src/protocol/mod.rs b/protocol/src/protocol/mod.rs index 8330844..c01a566 100644 --- a/protocol/src/protocol/mod.rs +++ b/protocol/src/protocol/mod.rs @@ -43,8 +43,8 @@ use std::net::TcpStream; use std::sync::atomic::{AtomicBool, AtomicI32, Ordering}; use std::time::{Duration, Instant}; -pub const SUPPORTED_PROTOCOLS: [i32; 20] = [ - 736, 578, 575, 498, 490, 485, 480, 477, 452, 451, 404, 340, 316, 315, 210, 109, 107, 74, 47, 5, +pub const SUPPORTED_PROTOCOLS: [i32; 21] = [ + 736, 735, 578, 575, 498, 490, 485, 480, 477, 452, 451, 404, 340, 316, 315, 210, 109, 107, 74, 47, 5, ]; static CURRENT_PROTOCOL_VERSION: AtomicI32 = AtomicI32::new(SUPPORTED_PROTOCOLS[0]); diff --git a/protocol/src/protocol/versions.rs b/protocol/src/protocol/versions.rs index 2f55dce..0033477 100644 --- a/protocol/src/protocol/versions.rs +++ b/protocol/src/protocol/versions.rs @@ -26,6 +26,7 @@ pub fn protocol_name_to_protocol_version(s: String) -> i32 { match s.as_ref() { "" => SUPPORTED_PROTOCOLS[0], "1.16.1" => 736, + "1.16" => 735, "1.15.2" => 578, "1.15.1" => 575, "1.14.4" => 498, @@ -64,6 +65,7 @@ pub fn translate_internal_packet_id_for_version( ) -> i32 { match version { 736 => v1_16_1::translate_internal_packet_id(state, dir, id, to_internal), + 735 => v1_16_1::translate_internal_packet_id(state, dir, id, to_internal), 578 => v1_15::translate_internal_packet_id(state, dir, id, to_internal), 575 => v1_15::translate_internal_packet_id(state, dir, id, to_internal), 498 => v1_14_4::translate_internal_packet_id(state, dir, id, to_internal),