add tools to get server list
parent
0a93a130e3
commit
424af59780
@ -0,0 +1,29 @@
|
||||
package tools;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class HostList{
|
||||
/** Helper to get the server list from the user
|
||||
* @author Louis Royer
|
||||
* @author Flavien Haas
|
||||
* @author JS Auge
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public String[] getServList(){
|
||||
String[] serverList = new String[20];
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
String servName = "";
|
||||
int i = 0;
|
||||
do {
|
||||
System.out.println("Name of the next server:");
|
||||
servName = scanner.nextLine();
|
||||
if (servName != "stop"){
|
||||
serverList[i] = servName;
|
||||
}
|
||||
++i;
|
||||
} while (servName != "stop");
|
||||
return serverList;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue