use of de.dytanic.cloudnetcore.util.defaults.LobbyGroup in project CloudNet by Dytanic.
the class CloudConfig method defaultInitDoc.
private void defaultInitDoc(ConsoleReader consoleReader) throws Exception {
if (Files.exists(servicePath))
return;
String hostName = NetworkUtils.getHostName();
if (hostName.equals("127.0.0.1") || hostName.equalsIgnoreCase("127.0.1.1") || hostName.split("\\.").length != 4) {
String input;
System.out.println("Please write the first Wrapper IP address:");
while ((input = consoleReader.readLine()) != null) {
if ((input.equals("127.0.0.1") || input.equalsIgnoreCase("127.0.1.1") || input.split("\\.").length != 4)) {
System.out.println("Please write the real ip address :)");
continue;
}
hostName = input;
break;
}
}
new Document("wrapper", Arrays.asList(new WrapperMeta("Wrapper-1", hostName, "admin"))).append("proxyGroups", Arrays.asList(new BungeeGroup())).saveAsConfig(servicePath);
new Document("group", new LobbyGroup()).saveAsConfig(Paths.get("groups/Lobby.json"));
}
Aggregations