(misc:LunarCore.java) format

This commit is contained in:
KingRainbow44
2023-11-26 00:29:57 -05:00
parent 0ec6117bc5
commit 828f29d657

View File

@@ -26,7 +26,7 @@ import lombok.Getter;
public class LunarCore {
private static final Logger log = (Logger) LoggerFactory.getLogger(LunarCore.class);
private static File configFile = new File("./config.json");
private static Config config;
@Getter private static Config config;
@Getter private static DatabaseManager accountDatabase;
@Getter private static DatabaseManager gameDatabase;
@@ -100,17 +100,27 @@ public class LunarCore {
}
}
// Start Database(s)
LunarCore.initDatabases();
try {
// Start Database(s)
LunarCore.initDatabases();
} catch (Exception exception) {
LunarCore.getLogger().error("Unable to start the database(s).", exception);
}
// Always run http server as it is needed by for dispatch and gateserver
httpServer = new HttpServer(serverType);
httpServer.start();
try {
// Always run http server as it is needed by for dispatch and gateserver
httpServer = new HttpServer(serverType);
httpServer.start();
} catch (Exception exception) {
LunarCore.getLogger().error("Unable to start the HTTP server.", exception);
}
// Start game server
if (serverType.runGame()) {
if (serverType.runGame()) try {
gameServer = new GameServer(getConfig().getGameServer());
gameServer.start();
} catch (Exception exception) {
LunarCore.getLogger().error("Unable to start the game server.", exception);
}
// Hook into shutdown event
@@ -120,10 +130,6 @@ public class LunarCore {
LunarCore.startConsole();
}
public static Config getConfig() {
return config;
}
public static Logger getLogger() {
return log;
}
@@ -222,7 +228,7 @@ public class LunarCore {
private final int flags;
private ServerType(int flags) {
ServerType(int flags) {
this.flags = flags;
}