-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Inhibitors #67
Comments
Another related concept is the ability to hide commands entirely from some clients, i.e. make client-side Cmdr believe the admin commands don't even exist. |
I agree that this is definitely a useful feature. Context doesn't work here because command contexts only represent a single instance of that command running, not the command in general. I'm thinking about adding another hook for this: |
Yes, exactly. Imagine a user being granted admin privileges. Then the commands will be shown in the help command the next time they run it. I think evaluating which commands should be hidden every time
That sounds good. How would you re-register it later though, for example in the case of a permissions raise? |
That's a good point. The registration hook wouldn't be as versatile for that. When originally designed Cmdr I had a feature outlined in my notes called "inhibitors" -- basically functions that would run and prevent the user from seeing commands. These eventually evolved into the hook system that exists today. However, I think inhibitors could fit into this hook system. Instead of blocking registration, there could be a hook called The downside of something like this though is of course that the developer will be forced to create their own systems to keep the |
The server should decide which commands the client sees. My idea is this: You tell Cmdr on the server to hide/unhide commands, Cmdr will send a request to the client, and the client will unregister/register commands accordingly. Commands that you hide before registering never get sent to the client in the first place. Requests to run hidden commands will be met with a command not found message. However, there could possibly be some "blind" commands that the client doesn't see that the server accepts... Who knows? Of course, a hook in the help command would be nice too. |
#75 would fit well with this, being able to switch command sets might be a useful feature |
Telling the client to register/unregister from the server is a good way to approach this, IMHO. There can still be hooks on the client to control display of commands, but the server should be able to control it too. |
IMO making this work in a way that satisfies everyone's needs would require a massive overhaul of how Cmdr works. This type of behaviour desired is currently possible (although there's no way to 'take back' a registration) although it does require a bit of work. I considered closing this issue but I'm going to recategorise this as 'future' for now: it's something that we might look at again in the future but have no intention of doing so currently. |
For example, hiding admin commands from the everyday user if Cmdr is being used as a gameplay element as well as an admin console. Maybe a BeforeRun hook could be used for this, maybe the help command could read from
context.State.Hidden
if it exists, or maybecontext.State.Whitelist
?A custom help command can do this, but what about the default one?
The text was updated successfully, but these errors were encountered: