Archiviert
13
0

Don't override the network manager list unnecessarily.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2013-12-14 05:02:43 +01:00
Ursprung 85d415de7c
Commit b52ea72903

Datei anzeigen

@ -45,7 +45,7 @@ public class NettyProtocolInjector implements ChannelListener {
// The temporary player factory // The temporary player factory
private TemporaryPlayerFactory playerFactory = new TemporaryPlayerFactory(); private TemporaryPlayerFactory playerFactory = new TemporaryPlayerFactory();
private List<VolatileField> bootstrapFields = Lists.newArrayList(); private List<VolatileField> bootstrapFields = Lists.newArrayList();
private BootstrapList networkManagers; private List<Object> networkManagers;
// Different sending filters // Different sending filters
private PacketTypeSet sendingFilters = new PacketTypeSet(); private PacketTypeSet sendingFilters = new PacketTypeSet();
@ -119,16 +119,16 @@ public class NettyProtocolInjector implements ChannelListener {
for (VolatileField field : bootstrapFields) { for (VolatileField field : bootstrapFields) {
final List<Object> list = (List<Object>) field.getValue(); final List<Object> list = (List<Object>) field.getValue();
final BootstrapList bootstrap = new BootstrapList(list, connectionHandler);
// We don't have to override this list
// Synchronize with each list before we attempt to replace them.
field.setValue(bootstrap);
if (list == networkManagerList) { if (list == networkManagerList) {
// Save it for later // Save it for later
networkManagers = bootstrap; networkManagers = list;
continue; continue;
} }
// Synchronize with each list before we attempt to replace them.
field.setValue(new BootstrapList(list, connectionHandler));
} }
injected = true; injected = true;