kangarko / ChatControl-Red

Issue tracker and documentation for the next generation ChatControl Red, the most advanced chat management plugin.
43 stars 22 forks source link

1.8, 1.12, 1.17, 1.20: Receivers still get empty messages when display conditions #2647

Closed gre3x closed 2 months ago

gre3x commented 2 months ago

"/version ChatControlRed" - plugin version

10.25.4

Are you using MySQL?

Yes

Are you using BungeeCord?

Yes

Error log (if applicable)

None

"/chc debug" output (strongly recommended)

debug.zip

Information about the issue/bug

After updating to version 10.25.4 from 10.24.5, these features no longer work:

Note that this did NOT happen in version 10.24.5

image

gre3x commented 2 months ago

@kangarko are you able to take a look at this soon? This is feature regression and breaks my current chat setup

kangarko commented 2 months ago

Please test the next version available in a few hours and if that issue continues let me know exactly which format is that again please

kangarko commented 2 months ago

Just comment below instead of opening a duplicate ticket

kangarko commented 2 months ago

Reproducing now...

gre3x commented 2 months ago

Thank you for looking into this!

Specifically, the format that has stopped working for filtering out the messages is global-chat.yml in my configs (see debug.zip). The is not supposed to not send a message to the player if all parts of the message are filtered out by the Receiver_Condition. In 10.24.5, that has stopped working.

Below is the full filter that does work as a condition, but still sends the empty message (even though it is not supposed to send an empty message according to the above change logs). And it used to not send an empty message in version 10.24.5:

    Receiver_Condition: '''{advanciuschat_canview_{sender}}'' == ''true'''

Note that this did NOT happen in version 10.24.5

gre3x commented 2 months ago

Btw advanciuschat_canview_{sender} is just a placeholder api placeholder that returns "true" or "false" based on if that player has a certain toggle

kangarko commented 2 months ago

I cannot reproduce this issue. Try the next version where you set Debug key in settings.yml to [component] and it should print what it sees before sending to each player to the console:

a

Also note that console will always receive the full message because no conditions are evaluated against it.

gre3x commented 2 months ago

These are the debug messages:

18.04 19:23:06 [Server] Server thread/[INFO] [component] Sending Clans_MC message: §f§f
18.04 19:23:06 [Server] Server thread/[INFO] [ChatControlRed] [global] SiiRGEOO: cya everyone :D
18.04 19:23:09 [Server] Server thread/[INFO] [component] Sending Clans_MC message: §f§f
18.04 19:23:09 [Server] Server thread/[INFO] [ChatControlRed] [global] Zekobot2000: 30 fps rn
18.04 19:23:12 [Server] Server thread/[INFO] [component] Sending Clans_MC message: §f§f
gre3x commented 2 months ago

Not sure how those are coming up since there is nothing in the config like that. And again, everything is being filtered by the Receiver_Condition.

Seems like you just need to strip the color codes before checking if the message is empty or not @kangarko

Very odd that this started happening only in the new version... I'm guessing something changed to add those §f§f or the color codes stopped getting stripped

kangarko commented 2 months ago

We already strip it:

a

But I placed the strip into the debug method here, please try this dev build with the new debug message and let me know what the console says now:

See the build below.

kangarko commented 2 months ago

Actually try this build:

ChatControl-Red-10.25.8.zip

gre3x commented 2 months ago

Using that attached version it is empty in console, but it is not filtered haha... very strange! Possibly it is something to do with it being a message from a seperate server in the BungeeCord network?

4 21:13:44 [Server] Server thread/[INFO] [component] [ignore empty=false] Sending Clans_MC message: ''
18.04 21:13:44 [Server] Server thread/[INFO] [ChatControlRed] [global] baebiekay: gg
18.04 21:13:44 [Server] Server thread/[INFO] [component] [ignore empty=false] Sending Clans_MC message: ''
18.04 21:13:44 [Server] Server thread/[INFO] [ChatControlRed] [global] KhaleesiKayy414: gg
18.04 21:13:46 [Server] Server thread/[INFO] [component] [ignore empty=false] Sending Clans_MC message: ''
18.04 21:13:46 [Server] Server thread/[INFO] [ChatControlRed] [global] Midnight60163: gg
18.04 21:13:46 [Server] Server thread/[INFO] [component] [ignore empty=false] Sending Clans_MC message: ''

And still see the empty messages on the player's screen: image

kangarko commented 2 months ago

Yes, I missed the fact it came from another server. Does the bug happen with local messages or network messages as well?

You see the "ignore empty" being false flag which needs to be true for the ignore to happen, perhaps it's false from network messages. I'll investigate.

gre3x commented 2 months ago

@kangarko I just tested it and it happens with local and network messages. Some messages do somehow seem to be filtered though? It is very odd (these logs are from the users MC_Legend and Clans_MC on the same server with some other players on other bungee servers sending messages too:

21.04 01:20:23 [Server] Async Chat Thread - #26/[INFO] [global] MC_Legend: tt
21.04 01:20:25 [Server] Server thread/[INFO] [component] [ignore empty=false] Sending Clans_MC message: ''
21.04 01:20:25 [Server] Server thread/[INFO] [component] [ignore empty=false] Sending MC_Legend message: ''
21.04 01:20:25 [Server] Server thread/[INFO] [ChatControlRed] [global] Prototyzer: scutes will probably be 1 or 2 ingots
21.04 01:20:26 [Server] Server thread/[INFO] [component] [ignore empty=false] Sending Clans_MC message: ''
21.04 01:20:26 [Server] Server thread/[INFO] [component] [ignore empty=false] Sending MC_Legend message: ''
21.04 01:20:26 [Server] Server thread/[INFO] [ChatControlRed] [global] S4mmYT_: §dttttt
21.04 01:20:26 [Server] Server thread/[INFO] [component] [ignore empty=false] Sending Clans_MC message: ''
21.04 01:20:26 [Server] Server thread/[INFO] [component] [ignore empty=false] Sending MC_Legend message: ''
21.04 01:20:26 [Server] Server thread/[INFO] [ChatControlRed] [global] tgg99: tt?
21.04 01:20:26 [Server] Async Chat Thread - #26/[INFO] [component] [ignore empty=true] Sending Clans_MC message: ''
21.04 01:20:26 [Server] Async Chat Thread - #26/[INFO] [component] Message is empty, skipping.
21.04 01:20:26 [Server] Async Chat Thread - #26/[INFO] [component] [ignore empty=true] Sending MC_Legend message: ''
21.04 01:20:26 [Server] Async Chat Thread - #26/[INFO] [component] Message is empty, skipping.
21.04 01:20:26 [Server] Async Chat Thread - #26/[INFO] [global] MC_Legend: t
21.04 01:20:28 [Server] Server thread/[INFO] [component] [ignore empty=false] Sending Clans_MC message: ''
21.04 01:20:28 [Server] Server thread/[INFO] [component] [ignore empty=false] Sending MC_Legend message: ''
kangarko commented 2 months ago

ChatControl-Red-10.25.8.zip Try this devbuild please. It has ignoreFalse on true from bungee messages.

gre3x commented 2 months ago

Yes that dev build worked thank you! @kangarko

gre3x commented 2 months ago

Will that change be part of the next version released?

kangarko commented 2 months ago

Yes of course!

gre3x commented 2 months ago

Great thank you! When will that new version be available @kangarko?

kangarko commented 2 months ago

Sorry I got sick. Hopefully tonight.