mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-24 03:05:49 +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;
|
package net.md_5.bungee.forge;
|
||||||
|
|
||||||
|
import com.google.common.base.Preconditions;
|
||||||
import java.util.ArrayDeque;
|
import java.util.ArrayDeque;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
@ -58,6 +59,7 @@ public class ForgeClientHandler
|
|||||||
|
|
||||||
message.setAllowExtendedPacket( true ); // FML allows extended packets so this must be enabled
|
message.setAllowExtendedPacket( true ); // FML allows extended packets so this must be enabled
|
||||||
ForgeClientHandshakeState prevState = state;
|
ForgeClientHandshakeState prevState = state;
|
||||||
|
Preconditions.checkState( packetQueue.size() < 128, "Forge packet queue too big!" );
|
||||||
packetQueue.add( message );
|
packetQueue.add( message );
|
||||||
state = state.send( message, con );
|
state = state.send( message, con );
|
||||||
if ( state != prevState ) // state finished, send packets
|
if ( state != prevState ) // state finished, send packets
|
||||||
|
Loading…
Reference in New Issue
Block a user