diff --git a/README.md b/README.md index 106a07e..4c89935 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Join with your favorite IRC client or [Matrix](https://matrix.to/#/#_espernet_#s | Game version | Protocol version | Supported? | | ------ | --- | --- | +| 1.15.2 | 578 | ✓ | | 1.15.1 | 575 | ✓ | | 1.14.4 | 498 | ✓ | | 1.14.3 | 490 | ✓ | diff --git a/protocol/src/protocol/mod.rs b/protocol/src/protocol/mod.rs index 3ffa6e2..604de1a 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; 18] = [ - 575, 498, 490, 485, 480, 477, 452, 451, 404, 340, 316, 315, 210, 109, 107, 74, 47, 5, +pub const SUPPORTED_PROTOCOLS: [i32; 19] = [ + 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 0cad075..cd8f2e0 100644 --- a/protocol/src/protocol/versions.rs +++ b/protocol/src/protocol/versions.rs @@ -12,7 +12,7 @@ mod v1_14_1; mod v1_14_2; mod v1_14_3; mod v1_14_4; -mod v1_15_1; +mod v1_15; mod v1_7_10; mod v1_8_9; mod v1_9; @@ -24,6 +24,7 @@ mod v1_9_2; pub fn protocol_name_to_protocol_version(s: String) -> i32 { match s.as_ref() { "" => SUPPORTED_PROTOCOLS[0], + "1.15.2" => 578, "1.15.1" => 575, "1.14.4" => 498, "1.14.3" => 490, @@ -60,7 +61,8 @@ pub fn translate_internal_packet_id_for_version( to_internal: bool, ) -> i32 { match version { - 575 => v1_15_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), 490 => v1_14_3::translate_internal_packet_id(state, dir, id, to_internal), 485 => v1_14_2::translate_internal_packet_id(state, dir, id, to_internal), diff --git a/protocol/src/protocol/versions/v1_15_1.rs b/protocol/src/protocol/versions/v1_15.rs similarity index 100% rename from protocol/src/protocol/versions/v1_15_1.rs rename to protocol/src/protocol/versions/v1_15.rs