Improves checking for whether a server should be delayed before starting
All checks were successful
KnarCraft/Minecraft-Server-Launcher/pipeline/head This commit looks good
All checks were successful
KnarCraft/Minecraft-Server-Launcher/pipeline/head This commit looks good
This commit is contained in:
parent
9532683301
commit
5e24d5daa8
@ -326,9 +326,10 @@ public class Server {
|
|||||||
/**
|
/**
|
||||||
* Runs a Minecraft server
|
* Runs a Minecraft server
|
||||||
*
|
*
|
||||||
|
* @param skipDelay <p>Whether to skip the startup delay for this server</p>
|
||||||
* @return <p>True if nothing went wrong</p>
|
* @return <p>True if nothing went wrong</p>
|
||||||
*/
|
*/
|
||||||
public boolean runServer(boolean isFirstServer) {
|
public boolean runServer(boolean skipDelay) {
|
||||||
if (ServerHandler.stoppingServers()) {
|
if (ServerHandler.stoppingServers()) {
|
||||||
gui.logMessage("Stopping servers. Cannot start yet.");
|
gui.logMessage("Stopping servers. Cannot start yet.");
|
||||||
return false;
|
return false;
|
||||||
@ -339,7 +340,7 @@ public class Server {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//Tries to do necessary pre-start work
|
//Tries to do necessary pre-start work
|
||||||
if (!initializeJarDownload() || (!isFirstServer && !delayStartup())) {
|
if (!initializeJarDownload() || (!skipDelay && !delayStartup())) {
|
||||||
gui.logError("Failed to perform startup tasks.");
|
gui.logError("Failed to perform startup tasks.");
|
||||||
this.started = false;
|
this.started = false;
|
||||||
return false;
|
return false;
|
||||||
|
@ -117,9 +117,11 @@ public class ServerHandler {
|
|||||||
public static void startServers() {
|
public static void startServers() {
|
||||||
ServerLauncherController controller = Main.getController();
|
ServerLauncherController controller = Main.getController();
|
||||||
gui.setStatus("Starting servers");
|
gui.setStatus("Starting servers");
|
||||||
int serverNum = 0;
|
Server previouslyStartedServer = null;
|
||||||
|
|
||||||
for (Collection collection : controller.getCurrentProfile().getCollections()) {
|
for (Collection collection : controller.getCurrentProfile().getCollections()) {
|
||||||
if (!collection.getServer().runServer(serverNum++ == 0)) {
|
Server server = collection.getServer();
|
||||||
|
if (!server.runServer(previouslyStartedServer == null || previouslyStartedServer.isProxy())) {
|
||||||
gui.showError("An error occurred. Start aborted. Please check relevant log files.");
|
gui.showError("An error occurred. Start aborted. Please check relevant log files.");
|
||||||
try {
|
try {
|
||||||
stop();
|
stop();
|
||||||
@ -129,6 +131,9 @@ public class ServerHandler {
|
|||||||
gui.updateGUIElementsWhenServersStartOrStop(false);
|
gui.updateGUIElementsWhenServersStartOrStop(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (server.isEnabled()) {
|
||||||
|
previouslyStartedServer = server;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user