2018-01-28 19:06:50 +01:00
|
|
|
import net.knarcraft.serverlauncher.profile.Profile;
|
2018-01-29 20:14:17 +01:00
|
|
|
import net.knarcraft.serverlauncher.server.ServerType;
|
2018-01-26 20:26:16 +01:00
|
|
|
import net.knarcraft.serverlauncher.userinterface.GUI;
|
2018-01-30 19:35:42 +01:00
|
|
|
import net.knarcraft.serverlauncher.userinterface.ServerConsoles;
|
2018-01-26 20:26:16 +01:00
|
|
|
|
2018-01-25 17:34:45 +01:00
|
|
|
import javax.naming.ConfigurationException;
|
2018-01-27 23:34:02 +01:00
|
|
|
import java.awt.*;
|
2018-01-30 00:44:03 +01:00
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
import java.util.concurrent.ScheduledExecutorService;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
2018-01-29 20:14:17 +01:00
|
|
|
//Java 8 required.
|
2018-01-24 12:18:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A software for managing Minecraft servers.
|
2018-01-25 21:17:02 +01:00
|
|
|
*
|
|
|
|
* @author Kristian Knarvik <kristian.knarvik@knett.no>
|
|
|
|
* @version 0.0.0.1
|
|
|
|
* @since 0.0.0.1
|
2018-01-24 12:18:06 +01:00
|
|
|
*/
|
2018-01-26 23:15:19 +01:00
|
|
|
|
2018-01-26 20:34:15 +01:00
|
|
|
class Main {
|
2018-01-23 23:39:37 +01:00
|
|
|
public static void main(String[] args) {
|
2018-01-27 23:34:02 +01:00
|
|
|
EventQueue.invokeLater(() -> {
|
|
|
|
try {
|
|
|
|
setup();
|
2018-01-28 19:06:50 +01:00
|
|
|
new GUI();
|
2018-01-31 17:40:28 +01:00
|
|
|
new ServerConsoles();
|
2018-01-28 19:06:50 +01:00
|
|
|
Profile.addProfile("Default");
|
2018-01-30 00:44:03 +01:00
|
|
|
//TODO: replace with profiles loading generating a default profile if empty.
|
|
|
|
|
|
|
|
ScheduledExecutorService exec = Executors.newSingleThreadScheduledExecutor();
|
|
|
|
exec.scheduleAtFixedRate(() -> {
|
2018-01-30 19:46:14 +01:00
|
|
|
//TODO: Read from consoles and insert into ServerConsoles.
|
2018-01-30 00:44:03 +01:00
|
|
|
}, 0, 5, TimeUnit.SECONDS);
|
2018-01-27 23:34:02 +01:00
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
});
|
2018-01-25 21:17:02 +01:00
|
|
|
}
|
|
|
|
|
2018-01-26 20:34:15 +01:00
|
|
|
private static void setup() {
|
2018-01-25 17:34:45 +01:00
|
|
|
try {
|
2018-01-25 21:17:02 +01:00
|
|
|
ServerType.loadServerTypes();
|
2018-01-25 17:34:45 +01:00
|
|
|
} catch (ConfigurationException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
System.exit(1);
|
|
|
|
}
|
2018-01-23 23:39:37 +01:00
|
|
|
}
|
|
|
|
}
|