cnaude / PurpleIRC

Minecraft Bukkit plugin that provides an IRC bridge. This repo has been archived. Please see https://github.com/cnaude/PurpleIRC-spigot for the latest and greatest PurpleIRC code for Bukkit servers (Spigot, Paper etc...)
20 stars 9 forks source link

Townychat compatibility #46

Closed Ionaru closed 10 years ago

Ionaru commented 10 years ago

I am using Towny's chat system (TownyChat) on my server and I was wondering if there is a way to hide the internal town communication from the IRC. Global, staff and town/nation chat all seem to be going through the game-chat IRC channel.

The issue: town, nation, staff and local chat all show up as public chat in the IRC client.

cnaude commented 10 years ago

What version of Towny and Bukkit are you running?

cnaude commented 10 years ago

I had a look at the TownyChat API. It is not possible for PurpleIRC to distinguish between player chat and towny chat. The TownyChatEvent does not cancel the regular chat event. Thus all TownyChat messages will be sent to IRC. You will want to ask the TownyChat developer to hook into PurpleIRC.

cnaude commented 10 years ago

Actually it looks like it might work. Ill have a test version soon.

cnaude commented 10 years ago

Please try this version https://dl.dropboxusercontent.com/u/30679730/dist/PurpleIRC.jar and let me know if it works for you. If it it does not work correctly enable debug mode and send me the log output via pastebin.

Ionaru commented 10 years ago

I'm using Towny 0.84.0.0 and it's respective TownyChat version (0.40) Running MCPC+ 577 Craftbukkit 1.5.2 - R1.1

The town chat still shows up in the IRC.

Town chat:

2013-12-22 23:16:38 [INFO] [TownyChat] onPlayerChat: Processing directed message for town
2013-12-22 23:16:38 [INFO] [PurpleIRC] [DEBUG] Player Ionaru has permission irc.message.gamechat
2013-12-22 23:16:38 [INFO] [PurpleIRC] [DEBUG] mcMMO is not enabled
2013-12-22 23:16:38 [INFO] [PurpleIRC] [DEBUG] No Factions
2013-12-22 23:16:38 [INFO] [PurpleIRC] [DEBUG] [game-chat] => #SaturnServer => TEST
2013-12-22 23:16:38 [INFO] [PurpleIRC] [DEBUG] Tokenizing Ionaru(O: true)
2013-12-22 23:16:38 [INFO] [PurpleIRC] [DEBUG] getWorldAlias: worldName => world
2013-12-22 23:16:38 [INFO] [PurpleIRC] [DEBUG] getWorldAlias: alias => W
2013-12-22 23:16:38 [INFO] [PurpleIRC] [DEBUG] getWorldColor: worldName => world
2013-12-22 23:16:38 [INFO] [PurpleIRC] [DEBUG] getWorldColor: color => §2
2013-12-22 23:16:38 [INFO] [PurpleIRC] [DEBUG] [P]Raw message: §r%DISPLAYNAME%§r:%GROUPSUFFIX% %MESSAGE%
2013-12-22 23:16:38 [INFO] [PurpleIRC] [DEBUG] Entering aysncIRCMessage
2013-12-22 23:16:38 [INFO] [W][TC]Chief Ionaru: TEST

Staff chat:

2013-12-22 23:16:41 [INFO] [TownyChat] onPlayerChat: Processing directed message for admin
2013-12-22 23:16:41 [INFO] [PurpleIRC] [DEBUG] [0]: queueAndSend message detected
2013-12-22 23:16:41 [INFO] [PurpleIRC] [DEBUG] Player Ionaru has permission irc.message.gamechat
2013-12-22 23:16:41 [INFO] [PurpleIRC] [DEBUG] [blockingIRCMessage] About to send IRC message to #SaturnServer
2013-12-22 23:16:41 [INFO] [PurpleIRC] [DEBUG] mcMMO is not enabled
2013-12-22 23:16:41 [INFO] [PurpleIRC] [DEBUG] [blockingIRCMessage] Message sent to #SaturnServer
2013-12-22 23:16:41 [INFO] [PurpleIRC] [DEBUG] No Factions
2013-12-22 23:16:41 [INFO] [PurpleIRC] [DEBUG] [game-chat] => #SaturnServer => TEST
2013-12-22 23:16:41 [INFO] [PurpleIRC] [DEBUG] Tokenizing Ionaru(O: true)
2013-12-22 23:16:41 [INFO] [PurpleIRC] [DEBUG] getWorldAlias: worldName => world
2013-12-22 23:16:41 [INFO] [PurpleIRC] [DEBUG] getWorldAlias: alias => W
2013-12-22 23:16:41 [INFO] [PurpleIRC] [DEBUG] getWorldColor: worldName => world
2013-12-22 23:16:41 [INFO] [PurpleIRC] [DEBUG] getWorldColor: color => §2
2013-12-22 23:16:41 [INFO] [PurpleIRC] [DEBUG] [P]Raw message: §r%DISPLAYNAME%§r:%GROUPSUFFIX% %MESSAGE%
2013-12-22 23:16:41 [INFO] [PurpleIRC] [DEBUG] Entering aysncIRCMessage
2013-12-22 23:16:41 [INFO] [W][Staff]Ionaru: TEST

