Permalink
Browse files

Added RelayedMessage debug lines, add minimal handling in onPlayerCom…

…mandPreprocess, build Preview 9c
  • Loading branch information...
Animosity committed Mar 6, 2011
1 parent f936765 commit 8012610f0cf8b75bc5c995f6b3a014ad17e3b208
View
Binary file not shown.
@@ -22,6 +22,7 @@ public CraftIRCListener(CraftIRC plugin) {
}
public void onPlayerCommandPreprocess(PlayerChatEvent event) {
+ try {
String[] split = event.getMessage().split(" ");
// ACTION/EMOTE can't be claimed, so use onPlayerCommandPreprocess
if (split[0].equalsIgnoreCase("/me")) {
@@ -31,6 +32,9 @@ public void onPlayerCommandPreprocess(PlayerChatEvent event) {
msg.message = Util.combineSplit(1, split, " ");
this.plugin.sendMessage(msg, null, "all-chat");
}
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
public void onPlayerChat(PlayerChatEvent event) {
@@ -121,6 +121,7 @@ public String asString(EndPoint realTarget) throws RelayedMessageException {
result = result.replace("%trgChannel%", trgChannel);
result = result.replace("%world%", world);
if (source == EndPoint.GAME && this.plugin.hasPerms() && this.plugin.cChanNameColors(trgBot, trgChannel)) {
+ if (this.plugin.isDebug()) CraftIRC.log.info(String.format(CraftIRC.NAME + " RelayedMessage: hasPerms="+String.valueOf(this.plugin.hasPerms())+" cChanNameColors()="+String.valueOf(this.plugin.cChanNameColors(trgBot, trgChannel)))+", apply pre/suffixes ");
result = result.replace("%prefix%", this.plugin.getPermPrefix(sender));
result = result.replace("%suffix%", this.plugin.getPermSuffix(sender));
if (!moderator.equals("")) {
@@ -131,6 +132,7 @@ public String asString(EndPoint realTarget) throws RelayedMessageException {
result = result.replace("%modSuffix%", "");
}
} else {
+ if (this.plugin.isDebug()) CraftIRC.log.info(String.format(CraftIRC.NAME + " RelayedMessage: hasPerms="+String.valueOf(this.plugin.hasPerms())+" cChanNameColors()="+String.valueOf(this.plugin.cChanNameColors(trgBot, trgChannel)))+", apply EMPTY pre/suffixes ");
result = result.replace("%prefix%", "");
result = result.replace("%suffix%", "");
result = result.replace("%modPrefix%", "");
View
@@ -1,6 +1,6 @@
name: CraftIRC
main: com.ensifera.animosity.craftirc.CraftIRC
-version: 2.0 Preview 9b
+version: 2.0 Preview 9c
commands:
irc:
description: Sends a message to all IRC channels

0 comments on commit 8012610

Please sign in to comment.