1.15.2 (578) protocol support (#338)

v1_15 is now used for both 1.15.1 and 1.15.2.

No protocol changes except ChangeGameState reason code values
This commit is contained in:
iceiix 2020-06-27 14:44:22 -07:00 committed by GitHub
parent e0d5d205c1
commit 85b9774f21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

View File

@ -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 | ✓ |

View File

@ -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]);

View File

@ -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),