Normal chat:

2013-12-22 23:16:16 [INFO] [PurpleIRC] [DEBUG] Player Ionaru has permission irc.message.gamechat
2013-12-22 23:16:16 [INFO] [PurpleIRC] [DEBUG] mcMMO is not enabled
2013-12-22 23:16:16 [INFO] [PurpleIRC] [DEBUG] No Factions
2013-12-22 23:16:16 [INFO] [PurpleIRC] [DEBUG] [game-chat] => #SaturnServer => no
2013-12-22 23:16:16 [INFO] [PurpleIRC] [DEBUG] Tokenizing Ionaru(O: true)
2013-12-22 23:16:16 [INFO] [PurpleIRC] [DEBUG] getWorldAlias: worldName => world
2013-12-22 23:16:16 [INFO] [PurpleIRC] [DEBUG] getWorldAlias: alias => W
2013-12-22 23:16:16 [INFO] [PurpleIRC] [DEBUG] getWorldColor: worldName => world
2013-12-22 23:16:16 [INFO] [PurpleIRC] [DEBUG] getWorldColor: color => §2
2013-12-22 23:16:16 [INFO] [PurpleIRC] [DEBUG] [P]Raw message: §r%DISPLAYNAME%§r:%GROUPSUFFIX% %MESSAGE%
2013-12-22 23:16:16 [INFO] [PurpleIRC] [DEBUG] Entering aysncIRCMessage
2013-12-22 23:16:16 [INFO] [PurpleIRC] [DEBUG] [0]: queueAndSend message detected
2013-12-22 23:16:16 [INFO] [PurpleIRC] [DEBUG] [blockingIRCMessage] About to send IRC message to #SaturnServer
2013-12-22 23:16:16 [INFO] [W][Owner]~Ion: no
Ionaru commented 10 years ago

I just updated to 1.6.4 with MCPC+ version 1.6.4-R2.1, and it's still doing the same thing.

cnaude commented 10 years ago

Can I see your startup log and bot yml file? Please use pastebin if possible. Please also make sure you are using the very latest dev version. I've spent quite a bit of time fixing the townychat support. Feel free to join us on #PurpleIRC on espernet.

cnaude commented 10 years ago

One more thing. With the latest version you can remove game-chat from your bot yml messages list.

cnaude commented 10 years ago

Oh sorry it sounds like you want global chat in IRC and towny chat not in IRC. With the latest version you can use game-chat for global chat. The townychat won't appear in IRC unless you use the town-chat mesage type.

cnaude commented 10 years ago

Can I see the startup log? Pleas make sure you are using the very latest version which is https://dl.dropboxusercontent.com/u/30679730/dist/PurpleIRC.jar

Ionaru commented 10 years ago

I am running the latest version (2.1.5-Snapshot2). As you can see in the channel it doesn't recognize Towny channels in the chat. It should replace %TOWNYCHANNEL% with the correct channel, but it doesn't.

cnaude commented 10 years ago

Can I see your latest config.yml as well?

Ionaru commented 10 years ago

http://pastebin.com/qDeA72V9

cnaude commented 10 years ago

Remove %TOWNYCHANNEL% from game-chat. The game-chat template is only used for non townychat messages. All townychat messages should be going through town-channel-chat template. It appears the plugin is not properly hooking into your townychat plugin. Can I see the full startup log? You also mention this is MCPC. What mods are you running? Is it Tekkit? I can setup a test server if I know exactly what you are running.

Ionaru commented 10 years ago

