1
0

Fix Uniqueness issues

Dieser Commit ist enthalten in:
Lixfel 2024-01-19 20:21:52 +01:00
Ursprung 355218c761
Commit cd8706b67f
4 geänderte Dateien mit 8 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;
}

Datei anzeigen

@ -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;
}

Datei anzeigen

@ -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);