ocelotpotpie / FreedomChat

Liberate your server from the chat-reporting bourgeoisie! Disable chat signing server-side
https://modrinth.com/plugin/freedomchat
GNU General Public License v3.0
202 stars 25 forks source link

Muting chat on Bedrock no longer works. #16

Open RealTriassic opened 1 year ago

RealTriassic commented 1 year ago

Hello, I'm currently using Geyser to allow Bedrock Edition players to connect to my Java Edition server.

Bedrock Edition has a feature for chat called chat muting that is supposed to hide all player messages.

With this plugin, Bedrock thinks that all messages are system messages (technically intentional behaviour).

My suggestion is maybe using the Floodgate API to allow normal player messages to be sent to Bedrock players instead of system messages like it is for Java? Make it a configuration option if possible?

Thanks.

e-im commented 1 year ago

I'll see about this for bedrock players, but it is only by chance that the same system on Java edition works. For Java edition, Mojang left in a legacy check that will classify messages as if they are from a player when they match the default chat format.

It is impossible to, while achieving the goal of this plugin, fully support all the chat options.

MagmaBro123 commented 1 year ago

I'll see about this for bedrock players, but it is only by chance that the same system on Java edition works. For Java edition, Mojang left in a legacy check that will classify messages as if they are from a player when they match the default chat format.

It is impossible to, while achieving the goal of this plugin, fully support all the chat options.

So is Geyser and Floodgate incompatible then?

e-im commented 1 year ago

No. It will work, you just won't be able to mute chat on Bedrock edition. Chat will always be shown.

This is a fixable issue, I just haven't gotten to it yet.

MagmaBro123 commented 1 year ago

Ah, alright.

e-im commented 1 year ago

I've attempted to fix this, but I'm not able to test if it actually works. I've attached a jar (in a zip file because GH does not let me upload a jar); if anyone can test it and let me know if it works, I'd appreciate it.

I haven't used the floodgate API for this, but instead looked for geyser in the netty channel pipeline. This is because I do not have a player/UUID yet at the time of injection and don't really want to check later/add a potentially unnecessary dependency.

FreedomChat-1.3.1-geyser-SNAPSHOT.zip

MagmaBro123 commented 1 year ago

@RealTriassic ^

RealTriassic commented 1 year ago

Really sorry that it's been a week, I'll try to get some time to test this tomorrow.

e-im commented 1 year ago

No worries. took me more than a month. whenever you get a chance

RealTriassic commented 1 year ago

Okay I did some testing by throwing it straight into the main server, it doesn't seem to be working unfortunately, I had my java account send messages in chat and my bedrock account receiving them still whilst having chat muted.

RealTriassic commented 1 year ago

Adding onto my previous message, there were no error logs or anything on console.

JosTheDude commented 1 year ago

Weird, generally, most chat plugins usually when having a mute chat feature just cancel the chatting event / packet and check for permissions, FreedomChat affecting it on Geyser and Floodgate is interesting.

e-im commented 1 year ago

The issue is not referring to any chat plugin, but instead (at least as far as I understand) disabling chat within the client on bedrock edition.

Java edition has a similar thing, but does not rely exclusively on different message types. Bedrock, I assume, relies on the type of the message being Chat. Although, I'm a lot less familiar with bedrock and just derived that from wiki.vg. I haven't looked at the code, and tbh am not even sure how I could–– I don't know much about bedrock at all.