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

Commit

Permalink
Add channel limit config
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfriedrich committed Dec 12, 2021
1 parent 2a722b0 commit 1d751eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions proxy/src/main/java/net/md_5/bungee/conf/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class Configuration implements ProxyConfig
private boolean alwaysHandlePackets = false;
private boolean preventProxyConnections;
private boolean forgeSupport;
private int pluginChannelLimit = 128;

public void load()
{
Expand Down Expand Up @@ -102,6 +103,7 @@ public void load()
alwaysHandlePackets = adapter.getBoolean( "always_handle_packets", false );
preventProxyConnections = adapter.getBoolean( "prevent_proxy_connections", preventProxyConnections );
forgeSupport = adapter.getBoolean( "forge_support", forgeSupport );
pluginChannelLimit = adapter.getInt( "registered_plugin_channels_limit", pluginChannelLimit );

disabledCommands = new CaseInsensitiveSet( (Collection<String>) adapter.getList( "disabled_commands", Arrays.asList( "disabledcommandhere" ) ) );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ public void relayMessage(PluginMessage input) throws Exception

for ( String id : content.split( "\0" ) )
{
Preconditions.checkState( registeredChannels.size() < 128, "Too many registered channels" );
Preconditions.checkState( registeredChannels.size() < bungee.getConfig().getPluginChannelLimit(), "Too many registered channels" );
Preconditions.checkArgument( id.length() < 128, "Channel name too long" );

registeredChannels.add( id );
Expand Down

0 comments on commit 1d751eb

Please sign in to comment.