Dieser Commit ist enthalten in:
Ursprung
355218c761
Commit
cd8706b67f
@ -10,7 +10,7 @@ public class Arenaserver extends Subserver {
|
||||
private final boolean allowMerge;
|
||||
|
||||
public Arenaserver(String serverName, String mode, String map, boolean allowMerge, int port, ProcessBuilder processBuilder, Runnable shutdownCallback) {
|
||||
super(Servertype.ARENA, serverName, port, processBuilder, shutdownCallback);
|
||||
super(Servertype.ARENA, serverName, port, processBuilder, shutdownCallback, null);
|
||||
this.mode = mode;
|
||||
this.map = map;
|
||||
this.allowMerge = allowMerge;
|
||||
|
@ -38,7 +38,7 @@ public class Bauserver extends Subserver {
|
||||
private final UUID owner;
|
||||
|
||||
public Bauserver(String serverName, UUID owner, int port, ProcessBuilder processBuilder, Runnable shutdownCallback){
|
||||
super(Servertype.BAUSERVER, serverName, port, processBuilder, shutdownCallback);
|
||||
super(Servertype.BAUSERVER, serverName, port, processBuilder, shutdownCallback, null);
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class Builderserver extends Subserver {
|
||||
|
||||
private final String map;
|
||||
public Builderserver(String serverName, String map, int port, ProcessBuilder processBuilder, Runnable shutdownCallback){
|
||||
super(Servertype.BUILDER, serverName, port, processBuilder, shutdownCallback);
|
||||
super(Servertype.BUILDER, serverName, port, processBuilder, shutdownCallback, null);
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ public class Subserver {
|
||||
|
||||
@Getter
|
||||
private static final List<Subserver> serverList = new LinkedList<>();
|
||||
private static final Map<ServerInfo, Subserver> infoToServer = new HashMap<>();
|
||||
private static final Map<String, Subserver> infoToServer = new HashMap<>();
|
||||
|
||||
public static Subserver getSubserver(ProxiedPlayer p) {
|
||||
synchronized (serverList) {
|
||||
@ -61,7 +61,7 @@ public class Subserver {
|
||||
|
||||
public static Subserver getSubserver(ServerInfo server) {
|
||||
synchronized (serverList) {
|
||||
return infoToServer.get(server);
|
||||
return infoToServer.get(server.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,11 +90,7 @@ public class Subserver {
|
||||
@Getter
|
||||
private final Map<ProxiedPlayer, String> tablistNames = new HashMap<>();
|
||||
|
||||
public Subserver(Servertype type, String serverName, int port, ProcessBuilder processBuilder, Runnable shutdownCallback){
|
||||
this(type, serverName, port, processBuilder, shutdownCallback, null);
|
||||
}
|
||||
|
||||
public Subserver(Servertype type, String serverName, int port, ProcessBuilder processBuilder, Runnable shutdownCallback, Consumer<Exception> failureCallback) {
|
||||
protected Subserver(Servertype type, String serverName, int port, ProcessBuilder processBuilder, Runnable shutdownCallback, Consumer<Exception> failureCallback) {
|
||||
this.started = false;
|
||||
this.serverName = serverName;
|
||||
this.type = type;
|
||||
@ -188,13 +184,13 @@ public class Subserver {
|
||||
servers.put(serverName, server);
|
||||
synchronized (serverList) {
|
||||
serverList.add(this);
|
||||
infoToServer.put(server, this);
|
||||
infoToServer.put(serverName, this);
|
||||
}
|
||||
}
|
||||
|
||||
protected void unregister() {
|
||||
synchronized (serverList){
|
||||
infoToServer.remove(server);
|
||||
infoToServer.remove(serverName);
|
||||
serverList.remove(this);
|
||||
}
|
||||
servers.remove(serverName);
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren