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 #222 from SpigotMC/master
Browse files Browse the repository at this point in the history
Merge with SpigotMC.
  • Loading branch information
sleiss authored Aug 29, 2018
2 parents 8f5e906 + ba07397 commit d472c1f
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
3 changes: 3 additions & 0 deletions protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ public static class DirectionData
linkedProtocols.put( ProtocolConstants.MINECRAFT_1_12_1, Arrays.asList(
ProtocolConstants.MINECRAFT_1_12_2
) );
linkedProtocols.put( ProtocolConstants.MINECRAFT_1_13, Arrays.asList(
ProtocolConstants.MINECRAFT_1_13_1
) );
}

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class ProtocolConstants
public static final int MINECRAFT_1_12_1 = 338;
public static final int MINECRAFT_1_12_2 = 340;
public static final int MINECRAFT_1_13 = 393;
public static final int MINECRAFT_1_13_1 = 401;
public static final List<String> SUPPORTED_VERSIONS = Arrays.asList(
"1.7.x",
"1.8.x",
Expand All @@ -43,7 +44,8 @@ public class ProtocolConstants
ProtocolConstants.MINECRAFT_1_12,
ProtocolConstants.MINECRAFT_1_12_1,
ProtocolConstants.MINECRAFT_1_12_2,
ProtocolConstants.MINECRAFT_1_13
ProtocolConstants.MINECRAFT_1_13,
ProtocolConstants.MINECRAFT_1_13_1
);

public enum Direction
Expand Down
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 @@ -51,6 +51,7 @@ public class Configuration implements ProxyConfig
* Whether we log proxy commands to the proxy log
*/
private boolean logCommands;
private boolean logPings = true;
private int playerLimit = -1;
private Collection<String> disabledCommands;
private int throttle = 4000;
Expand Down Expand Up @@ -84,6 +85,7 @@ public void load()
uuid = adapter.getString( "stats", uuid );
onlineMode = adapter.getBoolean( "online_mode", onlineMode );
logCommands = adapter.getBoolean( "log_commands", logCommands );
logPings = adapter.getBoolean( "log_pings", logPings );
playerLimit = adapter.getInt( "player_limit", playerLimit );
throttle = adapter.getInt( "connection_throttle", throttle );
ipForward = adapter.getBoolean( "ip_forward", ipForward );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ public void handle(Handshake handshake) throws Exception
}

this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() );
bungee.getLogger().log( Level.INFO, "{0} has connected", this );
if ( bungee.getConfig().isLogPings() )
{
bungee.getLogger().log( Level.INFO, "{0} has connected", this );
}

bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) );

Expand All @@ -306,6 +309,10 @@ public void handle(Handshake handshake) throws Exception
break;
case 2:
// Login
if ( !bungee.getConfig().isLogPings() )
{
bungee.getLogger().log( Level.INFO, "{0} has connected", this );
}
thisState = State.USERNAME;
ch.setProtocol( Protocol.LOGIN );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public static EntityMap getEntityMap(int version)
case ProtocolConstants.MINECRAFT_1_12_2:
return EntityMap_1_12_1.INSTANCE;
case ProtocolConstants.MINECRAFT_1_13:
case ProtocolConstants.MINECRAFT_1_13_1:
return EntityMap_1_13.INSTANCE;
}
throw new RuntimeException( "Version " + version + " has no entity map" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ public void cancel(ScheduledTask task)
public int cancel(Plugin plugin)
{
Set<ScheduledTask> toRemove = new HashSet<>();
for ( ScheduledTask task : tasksByPlugin.get( plugin ) )
synchronized ( lock )
{
toRemove.add( task );
for ( ScheduledTask task : tasksByPlugin.get( plugin ) )
{
toRemove.add( task );
}
}
for ( ScheduledTask task : toRemove )
{
Expand Down

0 comments on commit d472c1f

Please sign in to comment.