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