fixed server-side ConcurrentModificationException
This commit is contained in:
parent
e4afd4dc90
commit
c9a8a59f8d
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -29,7 +29,9 @@ public class WorkerListenThread {
|
||||||
*/
|
*/
|
||||||
public void addPlayer(NetHandler par1NetServerHandler) {
|
public void addPlayer(NetHandler par1NetServerHandler) {
|
||||||
System.out.println("[Server][ADDPLAYER][" + par1NetServerHandler.getClass().getSimpleName() + "]");
|
System.out.println("[Server][ADDPLAYER][" + par1NetServerHandler.getClass().getSimpleName() + "]");
|
||||||
this.connections.add(par1NetServerHandler);
|
synchronized(this.connections) {
|
||||||
|
this.connections.add(par1NetServerHandler);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopListening() {
|
public void stopListening() {
|
||||||
|
@ -79,15 +81,17 @@ public class WorkerListenThread {
|
||||||
* Handles all incoming connections and packets
|
* Handles all incoming connections and packets
|
||||||
*/
|
*/
|
||||||
public void handleNetworkListenThread() {
|
public void handleNetworkListenThread() {
|
||||||
|
synchronized(this.connections) {
|
||||||
deleteDeadConnections();
|
|
||||||
|
deleteDeadConnections();
|
||||||
for (NetHandler var2 : this.connections) {
|
|
||||||
var2.handlePackets();
|
for (NetHandler var2 : this.connections) {
|
||||||
|
var2.handlePackets();
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteDeadConnections();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteDeadConnections();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinecraftServer getServer() {
|
public MinecraftServer getServer() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user