WMCAlliance / BukkitIRCd

BukkitIRCd was an IRC bridge plugin for Minecraft servers running Bukkit. It creates individual 'bot' users for every player to allow seamless communication.
https://wma.im
Other
5 stars 6 forks source link

Redo convertColors and stripFormatting to be more explicit and support formatting codes #29

Closed chyyran closed 11 years ago

chyyran commented 11 years ago

This pull request fixes issue #1. It involved a rewrite of the stripFormatting() and convertColors() method

Also fixed the issue in which kicking a player would not disconnect the player from IRC.

WizardCM commented 11 years ago

Now in build 49. http://netbook.home.wizardcm.com:8080/job/BukkitIRCd/49/

chyyran commented 11 years ago

I'll test this more, though I haven't encountered this issue when I was testing. Perhaps it only works if you use a plugin that enables color codes in chat, not sure if vanilla Bukkit has support for that. It doesn't parse ampersand characters, only section signs, which is used by the ChatColor class to turn ampersands codes to section signs.

WizardCM commented 11 years ago

Yeah it's an interesting bug, as before it did send section signs, and now it doesn't.

chyyran commented 11 years ago

All it does is replace the section sign plus the code (§4) for example, into the corresponding IRC code with the ETX character (^C05), ^C being caret notation for the actual char. Not sure why that bug happens, it doesn't even touch ampersands.

WizardCM commented 11 years ago

Well whatever was converting & signs to section signs for them to be parsed for IRC no longer does its job. I'm guessing it was part of the previous converter.

chyyran commented 11 years ago

If it's just a problem of converting ampersand codes, I wrote it in such a way that it relied on an external plugin to turn ampersands into section signs, to be non-interferent. If not though, it's an easy fix, just have to add a call to ChatColors.translateAlternateColorCodes('&',input);. would turn all ampersands into section signs. Perhaps add a config option to toggle that. See Line 1595 in IRCd.java

chyyran commented 11 years ago

@WizardCM

Try this build and tell me if it's fixed. I couldn't really reproduce the bug, so hopefully that fixes it. If so, I'll make a pull request