Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #62 from SpigotMC/master
Browse files Browse the repository at this point in the history
SpigotMC#1930: Don't handle upstream packets if no server connected
  • Loading branch information
sleiss authored Aug 4, 2016
2 parents 9a65016 + 3a0b0aa commit 5565798
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,17 @@ public void disconnected(ChannelWrapper channel) throws Exception
}
}

@Override
public boolean shouldHandle(PacketWrapper packet) throws Exception
{
return con.getServer() != null;
}

@Override
public void handle(PacketWrapper packet) throws Exception
{
con.getEntityRewrite().rewriteServerbound( packet.buf, con.getClientEntityId(), con.getServerEntityId() );
if ( con.getServer() != null )
{
con.getServer().getCh().write( packet );
}
con.getServer().getCh().write( packet );
}

@Override
Expand Down

0 comments on commit 5565798

Please sign in to comment.