Support Transfer
This commit is contained in:
parent
80477f9aab
commit
0ce03c0497
@ -3,7 +3,6 @@ use pumpkin_macros::packet;
|
||||
use crate::slot::Slot;
|
||||
|
||||
#[derive(serde::Deserialize, Debug)]
|
||||
#[allow(dead_code)]
|
||||
#[packet(0x32)]
|
||||
pub struct SSetCreativeSlot {
|
||||
pub slot: i16,
|
||||
|
||||
@ -36,7 +36,7 @@ impl Client {
|
||||
dbg!("handshake");
|
||||
self.protocol_version = handshake.protocol_version.0;
|
||||
self.connection_state = handshake.next_state;
|
||||
if self.connection_state == ConnectionState::Login {
|
||||
if self.connection_state != ConnectionState::Status {
|
||||
let protocol = self.protocol_version;
|
||||
match protocol.cmp(&(CURRENT_MC_PROTOCOL as i32)) {
|
||||
std::cmp::Ordering::Less => {
|
||||
@ -65,7 +65,7 @@ impl Client {
|
||||
}
|
||||
|
||||
pub fn handle_login_start(&mut self, server: &mut Server, login_start: SLoginStart) {
|
||||
dbg!("login start");
|
||||
log::debug!("login start, State {:?}", self.connection_state);
|
||||
|
||||
if !Self::is_valid_player_name(&login_start.name) {
|
||||
self.kick("Invalid characters in username");
|
||||
|
||||
@ -180,7 +180,9 @@ impl Client {
|
||||
packet.id.0
|
||||
),
|
||||
},
|
||||
pumpkin_protocol::ConnectionState::Login => match packet.id.0 {
|
||||
// TODO: Check config if transfer is enabled
|
||||
pumpkin_protocol::ConnectionState::Login
|
||||
| pumpkin_protocol::ConnectionState::Transfer => match packet.id.0 {
|
||||
SLoginStart::PACKET_ID => {
|
||||
self.handle_login_start(server, SLoginStart::read(bytebuf).unwrap())
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user