Replay Mod (Fabric & Forge)

Replay Mod (Fabric & Forge)

787k Downloads

Restrictions not working

smartin1018 opened this issue ยท 2 comments

commented

https://pastebin.com/raw/6JELut26
Detailed error of what occurs when I send a PluginMessage.

For future reference, do I only need to send one message with "no_noclip" or do I need to write more data?

EDIT: This may be a forge issue, now that I realize.

commented

Eww, this looks like a simple change in Forge's behavior and/or a lack of proper testing of the restrictions feature in the first place that caused our horribly decision to use newSimpleChannel instead of just newChannel to make itself noticed.

Fixing it should be as simple as replacing that line with NetworkRegistry.INSTANCE.newChannel(Restrictions.PLUGIN_CHANNEL, new ChannelDuplexHandler());.
I'll do that once I find time to also test it.

No, just sending "no_noclip" is not sufficient. The string needs to be length prefixed (as described on wiki.vg).
Additionally, it has to be followed by a single byte with value 0 or 1 where 1 is activating the restriction and 0 is deactivating it (e.g. if you only want to disable noclip for one specific subsection of the server but allow it once the player leaves that section).

commented

Alright. I have been sending the Length, Restriction, then 1 just like you've been saying. At least I got that part correct.

Thanks for looking into the issue.