More comments

This commit is contained in:
Kristian Knarvik 2018-02-27 10:58:05 +01:00
parent 2476e379e5
commit cf0d1f7fff
2 changed files with 11 additions and 1 deletions

View File

@ -50,7 +50,6 @@ public class Main {
setup(); setup();
new ServerConsoles(); new ServerConsoles();
Profile.load(); Profile.load();
ScheduledExecutorService exec = Executors.newSingleThreadScheduledExecutor(); ScheduledExecutorService exec = Executors.newSingleThreadScheduledExecutor();
exec.scheduleAtFixedRate(Main::updateConsoles, 10, 500, TimeUnit.MILLISECONDS); exec.scheduleAtFixedRate(Main::updateConsoles, 10, 500, TimeUnit.MILLISECONDS);
} catch (Exception e) { } catch (Exception e) {

View File

@ -42,6 +42,11 @@ public class ServerType {
return serverTypes; return serverTypes;
} }
/**
* Gets a list of all server types' names.
*
* @return A list of strings
*/
public static String[] getTypeNames() { public static String[] getTypeNames() {
ArrayList<ServerType> types = ServerType.getServerTypes(); ArrayList<ServerType> types = ServerType.getServerTypes();
String[] serverTypes = new String[types.size()]; String[] serverTypes = new String[types.size()];
@ -51,6 +56,12 @@ public class ServerType {
return serverTypes; return serverTypes;
} }
/**
* Gets a server type by name.
*
* @param name Then name of the server type
* @return A ServerType
*/
public static ServerType getByName(String name) { public static ServerType getByName(String name) {
for (ServerType serverType : serverTypes) { for (ServerType serverType : serverTypes) {
if (serverType.getName().equals(name)) { if (serverType.getName().equals(name)) {