Support Transfer
This commit is contained in:
1 parent
80477f9aab
commit
0ce03c0497
3 files changed
+5
-4
No files matched your search
@@ -3,7 +3,6 @@ use pumpkin_macros::packet;
|
|||||||
use crate::slot::Slot;
|
use crate::slot::Slot;
|
||||||
|
|
||||||
#[derive(serde::Deserialize, Debug)]
|
#[derive(serde::Deserialize, Debug)]
|
||||||
#[allow(dead_code)]
|
|
||||||
#[packet(0x32)]
|
#[packet(0x32)]
|
||||||
pub struct SSetCreativeSlot {
|
pub struct SSetCreativeSlot {
|
||||||
pub slot: i16,
|
pub slot: i16,
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ impl Client {
|
|||||||
dbg!("handshake");
|
dbg!("handshake");
|
||||||
self.protocol_version = handshake.protocol_version.0;
|
self.protocol_version = handshake.protocol_version.0;
|
||||||
self.connection_state = handshake.next_state;
|
self.connection_state = handshake.next_state;
|
||||||
if self.connection_state == ConnectionState::Login {
|
if self.connection_state != ConnectionState::Status {
|
||||||
let protocol = self.protocol_version;
|
let protocol = self.protocol_version;
|
||||||
match protocol.cmp(&(CURRENT_MC_PROTOCOL as i32)) {
|
match protocol.cmp(&(CURRENT_MC_PROTOCOL as i32)) {
|
||||||
std::cmp::Ordering::Less => {
|
std::cmp::Ordering::Less => {
|
||||||
@@ -65,7 +65,7 @@ impl Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_login_start(&mut self, server: &mut Server, login_start: SLoginStart) {
|
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) {
|
if !Self::is_valid_player_name(&login_start.name) {
|
||||||
self.kick("Invalid characters in username");
|
self.kick("Invalid characters in username");
|
||||||
|
|||||||
@@ -180,7 +180,9 @@ impl Client {
|
|||||||
packet.id.0
|
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 => {
|
SLoginStart::PACKET_ID => {
|
||||||
self.handle_login_start(server, SLoginStart::read(bytebuf).unwrap())
|
self.handle_login_start(server, SLoginStart::read(bytebuf).unwrap())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user