mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-22 10:15:52 +01:00
Set running to TRUE while running start event
This commit is contained in:
parent
59d3404abf
commit
f90a54e636
@ -30,13 +30,13 @@
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiUtil</artifactId>
|
||||
<version>21w08m</version>
|
||||
<version>21w09e</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiEngine</artifactId>
|
||||
<version>21w08m</version>
|
||||
<version>21w09e</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -30,14 +30,14 @@
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiUtil</artifactId>
|
||||
<version>21w08m</version>
|
||||
<version>21w09e</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiEngine</artifactId>
|
||||
<version>21w08m</version>
|
||||
<version>21w09e</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -103,19 +103,22 @@ public class ExternalSubServer extends SubServerImpl {
|
||||
lock = true;
|
||||
SubStartEvent event = new SubStartEvent(player, this);
|
||||
host.plugin.getPluginManager().callEvent(event);
|
||||
lock = false;
|
||||
if (!event.isCancelled()) {
|
||||
Logger.get("SubServers").info("Now starting " + getName());
|
||||
started(null);
|
||||
host.queue(new PacketExEditServer(this, PacketExEditServer.UpdateType.START, logger.getExternalAddress().toString()));
|
||||
return true;
|
||||
} else return false;
|
||||
} else {
|
||||
lock = false;
|
||||
return false;
|
||||
}
|
||||
} else return false;
|
||||
}
|
||||
void started(UUID address) {
|
||||
if (!running) {
|
||||
started = false;
|
||||
running = true;
|
||||
lock = false;
|
||||
logger.start();
|
||||
if (address != null) {
|
||||
if (address != logger.getExternalAddress()) host.queue(new PacketExEditServer(this, PacketExEditServer.UpdateType.SET_LOGGING_ADDRESS, logger.getExternalAddress().toString()));
|
||||
@ -500,7 +503,7 @@ public class ExternalSubServer extends SubServerImpl {
|
||||
|
||||
@Override
|
||||
public boolean isRunning() {
|
||||
return running;
|
||||
return running || lock;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -137,6 +137,7 @@ public class InternalSubServer extends SubServerImpl {
|
||||
}
|
||||
|
||||
private void run() {
|
||||
lock = false;
|
||||
allowrestart = true;
|
||||
started = false;
|
||||
try {
|
||||
@ -213,11 +214,13 @@ public class InternalSubServer extends SubServerImpl {
|
||||
lock = true;
|
||||
SubStartEvent event = new SubStartEvent(player, this);
|
||||
host.plugin.getPluginManager().callEvent(event);
|
||||
lock = false;
|
||||
if (!event.isCancelled()) {
|
||||
(thread = new Thread(this::run, "SubServers.Bungee::Internal_Server_Process_Handler(" + getName() + ')')).start();
|
||||
return true;
|
||||
} else return false;
|
||||
} else {
|
||||
lock = false;
|
||||
return false;
|
||||
}
|
||||
} else return false;
|
||||
}
|
||||
|
||||
@ -560,7 +563,7 @@ public class InternalSubServer extends SubServerImpl {
|
||||
|
||||
@Override
|
||||
public boolean isRunning() {
|
||||
return process != null && process.isAlive();
|
||||
return (process != null && process.isAlive()) || lock;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -48,7 +48,7 @@
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiUtil</artifactId>
|
||||
<version>21w08m</version>
|
||||
<version>21w09e</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
@ -20,7 +20,7 @@
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiUtil</artifactId>
|
||||
<version>21w08m</version>
|
||||
<version>21w09e</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -30,7 +30,7 @@
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiUtil</artifactId>
|
||||
<version>21w08m</version>
|
||||
<version>21w09e</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
@ -33,14 +33,14 @@
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiEngine</artifactId>
|
||||
<version>21w08m</version>
|
||||
<version>21w09e</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiUI</artifactId>
|
||||
<version>21w08m</version>
|
||||
<version>21w09e</version>
|
||||
<scope>runtime</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
@ -30,14 +30,14 @@
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiUtil</artifactId>
|
||||
<version>21w08m</version>
|
||||
<version>21w09e</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiEngine</artifactId>
|
||||
<version>21w08m</version>
|
||||
<version>21w09e</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
Loading…
Reference in New Issue
Block a user