Skip to content

Commit

Permalink
properly allow other initial packets through
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Dec 2, 2019
1 parent d2d454d commit 53304dc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
Expand Up @@ -98,7 +98,7 @@ public void registerPackets() {
}

public void sendPacket(PacketOut packet) {
if (!connected && !(packet instanceof MyInfoPacketOut)) {
if (!connected && !packet.canBeFirstPacket) {
Debug.echoError("BungeeBridge tried to send packet while not connected.");
return;
}
Expand Down
Expand Up @@ -5,6 +5,8 @@

public abstract class PacketOut {

public boolean canBeFirstPacket = false;

public abstract int getPacketId();

public abstract void writeTo(ByteBuf buf);
Expand Down
Expand Up @@ -7,6 +7,7 @@ public class ControlsProxyCommandPacketOut extends PacketOut {

public ControlsProxyCommandPacketOut(boolean control) {
this.control = control;
canBeFirstPacket = true;
}

public boolean control;
Expand Down
Expand Up @@ -7,6 +7,7 @@ public class ControlsProxyPingPacketOut extends PacketOut {

public ControlsProxyPingPacketOut(boolean control) {
this.control = control;
canBeFirstPacket = true;
}

public boolean control;
Expand Down
Expand Up @@ -7,6 +7,7 @@ public class MyInfoPacketOut extends PacketOut {

public MyInfoPacketOut(int port) {
this.port = port;
canBeFirstPacket = true;
}

public int port;
Expand Down

0 comments on commit 53304dc

Please sign in to comment.