Fabric API

Fabric API

106M Downloads

Client commands should be able to override server commands

SoniEx2 opened this issue · 15 comments

commented

It is important for privacy-preserving mods to enforce their client commands don't leak to the server.

commented

I can see reasons for and against this, I would suggest an API to register client commands that overwrite the server one if its really needed.

As for it being something to help with "privacy-preserving mods" (I think this is another way of saying hacks, but lets ingore that) this isnt something we ever guaranteed and something I dont think we want to guarentee. Its also easy to mistype a command or forget the mod that provides the client command is installed, sending your command to the server.

I think its fair to say that you should expect anything that you type in the chat box to possibly end up on the server, I fail to see a use case where you would be worried about a command ending up on the server without it having a malious intent. Please let me know if im wrong. Either way an option to allow this seems fine to me. 👍

commented

Yes you can typo commands and you can also type into the wrong chat box, you can also type your twitch password on a github issue, but that's beside the point.

commented

I believe client commands already leak information about the first literal in a command to the server at the very least.

Even with these proposed changes, a typo like /logun <password> would still be sent to the server.

commented

Yes and a typo like nickserv identify password (note no /) gets sent to the current IRC channel but we don't see ppl removing nickserv over it. (it's being deprecated but like, nobody's actually uninstalling nickserv over it.)

We're not saying it's issue-free, but, wow, the issues do not make a compelling reason to be strongly against it.

commented

We aren’t against it, just don’t feel like the proposed solution really helps that much.

commented

Is /fcc command client only or is that also sent to the server to be checked before running client side?

Personally though if I had a mod which renders grids by using /g <xWidth> <zWidth> and the server also has a /g <msg> command for lets say global RP chat I wouldn't want it to try and use the server command before the client, perhaps there should be a way for the user to decide which one is executed first in addition to a way to force server commands e.g. /fsc command args

commented

If we had a mod that used /r for quick-reply to non-server messages we'd want the /r from the mod to take over the /r from the server. We do see the point of using an actual GUI for login and stuff tho, but integration with in-game chat is really convenient.

We generally do not want these messages being sent to the server, but especially not to the wrong person!

commented

(This also applies to /msg ofc)

So, can we go about driving this forward? We really need this.

commented

API aside (because it's probably not happening anytime soon), how do we make sure our own system overrides server commands, so we can decide whether to pass the commands to the server or to process them ourselves based on various factors?

commented

Yeah I would also like to have this changed.
A good example is the spark mod: If you want to run the client side profiler while on a server you just can't. Even if the command does not exist serverside you still can't execute commands of mods.

commented

@UltraBlackLinux Spark uses /sparkc for the client command.

commented

@haykam821 yeah I admit I noticed that afterwards as well. Bad example but the problem also applies for other mods ...

commented

honestly tho how do we override /msg and /tell and stuff?

commented

Even if the execute node doesn't override any server command node, it's not allowed, either.

For example, I make a command to rotate player (like /tp @s ~ ~ ~ <pitch> <yaw>), I register it as /tp <pitch> <yaw>. Although this command doesn't conflict with any server command, it's still fails to be registered, because the head literal node, tp, is the same as the server command tp.

I think that at least literal and argument node may be the same between server commands and client commands. It's "overload", rather than "override".