Skip to content
Permalink
Browse files

Merge pull request #222 from SpigotMC/master

Merge with SpigotMC.
  • Loading branch information...
sleiss committed Aug 29, 2018
2 parents 8f5e906 + ba07397 commit d472c1feaf7c0542b9e8cee452af93c639a540c0
@@ -390,6 +390,9 @@ private static ProtocolMapping map(int protocol, int id, boolean inherit) {
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
@@ -19,6 +19,7 @@
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",
@@ -43,7 +44,8 @@
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
@@ -51,6 +51,7 @@
* 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;
@@ -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 );
@@ -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 ) );

@@ -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 );

@@ -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" );
@@ -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 )
{

0 comments on commit d472c1f

Please sign in to comment.
You can’t perform that action at this time.