mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Fix recursive connection call causing StackOverflowException
This was probably caused by the rename sendPacket->send and dispatchPacket->sendPacket
This commit is contained in:
parent
713d787f98
commit
06da1d1d48
1 changed files with 3 additions and 4 deletions
|
@ -106,9 +106,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public void send(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> callback) {
|
||||
- if (this.isConnected()) {
|
||||
- this.flushQueue();
|
||||
- this.sendPacket(packet, callback);
|
||||
- } else {
|
||||
- this.queue.add(new Connection.PacketHolder(packet, callback));
|
||||
+ // Paper start - handle oversized packets better
|
||||
+ boolean connected = this.isConnected();
|
||||
+ if (!connected && !preparing) {
|
||||
|
@ -119,7 +116,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ net.minecraft.server.MCUtil.isMainThread() && packet.isReady() && this.queue.isEmpty() &&
|
||||
+ (packet.getExtraPackets() == null || packet.getExtraPackets().isEmpty())
|
||||
+ ))) {
|
||||
+ this.send(packet, callback);
|
||||
this.sendPacket(packet, callback);
|
||||
- } else {
|
||||
- this.queue.add(new Connection.PacketHolder(packet, callback));
|
||||
+ return;
|
||||
}
|
||||
+ // write the packets to the queue, then flush - antixray hooks there already
|
||||
|
|
Loading…
Reference in a new issue