Skip to content

Commit

Permalink
minecraft/packet.go: Fix incorrect disconnect logic (#198)
Browse files Browse the repository at this point in the history
This typo caused disconnections when receiving invalid packets, whether you had it enabled or not.
  • Loading branch information
UnknownOre authored Sep 17, 2023
1 parent b290697 commit d1aa718
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion minecraft/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (p *packetData) decode(conn *Conn) (pks []packet.Packet, err error) {
if err == nil {
return
}
if _, ok := err.(unknownPacketError); ok || conn.disconnectOnInvalidPacket {
if _, ok := err.(unknownPacketError); ok && conn.disconnectOnInvalidPacket {
_ = conn.Close()
}
}()
Expand Down

0 comments on commit d1aa718

Please sign in to comment.