Remove debug println in client

This commit is contained in:
Artlef 2020-03-07 12:20:33 +01:00
parent 1ad6215052
commit 7bbf64c964

View File

@ -68,7 +68,6 @@ fn main() {
client.player.role.to_string()
);
}
println!("Fetching initial chess position...");
let mut current_position = fetch_initial_chess_position(&client);
loop {
println!(
@ -226,9 +225,7 @@ fn parse_position(string: &str) -> Chess {
fn prompt_user_for_role(client: &Client, stream: &mut UnixStream) -> Option<UserRole> {
let mut role = None;
loop {
println!("fetching roles from server...");
let available_roles = fetch_available_roles(client);
println!("available roles fetched.");
let mut prompt = String::new();
if !available_roles.contains(&UserRole::White)
&& !available_roles.contains(&UserRole::Black)
@ -269,11 +266,8 @@ fn prompt_user_for_role(client: &Client, stream: &mut UnixStream) -> Option<User
continue;
}
//send info to server
println!("Sending choice {} to server", input);
clichess::write_to_stream(stream, String::from(input)).unwrap();
println!("Sent.");
//get confirmation from server
println!("Get response from server...");
let response = fetch_message_from_server(&client);
if response != "OK" {
println!(
@ -282,7 +276,6 @@ fn prompt_user_for_role(client: &Client, stream: &mut UnixStream) -> Option<User
clichess::write_to_stream(stream, String::from("ACK")).unwrap();
continue;
}
println!("Ok!");
clichess::write_to_stream(stream, String::from("OK")).unwrap();
break;
}