/help show only available commands #51

Open
opened 2014-07-12 02:54:26 -06:00 by RElesgoe · 3 comments
RElesgoe commented 2014-07-12 02:54:26 -06:00 (Migrated from github.com)

Commands restricted by CGs shouldn't be shown using the /help command unless the user has access to them

Commands restricted by CGs shouldn't be shown using the `/help` command unless the user has access to them
HarpyWar commented 2014-07-12 05:18:17 -06:00 (Migrated from github.com)

Good idea.

Good idea.
Kellsya commented 2014-08-10 03:31:13 -06:00 (Migrated from github.com)

Agreed, nice idea!

Agreed, nice idea!
HarpyWar commented 2014-08-10 07:25:55 -06:00 (Migrated from github.com)

I just see — this functionality was already done.
Unwanted commands are defined in command_groups.conf for group 1 (normal user can be an operator on a new created channel):
1 /kick /ban /unban /op /deop /aop /voice /devoice /vop /devop /tmpop /moderate

I'm not sure how better hide them. For instance, if define these command list for operators in code (to check user operator or not, and do not display them) then it will be defined in two places twice (config and code), that is not good.

My suggestion is do not hide them but add sections. There a new special symbol can be added in bnhelp.conf @ that designates a section title (or just use brackets [Title]).
Then output of /help will be like this:

[Info commands]
/games
/users
/time
/uptime
/tos
/motd
/news
/version
/license
[Self commands]
/stats
/icon
/clan
/friends
/ping
/dnd
/away
/me
/chpass
/timer
/logout
[User commands]
/msg
/reply
/ignore
/whois
/watch
[Operator commands]
/kick
/ban
/topic
[Admin commands]
/shutdown
(and all that with cg >1)

List of commands will be more convenient, it will be easier to find a command.
Normal user (cg=1) will see all the sections except Admin commands.

I just see — this functionality was [already done](https://github.com/HarpyWar/pvpgn/blob/8d3f36e69555ddc6dd9000d39ca523bd9bb44580/src/bnetd/helpfile.cpp#L168). Unwanted commands are defined in `command_groups.conf` for group 1 (normal user can be an operator on a new created channel): `1 /kick /ban /unban /op /deop /aop /voice /devoice /vop /devop /tmpop /moderate` I'm not sure how better hide them. For instance, if define these command list for operators in code (to check user operator or not, and do not display them) then it will be defined in two places twice (config and code), that is not good. My suggestion is do not hide them but add sections. There a new special symbol can be added in bnhelp.conf `@` that designates a section title (or just use brackets `[Title]`). Then output of /help will be like this: ``` [Info commands] /games /users /time /uptime /tos /motd /news /version /license [Self commands] /stats /icon /clan /friends /ping /dnd /away /me /chpass /timer /logout [User commands] /msg /reply /ignore /whois /watch [Operator commands] /kick /ban /topic [Admin commands] /shutdown (and all that with cg >1) ``` List of commands will be more convenient, it will be easier to find a command. Normal user (cg=1) will see all the sections except `Admin commands`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Techwizz/pvpgn-server#51
No description provided.