Automate the stress testing of a Minecraft server network using bots

Improve stdin handler

PureGero f3867df3 61126232

Changed files
+8 -4
src
main
java
com
github
puregero
minecraftstresstest
+8 -4
src/main/java/com/github/puregero/minecraftstresstest/MinecraftStressTest.java
··· 19 19 Scanner scanner = new Scanner(System.in); 20 20 21 21 while (scanner.hasNext()) { 22 - int botCount = scanner.nextInt(); 23 - 24 - System.out.println("Setting bot count to " + botCount); 22 + String line = scanner.nextLine(); 25 23 26 - updateBotCount(bots, botCount); 24 + try { 25 + int botCount = Integer.parseInt(line); 26 + System.out.println("Setting bot count to " + botCount); 27 + updateBotCount(bots, botCount); 28 + } catch (Exception e) { 29 + e.printStackTrace(); 30 + } 27 31 } 28 32 29 33 System.out.println("stdin ended");