mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-24 17:47:41 +01:00
#2420: Cap forge packet queue size
This commit is contained in:
parent
e93323ddbc
commit
88bacf12a3
@ -1,5 +1,6 @@
|
||||
package net.md_5.bungee.forge;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Map;
|
||||
import lombok.AccessLevel;
|
||||
@ -58,6 +59,7 @@ public class ForgeClientHandler
|
||||
|
||||
message.setAllowExtendedPacket( true ); // FML allows extended packets so this must be enabled
|
||||
ForgeClientHandshakeState prevState = state;
|
||||
Preconditions.checkState( packetQueue.size() < 128, "Forge packet queue too big!" );
|
||||
packetQueue.add( message );
|
||||
state = state.send( message, con );
|
||||
if ( state != prevState ) // state finished, send packets
|
||||
|
Loading…
Reference in New Issue
Block a user