mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-06-22 20:55:04 +02:00
Compare commits
5 Commits
ed80c3ae89
...
708ac50a08
Author | SHA1 | Date | |
---|---|---|---|
|
708ac50a08 | ||
|
6e1751733f | ||
|
6335af840b | ||
|
46fddc4110 | ||
|
8537709045 |
|
@ -61,6 +61,11 @@ class LibraryLoader
|
||||||
logger.log( Level.INFO, "Downloading {0}", event.getResource().getRepositoryUrl() + event.getResource().getResourceName() );
|
logger.log( Level.INFO, "Downloading {0}", event.getResource().getRepositoryUrl() + event.getResource().getResourceName() );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
// SPIGOT-7638: Add system properties,
|
||||||
|
// since JdkVersionProfileActivator needs 'java.version' when a profile has the 'jdk' element
|
||||||
|
// otherwise it will silently fail and not resolves the dependencies in the affected pom.
|
||||||
|
session.setSystemProperties( System.getProperties() );
|
||||||
session.setReadOnly();
|
session.setReadOnly();
|
||||||
|
|
||||||
this.repositories = repository.newResolutionRepositories( session, Arrays.asList( new RemoteRepository.Builder( "central", "default", "https://repo.maven.apache.org/maven2" ).build() ) );
|
this.repositories = repository.newResolutionRepositories( session, Arrays.asList( new RemoteRepository.Builder( "central", "default", "https://repo.maven.apache.org/maven2" ).build() ) );
|
||||||
|
|
|
@ -136,6 +136,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
||||||
@Getter
|
@Getter
|
||||||
private boolean transferred;
|
private boolean transferred;
|
||||||
private UserConnection userCon;
|
private UserConnection userCon;
|
||||||
|
@Getter
|
||||||
|
private BaseComponent disconnectMessage;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldHandle(PacketWrapper packet) throws Exception
|
public boolean shouldHandle(PacketWrapper packet) throws Exception
|
||||||
|
@ -163,13 +165,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
||||||
@Override
|
@Override
|
||||||
public void exception(Throwable t) throws Exception
|
public void exception(Throwable t) throws Exception
|
||||||
{
|
{
|
||||||
if ( canSendKickMessage() )
|
// if the connection is a login attempt, directly send a Kick with the Exception to the client
|
||||||
{
|
// we can't use disconnect() here as the method delays the Kick packet sending by 250ms and the HandlerBoss
|
||||||
disconnect( ChatColor.RED + Util.exception( t ) );
|
// will close the channel before the packet is sent
|
||||||
} else
|
// also we don't want to print the exception twice
|
||||||
{
|
ch.close( canSendKickMessage() ? new Kick( TextComponent.fromLegacy( ChatColor.RED + Util.exception( t ) ) ) : null );
|
||||||
ch.close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -751,7 +751,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
||||||
{
|
{
|
||||||
if ( canSendKickMessage() )
|
if ( canSendKickMessage() )
|
||||||
{
|
{
|
||||||
ch.delayedClose( new Kick( reason ) );
|
ch.delayedClose( new Kick( this.disconnectMessage = reason ) );
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
ch.close();
|
ch.close();
|
||||||
|
|
|
@ -60,9 +60,22 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
|
||||||
channel.markClosed();
|
channel.markClosed();
|
||||||
handler.disconnected( channel );
|
handler.disconnected( channel );
|
||||||
|
|
||||||
if ( !( handler instanceof InitialHandler || handler instanceof PingHandler ) )
|
if ( !( handler instanceof PingHandler ) )
|
||||||
{
|
{
|
||||||
ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler );
|
if ( handler instanceof InitialHandler )
|
||||||
|
{
|
||||||
|
InitialHandler initialHandler = (InitialHandler) handler;
|
||||||
|
if ( initialHandler.getDisconnectMessage() != null )
|
||||||
|
{
|
||||||
|
ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected: {1}", new Object[]
|
||||||
|
{
|
||||||
|
handler, initialHandler.getDisconnectMessage().toPlainText()
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,6 +107,9 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
|
||||||
} );
|
} );
|
||||||
|
|
||||||
channel.setRemoteAddress( newAddress );
|
channel.setRemoteAddress( newAddress );
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
channel.close();
|
||||||
}
|
}
|
||||||
} finally
|
} finally
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user