diff --git a/pom.xml b/pom.xml index 4470966..cc76478 100644 --- a/pom.xml +++ b/pom.xml @@ -57,14 +57,14 @@ true - + + + vault-repo + http://nexus.theyeticave.net/content/repositories/pub_releases + + --> @@ -240,8 +240,7 @@ org.pircbotx pircbotx 2.0.1 - - + @@ -298,7 +297,7 @@ SuperVanish 5.0.1 - + junit diff --git a/src/main/java/com/cnaude/purpleirc/CommandQueueWatcher.java b/src/main/java/com/cnaude/purpleirc/CommandQueueWatcher.java index 1295552..b8aca6c 100644 --- a/src/main/java/com/cnaude/purpleirc/CommandQueueWatcher.java +++ b/src/main/java/com/cnaude/purpleirc/CommandQueueWatcher.java @@ -58,6 +58,7 @@ public class CommandQueueWatcher { && plugin.getServer().getPluginCommand(ircCommand.getGameCommand()) == null) { plugin.logDebug("Dispatching command as ConsoleSender: " + ircCommand.getGameCommand()); plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), ircCommand.getGameCommand()); + ircCommand.getIRCCommandSender().sendMessage("Command sent: " + ircCommand.getGameCommand()); } else { plugin.logDebug("Dispatching command as IRCCommandSender: " + ircCommand.getGameCommand()); plugin.getServer().dispatchCommand(ircCommand.getIRCCommandSender(), ircCommand.getGameCommand()); diff --git a/src/main/java/com/cnaude/purpleirc/PurpleBot.java b/src/main/java/com/cnaude/purpleirc/PurpleBot.java index e2198ca..182ea59 100644 --- a/src/main/java/com/cnaude/purpleirc/PurpleBot.java +++ b/src/main/java/com/cnaude/purpleirc/PurpleBot.java @@ -206,11 +206,11 @@ public final class PurpleBot { loadConfig(); addListeners(); version = plugin.getDescription().getFullName() + ", " - + plugin.getDescription().getDescription() + " - " - + plugin.getDescription().getWebsite(); + + plugin.getDescription().getDescription() + " - " + + plugin.getDescription().getWebsite(); buildBot(); messageQueue = new IRCMessageQueueWatcher(this, plugin); - + } public void buildBot() { @@ -436,8 +436,7 @@ public final class PurpleBot { public void asyncCTCPMessage(final String target, final String message) { plugin.logDebug("Entering asyncCTCPMessage"); - messageQueue.add(new IRCMessage(target, plugin.colorConverter - .gameColorsToIrc(message), true)); + messageQueue.add(new IRCMessage(target, plugin.colorConverter.gameColorsToIrc(message), true)); } public void blockingIRCMessage(final String target, final String message) { @@ -445,8 +444,11 @@ public final class PurpleBot { return; } plugin.logDebug("[blockingIRCMessage] About to send IRC message to " + target); - bot.sendIRC().message(target, plugin.colorConverter - .gameColorsToIrc(message)); + try { + bot.sendIRC().message(target, plugin.colorConverter.gameColorsToIrc(message)); + } catch (Exception ex) { + plugin.logError("Problem sending IRC message: " + ex.getMessage()); + } plugin.logDebug("[blockingIRCMessage] Message sent to " + target); } @@ -455,8 +457,11 @@ public final class PurpleBot { return; } plugin.logDebug("[blockingCTCPMessage] About to send IRC message to " + target); - bot.sendIRC().ctcpResponse(target, plugin.colorConverter - .gameColorsToIrc(message)); + try { + bot.sendIRC().ctcpResponse(target, plugin.colorConverter.gameColorsToIrc(message)); + } catch (Exception ex) { + plugin.logError("Problem sending IRC CTCP message: " + ex.getMessage()); + } plugin.logDebug("[blockingCTCPMessage] Message sent to " + target); } @@ -1957,15 +1962,15 @@ public final class PurpleBot { } List channelUsers = new ArrayList<>(); for (User user : channel.getUsers()) { - String nick = user.getNick(); - nick = getNickPrefix(user, channel) + nick; + String n = user.getNick(); + n = getNickPrefix(user, channel) + n; if (user.isAway()) { - nick = nick + ChatColor.GRAY + " | Away"; + n = n + ChatColor.GRAY + " | Away"; } - if (nick.equals(bot.getNick())) { - nick = ChatColor.DARK_PURPLE + nick; + if (n.equals(bot.getNick())) { + n = ChatColor.DARK_PURPLE + n; } - channelUsers.add(nick); + channelUsers.add(n); } Collections.sort(channelUsers, Collator.getInstance()); for (String userName : channelUsers) { diff --git a/src/main/resources/SampleBot.yml b/src/main/resources/SampleBot.yml index 4edaf62..5b17ba5 100644 --- a/src/main/resources/SampleBot.yml +++ b/src/main/resources/SampleBot.yml @@ -7,8 +7,8 @@ nick: AwesomeBot # If your bot's nick is in use try these alternates. Leave blank for none. alt-nicks: - - %NICK%_ - - %NICK%__ + - '%NICK%_' + - '%NICK%__' # login - Your bot's login name login: AwesomeName # realname