Archiviert
13
0

Correct a bug that would lead to IllegalStateException in plugins.

This was caused by the fact that "requireInputBuffer" used 
findLegacy(int) to get the correct PacketType, instead of 
findLegacy(int, Sender.CLIENT). The latter is justified by the fact 
that only client-side packets require an input buffer.
Dieser Commit ist enthalten in:
Kristian S. Stangeland 2014-05-11 15:33:15 +02:00
Ursprung d415bd7643
Commit 818ac5cbde
3 geänderte Dateien mit 7 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -591,7 +591,7 @@ public final class PacketFilterManager implements ProtocolManager, ListenerInvok
@Override
public boolean requireInputBuffer(int packetId) {
return inputBufferedPackets.contains(PacketType.findLegacy(packetId));
return inputBufferedPackets.contains(PacketType.findLegacy(packetId, Sender.CLIENT));
}
/**

Datei anzeigen

@ -361,7 +361,8 @@ class ProxyPacketInjector implements PacketInjector {
// Remove every packet handler
for (Integer id : previous.keySet().toArray(new Integer[0])) {
removePacketHandler(PacketType.findLegacy(id));
removePacketHandler(PacketType.findLegacy(id, Sender.CLIENT));
removePacketHandler(PacketType.findLegacy(id, Sender.SERVER));
}
overwritten.clear();

Datei anzeigen

@ -697,8 +697,10 @@ class ProxyPlayerInjectionHandler implements PlayerInjectionHandler {
);
// These are illegal
for (int packetID : result.getPackets())
removePacketHandler(PacketType.findLegacy(packetID));
for (int packetID : result.getPackets()) {
removePacketHandler(PacketType.findLegacy(packetID, Sender.CLIENT));
removePacketHandler(PacketType.findLegacy(packetID, Sender.SERVER));
}
}
}
}