Merge pull request 'Fix synchronisation issues' (#16) from fixSynchro into master
Reviewed-on: #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();
|
||||
|
||||
public static Subserver getSubserver(ProxiedPlayer p){
|
||||
synchronized (serverList) {
|
||||
for(int i = serverList.size()-1; i >= 0; i--){
|
||||
if(serverList.get(i).onServer(p))
|
||||
return serverList.get(i);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Subserver getSubserver(ServerInfo server){
|
||||
synchronized (serverList) {
|
||||
for(Subserver s : serverList)
|
||||
if(s.server == server)
|
||||
return s;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static List<Subserver> getServerList(){
|
||||
@ -179,7 +183,9 @@ public class Subserver implements Runnable {
|
||||
|
||||
public void run(){
|
||||
ProxyServer.getInstance().getServers().put(serverName, server);
|
||||
synchronized (serverList) {
|
||||
serverList.add(this);
|
||||
}
|
||||
|
||||
try(BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))){
|
||||
String line = "";
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren