Skip to content
This repository
Browse code

Added RelayedMessage debug lines, add minimal handling in onPlayerCom…

…mandPreprocess, build Preview 9c
  • Loading branch information...
commit 8012610f0cf8b75bc5c995f6b3a014ad17e3b208 1 parent f936765
Animosity authored
BIN  beta/preview/CraftIRC.jar
Binary file not shown
4 com/ensifera/animosity/craftirc/CraftIRCListener.java
@@ -22,6 +22,7 @@ public CraftIRCListener(CraftIRC plugin) {
22 22 }
23 23
24 24 public void onPlayerCommandPreprocess(PlayerChatEvent event) {
  25 + try {
25 26 String[] split = event.getMessage().split(" ");
26 27 // ACTION/EMOTE can't be claimed, so use onPlayerCommandPreprocess
27 28 if (split[0].equalsIgnoreCase("/me")) {
@@ -31,6 +32,9 @@ public void onPlayerCommandPreprocess(PlayerChatEvent event) {
31 32 msg.message = Util.combineSplit(1, split, " ");
32 33 this.plugin.sendMessage(msg, null, "all-chat");
33 34 }
  35 + } catch (Exception e) {
  36 + e.printStackTrace();
  37 + }
34 38 }
35 39
36 40 public void onPlayerChat(PlayerChatEvent event) {
2  com/ensifera/animosity/craftirc/RelayedMessage.java
@@ -121,6 +121,7 @@ public String asString(EndPoint realTarget) throws RelayedMessageException {
121 121 result = result.replace("%trgChannel%", trgChannel);
122 122 result = result.replace("%world%", world);
123 123 if (source == EndPoint.GAME && this.plugin.hasPerms() && this.plugin.cChanNameColors(trgBot, trgChannel)) {
  124 + 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 ");
124 125 result = result.replace("%prefix%", this.plugin.getPermPrefix(sender));
125 126 result = result.replace("%suffix%", this.plugin.getPermSuffix(sender));
126 127 if (!moderator.equals("")) {
@@ -131,6 +132,7 @@ public String asString(EndPoint realTarget) throws RelayedMessageException {
131 132 result = result.replace("%modSuffix%", "");
132 133 }
133 134 } else {
  135 + 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 ");
134 136 result = result.replace("%prefix%", "");
135 137 result = result.replace("%suffix%", "");
136 138 result = result.replace("%modPrefix%", "");
2  plugin.yml
... ... @@ -1,6 +1,6 @@
1 1 name: CraftIRC
2 2 main: com.ensifera.animosity.craftirc.CraftIRC
3   -version: 2.0 Preview 9b
  3 +version: 2.0 Preview 9c
4 4 commands:
5 5 irc:
6 6 description: Sends a message to all IRC channels

0 comments on commit 8012610

Please sign in to comment.
Something went wrong with that request. Please try again.