Bug 359

Summary: Player's input affected when previous player typed something before press "Enter"
Product: Bro_Doudizhu Reporter: herrihan0330
Component: helpersAssignee: herrihan0330
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: v_1.0   
Hardware: PC   
OS: Windows   

Description herrihan0330 2019-12-06 13:08:50 HKT
If the last player typed some characters before he pressed enter, which is used to turning to the next player. These characters will be added to next player's input, therefore being affected and may produce incorrect input.
Comment 1 herrihan0330 2019-12-06 20:06:02 HKT
Thanks for your report! The bugs have been fixed by clearing input stream before asking player to press "Enter":

Messenger.java:

public void waiting() {
		print("Press ENTER to continue ...");
		try {
			while (System.in.read() != '\n')
				;
		} catch (IOException e) {
			e.printStackTrace();
		}
	}