Clear Packet Queue on Disconnect
By: md_5 <git@md-5.net>
This commit is contained in:
parent
c4f3fcfce9
commit
93fea68749
2 changed files with 9 additions and 1 deletions
|
@ -73,3 +73,11 @@
|
||||||
public void write(ChannelHandlerContext channelhandlercontext, Object object, ChannelPromise channelpromise) throws Exception {
|
public void write(ChannelHandlerContext channelhandlercontext, Object object, ChannelPromise channelpromise) throws Exception {
|
||||||
super.write(channelhandlercontext, object, channelpromise);
|
super.write(channelhandlercontext, object, channelpromise);
|
||||||
}
|
}
|
||||||
|
@@ -661,6 +674,7 @@
|
||||||
|
|
||||||
|
packetlistener1.onDisconnect(disconnectiondetails);
|
||||||
|
}
|
||||||
|
+ this.pendingActions.clear(); // Free up packet queue.
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -197,7 +197,7 @@
|
||||||
|
|
||||||
public void send(Packet<?> packet, @Nullable PacketSendListener callbacks) {
|
public void send(Packet<?> packet, @Nullable PacketSendListener callbacks) {
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ if (packet == null) {
|
+ if (packet == null || this.processedDisconnect) { // Spigot
|
||||||
+ return;
|
+ return;
|
||||||
+ } else if (packet instanceof ClientboundSetDefaultSpawnPositionPacket) {
|
+ } else if (packet instanceof ClientboundSetDefaultSpawnPositionPacket) {
|
||||||
+ ClientboundSetDefaultSpawnPositionPacket packet6 = (ClientboundSetDefaultSpawnPositionPacket) packet;
|
+ ClientboundSetDefaultSpawnPositionPacket packet6 = (ClientboundSetDefaultSpawnPositionPacket) packet;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue