diff --git a/chat-cli/src/main.rs b/chat-cli/src/main.rs index f8d114c7fc..d01c87aa49 100644 --- a/chat-cli/src/main.rs +++ b/chat-cli/src/main.rs @@ -48,7 +48,9 @@ fn main() { println!("Players online: {:?}", client.get_players()); - client.register(comp::Player::new(username, None), password).unwrap(); + client + .register(comp::Player::new(username, None), password) + .unwrap(); let (tx, rx) = mpsc::channel(); thread::spawn(move || loop { diff --git a/client/src/lib.rs b/client/src/lib.rs index 1fb2903464..b0b4356e4d 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -8,7 +8,7 @@ pub use specs::{join::Join, saveload::Marker, Entity as EcsEntity, ReadStorage}; use common::{ comp, - msg::{ClientMsg, ClientState, ServerError, ServerInfo, ServerMsg, RequestStateError}, + msg::{ClientMsg, ClientState, RequestStateError, ServerError, ServerInfo, ServerMsg}, net::PostBox, state::{State, Uid}, terrain::{block::Block, chonk::ChonkMetrics, TerrainChunk, TerrainChunkSize}, @@ -132,10 +132,12 @@ impl Client { } /// Request a state transition to `ClientState::Registered`. - pub fn register(&mut self, player: comp::Player, password: String) /*-> Result<(), Error>*/ { - self.postbox.send_message(ClientMsg::Register { player, password }); + pub fn register(&mut self, player: comp::Player, password: String) /*-> Result<(), Error>*/ + { + self.postbox + .send_message(ClientMsg::Register { player, password }); self.client_state = ClientState::Pending; - /*loop { + /*loop { match self.postbox.next_message() { Some(ServerMsg::StateAnswer(Err((RequestStateError::Denied, _)))) => { println!("Got a bad"); @@ -149,7 +151,7 @@ impl Client { println!("Got unusual message: {:?}", x); } None => { println!("Got nothing?"); }, - + } }*/ } diff --git a/server/src/lib.rs b/server/src/lib.rs index b6f32c6a40..8d0c130105 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -26,7 +26,7 @@ use log::debug; use rand::Rng; use specs::{join::Join, world::EntityBuilder as EcsEntityBuilder, Builder, Entity as EcsEntity}; use std::{ - collections::{HashSet, HashMap}, + collections::{HashMap, HashSet}, i32, net::SocketAddr, sync::{mpsc, Arc}, @@ -535,7 +535,6 @@ impl Server { break; } } else { - player.alias, password); accounts.insert(player.alias.clone(), password); } match client.client_state { diff --git a/voxygen/src/menu/main/client_init.rs b/voxygen/src/menu/main/client_init.rs index 8896f62095..53db4ab3d1 100644 --- a/voxygen/src/menu/main/client_init.rs +++ b/voxygen/src/menu/main/client_init.rs @@ -30,7 +30,12 @@ pub struct ClientInit { rx: Receiver>, } impl ClientInit { - pub fn new(connection_args: (String, u16, bool), player: comp::Player, password: String, wait: bool) -> Self { + pub fn new( + connection_args: (String, u16, bool), + player: comp::Player, + password: String, + wait: bool, + ) -> Self { let (server_address, default_port, prefer_ipv6) = connection_args; let (tx, rx) = channel();