Here's the server files I use: https://dl.dropboxusercontent.com/u/43514962/Technolution%20Server%20%281.6.4%29.zip

I will upload a startup log when I get home from college. But watch out, it will make you cry. xD

Here's my bot .yml as well. http://pastebin.com/ZsRMP1RD

Ionaru commented 10 years ago

Startup log: http://pastebin.com/57fUwpzB

cnaude commented 10 years ago

It looks like TownyChat is not loading correctly.

2014-01-06 17:00:47 [INFO] [TownyChat] Enabling TownyChat v0.4
2014-01-06 17:00:47 [SEVERE] Error occurred while enabling TownyChat v0.4 (Is it up to date?)
java.lang.IllegalArgumentException: No enum constant com.palmergames.bukkit.TownyChat.channels.channelTypes.LOCAL
        at java.lang.Enum.valueOf(Enum.java:236)
        at com.palmergames.bukkit.TownyChat.channels.channelTypes.valueOf(channelTypes.java:4)
        at com.palmergames.bukkit.TownyChat.config.ConfigurationHandler.loadChannels(ConfigurationHandler.java:77)
        at com.palmergames.bukkit.TownyChat.Chat.load(Chat.java:87)
        at com.palmergames.bukkit.TownyChat.Chat.onEnable(Chat.java:64)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:467)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:383)
        at org.bukkit.craftbukkit.v1_6_R3.CraftServer.loadPlugin(CraftServer.java:277)
        at org.bukkit.craftbukkit.v1_6_R3.CraftServer.enablePlugins(CraftServer.java:259)
        at net.minecraft.server.MinecraftServer.func_71243_i(MinecraftServer.java:525)
        at net.minecraft.server.MinecraftServer.func_71222_d(MinecraftServer.java:489)
        at net.minecraft.server.MinecraftServer.func_71247_a(MinecraftServer.java:432)
        at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:224)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:634)
        at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
Ionaru commented 10 years ago

Townychat works normally in-game though. It's also the latest version.

cnaude commented 10 years ago

What happens when you type /tc ?

cnaude commented 10 years ago

Also what happens when you type /pl ?

Ionaru commented 10 years ago

/tc switches the channel to town-chat

/pl lists all plugins, townychat is green (enabled)

cnaude commented 10 years ago

Okay I have an idea... I'll have a new version for you to try soon. In the meantime can I see your townychat config files? I'm trying to replicate this on my mcpc server.

virresss commented 10 years ago

Hi! i have the same problem i think. both towny chat and purpleirc loads and it is Enabling TownyChat support. but i cant get the bot to use the - towny-chat tag or any other towny tag but the - game-chat works.

i use spigot version git-Spigot-1248 (MC: 1.7.2) townychat 0.40 purpleirc v2.1.6 for 1.7.2 Jan 11, 2014

cnaude commented 10 years ago

virresss, Please enable dbug mode with "/irc debug t" and send me the output from your server.log. It should print useful information when you try to chat.

virresss commented 10 years ago

here http://pastebin.com/xaV6Bdkm

cnaude commented 10 years ago

In that last pastebin what was the name of the town channel you were chatting in? What was the message?

cnaude commented 10 years ago

I believe I found the issue.

cnaude commented 10 years ago

For each Town channel that you want to relay to IRC you will need to add a setting for that channel in TownyChat. Edit your "plugins/Towny/settings/Channels.yml" file and "hooked: true" for each channel.

See: http://dev.bukkit.org/bukkit-plugins/purpleirc/pages/faq/

Ionaru commented 10 years ago

It's working! \o/ Thank you so much for all the help.

Now is there a way to hide the bot's nickname in IRC?

cnaude commented 10 years ago

What do you mean hide the nick? Talking about the "/irc list" command?

Ionaru commented 10 years ago

I mean when a message from my server comes through, it always has RelayBot in front of the chat.

cnaude commented 10 years ago

Can you show me a screenshot of what you are referring to?

Ionaru commented 10 years ago

https://www.dropbox.com/s/pijngbz2vg9baai/Screenshot%202014-01-31%2002.32.50.png

cnaude commented 10 years ago

That's controlled by your IRC client. There is nothing that can be done from plugin.

Ionaru commented 10 years ago

okey, thanks anyway ;)

cnaude commented 10 years ago

Added to FAQ: http://dev.bukkit.org/bukkit-plugins/purpleirc/pages/faq/