-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mixin for longer chat messages #252
Conversation
what happens if server and client have different values? Or if 2 clients haven't the same value? |
This is a problem, as if the server's value is smaller than the client, and the client sends a message that's too long, it will kick the client from the server. I think there's 2 different approaches to handling it, either just force the chat length to 256 like newer Minecraft versions (or some other agreed upon number), or somehow synchronize the server config value to the client on join (not sure how easy this is) |
imo best would be for clients to be able to automatically break down chat messages into multiple ones if they have a value below the server one |
there is no problem if two clients have different values, but it will shorten the message to the server value if the server and client have different values |
imo should just remove the config option to choose the lenght and hardcode it to 256 |
I pushed two commits to correct your pr |
I'm ok with this now if anyone else wants to look at it |
If the server has the setting off, and a client joins with the setting on, it would still disconnect the player if an oversized message is sent |
@serenibyss are there any way to fix it? |
@serenibyss can you resolve the conflict? |
The config option now just controls whether the client can send longer messages, which most people wont disable.
Warning: 2 uncommitted changes |
I believe that is the proper way to add config syncing. This should also allow for future (or current) config options to be synced. |
Since I never worked with custom packets, I can't review that PR sorry, but I am glad you could figure it out :p |
src/main/java/com/mitchej123/hodgepodge/net/HandlerConfigSync.java
Outdated
Show resolved
Hide resolved
Implemented and approved changes by miozune
Adds a two class mixin to allow raising the chat message length limit up to (currently) 512. Newer versions of Minecraft raised this limit to 256, so that is what I chose as the default value. The 512 limit is arbitrary, and I'm not sure if there are larger implications of it being this high, or if it could be higher.
I'm not the most familiar with mixin, so please let me know if there is any problems with remapping especially since I used a deobfuscated name in two of the mixin targets.