removed unwraps
This commit is contained in:
1 parent
4f17b96f1d
commit
d35461eea1
2 files changed
+7
-8
No files matched your search
@@ -20,7 +20,7 @@ use uuid::Uuid;
|
|||||||
use crate::{
|
use crate::{
|
||||||
client::authentication::{self, validate_textures, GameProfile},
|
client::authentication::{self, validate_textures, GameProfile},
|
||||||
entity::player::{ChatMode, Hand},
|
entity::player::{ChatMode, Hand},
|
||||||
proxy::{bungeecord::bungeecord_login, velocity::velocity_login},
|
proxy::{bungeecord::bungeecord_login, velocity::{receive_plugin_response, velocity_login}},
|
||||||
server::{Server, CURRENT_MC_VERSION},
|
server::{Server, CURRENT_MC_VERSION},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -225,22 +225,21 @@ impl Client {
|
|||||||
) -> Result<(), DeserializerError> {
|
) -> Result<(), DeserializerError> {
|
||||||
println!("{:?}", self.connection_state.load());
|
println!("{:?}", self.connection_state.load());
|
||||||
match self.connection_state.load() {
|
match self.connection_state.load() {
|
||||||
pumpkin_protocol::ConnectionState::HandShake => self.handle_handshake_packet(packet).unwrap(),
|
pumpkin_protocol::ConnectionState::HandShake => self.handle_handshake_packet(packet),
|
||||||
pumpkin_protocol::ConnectionState::Status => self.handle_status_packet(server, packet).unwrap(),
|
pumpkin_protocol::ConnectionState::Status => self.handle_status_packet(server, packet),
|
||||||
// TODO: Check config if transfer is enabled
|
// TODO: Check config if transfer is enabled
|
||||||
pumpkin_protocol::ConnectionState::Login
|
pumpkin_protocol::ConnectionState::Login
|
||||||
| pumpkin_protocol::ConnectionState::Transfer => {
|
| pumpkin_protocol::ConnectionState::Transfer => {
|
||||||
self.handle_login_packet(server, packet).await.unwrap()
|
self.handle_login_packet(server, packet).await
|
||||||
}
|
}
|
||||||
pumpkin_protocol::ConnectionState::Config => {
|
pumpkin_protocol::ConnectionState::Config => {
|
||||||
self.handle_config_packet(server, packet).await.unwrap()
|
self.handle_config_packet(server, packet).await
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
log::error!("Invalid Connection state {:?}", self.connection_state);
|
log::error!("Invalid Connection state {:?}", self.connection_state);
|
||||||
// Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_handshake_packet(&self, packet: &mut RawPacket) -> Result<(), DeserializerError> {
|
fn handle_handshake_packet(&self, packet: &mut RawPacket) -> Result<(), DeserializerError> {
|
||||||
|
|||||||
Reference in new issue
Block a user