Merge pull request 'Fix rare TinyProtocol issues' (#236) from rareissues into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: #236 Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Commit
6915b52eef
@ -80,7 +80,7 @@ public class TinyProtocol implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addFilter(Class<?> packetType, BiFunction<Player, Object, Object> filter) {
|
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) {
|
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());
|
return new SecurityException("Could not find channel for player " + player.getName());
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
if(!channel.isActive())
|
||||||
|
return;
|
||||||
|
|
||||||
synchronized (playerInterceptors) {
|
synchronized (playerInterceptors) {
|
||||||
playerInterceptors.put(player, this);
|
playerInterceptors.put(player, this);
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren