geforkt von SteamWar/PersistentBungeeCore
Fix synchronisation issues
Dieser Commit ist enthalten in:
Ursprung
ad94e77042
Commit
8acdd3cb7f
@ -46,16 +46,20 @@ public class Subserver implements Runnable {
|
|||||||
private static final Logger logger = ProxyServer.getInstance().getLogger();
|
private static final Logger logger = ProxyServer.getInstance().getLogger();
|
||||||
|
|
||||||
public static Subserver getSubserver(ProxiedPlayer p){
|
public static Subserver getSubserver(ProxiedPlayer p){
|
||||||
|
synchronized (serverList) {
|
||||||
for(int i = serverList.size()-1; i >= 0; i--){
|
for(int i = serverList.size()-1; i >= 0; i--){
|
||||||
if(serverList.get(i).onServer(p))
|
if(serverList.get(i).onServer(p))
|
||||||
return serverList.get(i);
|
return serverList.get(i);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public static Subserver getSubserver(ServerInfo server){
|
public static Subserver getSubserver(ServerInfo server){
|
||||||
|
synchronized (serverList) {
|
||||||
for(Subserver s : serverList)
|
for(Subserver s : serverList)
|
||||||
if(s.server == server)
|
if(s.server == server)
|
||||||
return s;
|
return s;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public static List<Subserver> getServerList(){
|
public static List<Subserver> getServerList(){
|
||||||
@ -179,7 +183,9 @@ public class Subserver implements Runnable {
|
|||||||
|
|
||||||
public void run(){
|
public void run(){
|
||||||
ProxyServer.getInstance().getServers().put(serverName, server);
|
ProxyServer.getInstance().getServers().put(serverName, server);
|
||||||
|
synchronized (serverList) {
|
||||||
serverList.add(this);
|
serverList.add(this);
|
||||||
|
}
|
||||||
|
|
||||||
try(BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))){
|
try(BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))){
|
||||||
String line = "";
|
String line = "";
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren