SteamWar/SpigotCore
Archiviert
13
0

Fix rare TinyProtocol issues #236

Zusammengeführt
Lixfel hat 1 Commits von rareissues nach master 2023-04-11 11:08:22 +02:00 zusammengeführt
Nur Änderungen aus Commit 0af0d6c5f9 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -80,7 +80,7 @@ public class TinyProtocol implements Listener {
}
public void addFilter(Class<?> packetType, BiFunction<Player, Object, Object> filter) {
packetFilters.computeIfAbsent(packetType, c -> new ArrayList<>(1)).add(filter);
packetFilters.computeIfAbsent(packetType, c -> Collections.synchronizedList(new ArrayList<>(1))).add(filter);
}
public void removeFilter(Class<?> packetType, BiFunction<Player, Object, Object> filter) {
@ -128,6 +128,9 @@ public class TinyProtocol implements Listener {
return new SecurityException("Could not find channel for player " + player.getName());
}));
if(!channel.isActive())
return;
synchronized (playerInterceptors) {
playerInterceptors.put(player, this);
}