DiscordSRV / Staff-Chat

A staff-chat plugin that hooks into DiscordSRV
MIT License
29 stars 11 forks source link

This + deluxechat || mcmmo #2

Closed Flavourized closed 6 years ago

Flavourized commented 6 years ago

Hello!,

I recently started using this plugin and have run into a few issues.

First of all, if you have another chatmanager plugin like deluxechat or essentialschat, this plugin will send the "StaffChat" message in both the original chat manager and the staff chat. Here is an example: http://prntscr.com/jq0w0r

This issue is reflected with mcMMO "Admin Chat" and "Party Chat".

Is there anything you can do to cancel the chat from sending to the deluxechat/mcmmo chat instance?

RezzedUp commented 6 years ago

This plugin does not appear to have any conflicts with Essentials Chat or McMMO (besides McMMO also registering /a as a command).

However, I am unable to test with DeluxeChat because it is a premium plugin (and I don't intend on purchasing it just to test).

DiscordSRV-Staff-Chat does cancel the player chat event after it is received: I can't control when other plugins don't respect cancelled events.

https://github.com/RezzedUp/DiscordSRV-Staff-Chat/blob/ad4cae18386797d4ec493d72e2f9473f36db4b60/src/main/java/com/rezzedup/discordsrv/staffchat/StaffChatPlugin.java#L307

Flavourized commented 6 years ago

Okay. You might want to put an incompatible with DeluxeChat on your resource page then.

My testing used a bare server running the following. All configurations were setup correctly. All plugins were latest (stable) versions. Server was running latest 1.12 spigot build.

Running deluxechat, switching to staffchat channel had no effect. Message was being sent first to DeluxeChat global chat, and then to staffchat channel. When switching to mcmmo admin chat with your staff-chat enabled, the msg was sent to mcmmo first and then to staffchat.

What i dont understand is how mcmmo is able to properly create a "channel" system that works with deluxechat? Mcmmo is open source, so wouldnt you be able take inspiration from their design? The channel system has the same purpose in your plugin and in mcmmo, but yours sends the chat to discord (& receives). Other than the send/receive what would the difference be? Im not trying to sound rude, i just dont understand how mcmmo could work while yours does not.

RezzedUp commented 6 years ago

When switching to mcmmo admin chat with your staff-chat enabled, the msg was sent to mcmmo first and then to staffchat.

I am unable to replicate this behavior.

Even when I make DiscordSRV-Staff-Chat load after mcMMO, the message still gets cancelled properly.

What i dont understand is how mcmmo is able to properly create a "channel" system that works with deluxechat? Mcmmo is open source, so wouldnt you be able take inspiration from their design? The channel system has the same purpose in your plugin and in mcmmo, but yours sends the chat to discord (& receives). Other than the send/receive what would the difference be? Im not trying to sound rude, i just dont understand how mcmmo could work while yours does not.

I looked over how mcMMO handles channels, and it really isn't all that different than how I currently handle them. So, I'm really at a loss here. 😅

I suspect it's a load order issue... but I have no way of confirming that (and keep in mind that load order has no effect over mcMMO compatibility, as seen above). If you have any way to modify DeluxeChat's event priority, set it to HIGH or HIGHEST (which gives them lower priority, ironically).

DiscordSRV-Staff-Chat's event priority is currently set to LOWEST, so, according to Bukkit's documentation, it's supposed to be one of the very first listeners called.


For now, I will reopen this issue because I would like to solve whatever possible conflicts with mcMMO you are experiencing. As for DeluxeChat, I suggest talking with the dev of that plugin.

With DeluxeChat uninstalled, do the compatibility problems with mcMMO persist?

Flavourized commented 6 years ago

Hey there.

I have been pretty busy with our production server, so I will probably have time to test it this weekend. Just wanted to let you know incase you thought i ditched.

DeluxeChat does not have a configurable event priority option, but I will talk with @extendedclip to see if he can add one.

extendedclip commented 6 years ago

DeluxeChat listens on priority HIGHEST as well as ignores cancelled events so I'm not sure what the issue is without testing myself.

RezzedUp commented 6 years ago

@Flavourized can you please share the results of running DiscordSRV-Staff-Chat with only mcMMO installed?