geforkt von SteamWar/PersistentBungeeCore
Merge pull request 'Fix synchronisation issues' (#16) from fixSynchro into master
Reviewed-on: SteamWar/PersistentBungeeCore#16 Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Commit
272fa2eba0
@ -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