Bug 359 - Player's input affected when previous player typed something before press "Enter"
Summary: Player's input affected when previous player typed something before press "En...
Status: CONFIRMED
Alias: None
Product: Bro_Doudizhu
Classification: Unclassified
Component: helpers (show other bugs)
Version: v_1.0
Hardware: PC Windows
: Normal normal
Assignee: herrihan0330
URL:
Depends on:
Blocks:
 
Reported: 2019-12-06 13:08 HKT by herrihan0330
Modified: 2019-12-06 20:06 HKT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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();
		}
	}