diff --git a/beta/preview/CraftIRC.jar b/beta/preview/CraftIRC.jar index 084d0d3..0f04013 100644 Binary files a/beta/preview/CraftIRC.jar and b/beta/preview/CraftIRC.jar differ diff --git a/com/ensifera/animosity/craftirc/CraftIRC.java b/com/ensifera/animosity/craftirc/CraftIRC.java index b7497c0..6bcf014 100644 --- a/com/ensifera/animosity/craftirc/CraftIRC.java +++ b/com/ensifera/animosity/craftirc/CraftIRC.java @@ -441,10 +441,19 @@ public void sendMessageToTag(String message, String tag) { * @param tag * @return */ - private int getBotFromTag(String tag) { + private int getBotIdFromTag(String tag) { return 0; } + /** TODO: MAKE THIS + * CraftIRC API call - getBotFromId(id) Gets the bot id# from a source tag + * @param id + * @return + + private Minebot getBotFromId(int id) { + return Minebot; + } + */ protected ArrayList ircUserLists(String tag) { ArrayList result = new ArrayList(); if (tag == null) @@ -747,11 +756,12 @@ protected boolean checkPerms(String pl, String path) { return false; } + // TODO: This needs repair protected String colorizeName(String name) { - Pattern color_codes = Pattern.compile("§[0-9a-f]"); + Pattern color_codes = Pattern.compile(Character.toString((char) 3)+"[0-9a-f]"); Matcher find_colors = color_codes.matcher(name); while (find_colors.find()) { - name = find_colors.replaceFirst(Character.toString((char) 3) + name = find_colors.replaceAll(Character.toString((char) 3) + String.format("%02d", cColorIrcFromGame(find_colors.group()))); find_colors = color_codes.matcher(name); } @@ -767,7 +777,7 @@ protected String getPermPrefix(String pl) { String result = perms.getGroupPrefix(group); if (result == null) return ""; - return colorizeName(result.replaceAll("&([0-9a-f])", "§$1")); + return colorizeName(result.replaceAll("&([0-9a-f])", Character.toString((char) 3)+"$1")); } protected String getPermSuffix(String pl) { @@ -779,15 +789,15 @@ protected String getPermSuffix(String pl) { String result = perms.getGroupSuffix(group); if (result == null) return ""; - return colorizeName(result.replaceAll("&([0-9a-f])", "§$1")); + return colorizeName(result.replaceAll("&([0-9a-f])", Character.toString((char) 3)+"$1")); } - public void enqueueConsoleCommand(String cmd) { + protected void enqueueConsoleCommand(String cmd) { try { console.a(cmd, console); } catch (Exception e) { - + e.printStackTrace(); } diff --git a/com/ensifera/animosity/craftirc/RelayedMessage.java b/com/ensifera/animosity/craftirc/RelayedMessage.java index c67dee5..f71bb62 100644 --- a/com/ensifera/animosity/craftirc/RelayedMessage.java +++ b/com/ensifera/animosity/craftirc/RelayedMessage.java @@ -121,7 +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 "); + //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("")) { @@ -132,7 +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 "); + //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%", ""); diff --git a/config.yml b/config.yml index 93d82ea..cd4b15a 100644 --- a/config.yml +++ b/config.yml @@ -25,7 +25,7 @@ settings: formatting: #### Formatting for the messages relayed by the plugin. You can override all formatting strings in the bot or channel #### scope (within a formatting: block). In irc-to-irc, the target channel controls the format strings. - #### VARIABLES (may be blank depending on the context): %sender% %message% %moderator% %srcChannel% %trgChannel% + #### VARIABLES (may be blank depending on the context): %sender% %message% %moderator% %srcChannel% %trgChannel% %world% #### IF YOU'RE RUNNING Permissions: %prefix% %suffix% %modPredix% %modSuffix% (game-to-irc only) #### IRC FORMATTING: %b% %u% %r% %o% %k% %kNUM% (NUM is 0 to 15); Do the same as CTRL+key in mIRC #### GAME COLORS: §NUM (NUM is 1 to f); Do not use in the end of a line @@ -66,6 +66,7 @@ settings: #### events can be redefined in the bot or channel scopes (within an events: block). In irc-to-irc, the source #### channel controls the events. game-to-irc: + # If you use other chat plugins, you probably want to set cancelled-chat: true cancelled-chat: false all-chat: true joins: false diff --git a/plugin.yml b/plugin.yml index f5d64ea..993c4e4 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,6 +1,6 @@ name: CraftIRC main: com.ensifera.animosity.craftirc.CraftIRC -version: 2.0 Preview 9c +version: 2.0 Preview 9d commands: irc: description: Sends a message to all IRC channels