Skip to content

Commit

Permalink
Typo and method name adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
Outfluencer authored Feb 13, 2025
1 parent a747b32 commit 9bbd111
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
try
{
// check if the player exceeds packet limits, put inside try final, so we always release.
if ( limiter != null && !limiter.received( packet.buf.readableBytes() ) )
if ( limiter != null && !limiter.incrementAndCheck( packet.buf.readableBytes() ) )
{
// we shouldn't tell the player what limits he exceeds by default
// but if someone applies custom mess we should allow them to display counter and bytes
// but if someone applies custom message we should allow them to display counter and bytes
channel.close( handler instanceof UpstreamBridge ? new Kick( TextComponent.fromLegacy( ProxyServer.getInstance().getTranslation( "packet_limit_kick", limiter.getCounter(), limiter.getDataCounter() ) ) ) : null );
// but the server admin should know
ProxyServer.getInstance().getLogger().log( Level.WARNING, "{0} exceeded packet limit ({1} packets and {2} bytes per second)", new Object[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class PacketLimiter
* @param size size of the packet
* @return return false if the player should be kicked
*/
public boolean received(int size)
public boolean incrementAndCheck(int size)
{
counter++;
dataCounter += size;
Expand Down

0 comments on commit 9bbd111

Please sign in to comment.