@Override public void exception(Throwable t) throws Exception { con.disconnect( Util.exception( t ) ); }
@Override public void exception(Throwable t) throws Exception { disconnect( ChatColor.RED + Util.exception( t ) ); }
@Override public void retrieve(ModuleSpec module, ModuleVersion version) { System.out.println( "Attempting to Jenkins download module " + module.getName() + " v" + version.getBuild() ); try { URL website = new URL( "https://ci.md-5.net/job/BungeeCord/" + version.getBuild() + "/artifact/module/" + module.getName().replace( '_', '-' ) + "/target/" + module.getName() + ".jar" ); URLConnection con = website.openConnection(); // 15 second timeout at various stages con.setConnectTimeout( 15000 ); con.setReadTimeout( 15000 ); Files.write( ByteStreams.toByteArray( con.getInputStream() ), module.getFile() ); System.out.println( "Download complete" ); } catch ( IOException ex ) { System.out.println( "Failed to download: " + Util.exception( ex ) ); } } }
@Override public void exception(Throwable t) throws Exception { if ( obsolete ) { return; } String message = "Exception Connecting:" + Util.exception( t ); if ( user.getServer() == null ) { user.disconnect( message ); } else { user.sendMessage( ChatColor.RED + message ); } }
@Override public void exception(Throwable t) throws Exception { if ( server.isObsolete() ) { // do not perform any actions if the user has already moved return; } ServerInfo def = con.updateAndGetNextServer( server.getInfo() ); if ( def != null ) { server.setObsolete( true ); con.connectNow( def, ServerConnectEvent.Reason.SERVER_DOWN_REDIRECT ); con.sendMessage( bungee.getTranslation( "server_went_down" ) ); } else { con.disconnect( Util.exception( t ) ); } }
@Override public void exception(Throwable t) throws Exception { con.disconnect( Util.exception( t ) ); }
@Override public void exception(Throwable t) throws Exception { disconnect( ChatColor.RED + Util.exception( t ) ); }
@Override public void retrieve(ModuleSpec module, ModuleVersion version) { System.out.println( "Attempting to Jenkins download module " + module.getName() + " v" + version.getBuild() ); try { URL website = new URL( "https://tc.demonwav.com/guestAuth/repository/download/Waterfall_Build/" + version.getBuild() + "/" + module.getName() + ".jar" ); URLConnection con = website.openConnection(); // 15 second timeout at various stages con.setConnectTimeout( 15000 ); con.setReadTimeout( 15000 ); con.setRequestProperty("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"); Files.copy(con.getInputStream(), module.getFile().toPath(), StandardCopyOption.REPLACE_EXISTING); System.out.println( "Download complete" ); } catch ( IOException ex ) { System.out.println( "Failed to download: " + Util.exception( ex ) ); } } }
@Override public void exception(Throwable t) throws Exception { if ( obsolete ) { return; } String message = "Exception Connecting:" + Util.exception( t ); if ( user.getServer() == null ) { user.disconnect( message ); } else { user.sendMessage( ChatColor.RED + message ); } }
@Override public void exception(Throwable t) throws Exception { if ( server.isObsolete() ) { // do not perform any actions if the user has already moved return; } ServerInfo def = bungee.getServerInfo( con.getPendingConnection().getListener().getFallbackServer() ); if ( server.getInfo() != def ) { server.setObsolete( true ); con.connectNow( def ); con.sendMessage( bungee.getTranslation( "server_went_down" ) ); } else { con.disconnect( Util.exception( t ) ); } }