201202203204205206207208209210211
public void onSuccess(IIRCState aObject) { log.info("irc connection to server [%s] established", host); for(String chan : channels) { log.info("Joining channel %s", chan); irc.joinChannel(chan); } } @Override public void onFailure(Exception e)
9596979899100101102103104105
// fis.close(); } PircBotX bot = new RhqIrcBot(rhqBotListener); bot.connect(server); bot.joinChannel(channel.trim()); } private static void setupTrustStore() { TrustManagerFactory trustManagerFactory; try {
241242243244245246247248249250251
while (!connected) { Thread.sleep(60 * 1000L); // 1 minute try { PircBotX newBot = new RhqIrcBot(this); newBot.connect(this.server); newBot.joinChannel(this.channel); connected = true; } catch (Exception e) { System.err.println("Failed to reconnect to " + disconnectEvent.getBot().getServer() + " IRC server: " + e);