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