Alias and Help Integration into Bukkit

Discussion in 'Bukkit Help' started by Don Redhorse, Feb 4, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Don Redhorse

    Hi,

    I really like what all of you guys and girls are doing here with bukkit and the plugins but there are at least TWO very important things which are totally negleted atm which makes it very problematic to run a good server. (Ofcourse just my point of view but I hope some people will agree).

    a) Commands and alias:

    A lot of commands being used are NOT specific to the Plugin, like /i or /info. It would be far better if every plugin writer would use a short abbreviation for his plugin like /we info for WorldEdit and /ib info for InfoBot (just to PICK 2 plugins) and than have an alias funktion which can be managed by the administrator to change whatever command he likes to /info. This requires ofcourse a Plugin Database which holds the abbreviations and a little mapping files for the aliases.

    b) Help:

    I know that permissions are atm only an addon BUT we still need a solution to the following problem.

    You have a user which does /help. But which information will he get? Normally the information from the plugin having /help regististered, but does the plugin know which commands are available to the user? Also it doesn't make sense to just show ALL commands and have a help with 20 pages, perhaps you just want to show information on how to call plugin specific help like /ch help for HeroChat Help.

    So what would be most usefull I think is a help funktion which a) will only show the commands you can use from b) a list of commands which can be added and changed by the admin. This would require the plugin developers to create a little help file with the commands and the description which than needs to go into a common place where it would be parsed.

    This would allow the admins to manage the help they want to show to the user ingame.

    If you guys need any help in how a flow of this would look like or what the required components would be feel free to ask.

    tldr:

    To make bukkit easily manageable and highly usefull for admins and players it should be able to have unique commands and map those to server specific commands. Also help should be manageable and only show relevant information.

    What do others think?

    Oh yeah... btw: Run vanilla Servers and it is a Beta as reply doesn't count ;-)

    as a side note... looks like a similar discussion is going on here http://forums.bukkit.org/threads/plugin-gremlins-and-how-to-command-them.3108/ and a lot of plugin developer has similar problems with duplicate commands.
    --- merged: Feb 4, 2011 11:35 AM ---
    to clarify: This shouldn't become another PLUGIN... it should be an api from bukkit, perhaps somebody will code a custom help plugin after that, but the core functionality should come from bukkit.
    --- merged: Feb 4, 2011 4:33 PM ---
    copied over from the Plugin Gremlins Thread, with some edits to make it more clear and a lot more after ###

    for a)

    so I really like where this is going as it makes it at least for the commands easy IF every plugin developer would use a "basecommand" like /we or /ib or /es etc.. and afterwards the command for his plugin.. like /we info, /ib info etc.

    we would than only need a alias file which could be edited by the admin of the server to map /info to /ib info for example the alias would ALWAYS WIN a comparison so that you could even overwrite internal command, e.g /help

    so the plugin developer doesn't need to bother about ANY duplicate command except the basecommand, and that should be easy to toggle by having a basecommand repository.... LWC and HeroChat (kinda) do it like this with /lwc and /ch

    for b)

    well that should be / could be done via a permission system, and as there are no duplicates it would be fine.

    and in reply to somebody else:

    what is missing is a good way to manage the help system. i think again a simple approach would be usefull.. allowing plugin developers to write their OWN help if needed or just use a generic help api.

    If you write a complicated plugin with LOTs of help needed you just register /mp help (/mp has an alias of /god) so it will than show up when people do /help with
    /god help For help about the MyPlugin which does lots of stuff

    if you write an easy plugin you just register /mp help (where /mp again has an alias perhaps of /god) so if people do /help it will show /god Toggle God Mode

    IF now permissions could also be used with it, /help would only show you the commands you have access to.

    that is the easy part, now it becomes more complicated... perhaps the admin doesn't want to use the default help function.. so somebody writes a help plugin.. but the developer would need to be able to access the api for permissions and api the same way like the internal /help does.

    ###

    so let's look at it a little bit more, let's take essentials for example. basecommand would be /es . The new bukkit version requires a plugin.yml file which contains the commands so let's take a look:

    Code:
    name: Essentials
        main: org.bukkit.earth2me.essentials.Essentials    
        version: 137    
        website: http://www.earth2me.com/minecraft/    
        authors:    
          - Zenexer    
          - ementalo    
          - Eris    
          - EggRoll    
          - xmlns    
        description: Provides basic commands for Bukkit.    
        commands:    
          afk:    
            description:  Marks you as away-from-keyboard.    
            usage: /<command>    
          ban:    
            description:  Bans a player.    
            usage: /<command> [player]    
            aliases: b    
        
    so with a few changes this could become the framework for alias and help.
    The commands would not be /afk but /es afk by default, so no change yet, but to get /afk the admin would just needed to add aliases: /afk to the afk section like this:
    Code:
        
        name: Essentials    
        main: org.bukkit.earth2me.essentials.Essentials    
        version: 137    
        website: http://www.earth2me.com/minecraft/    
        authors:    
          - Zenexer    
          - ementalo    
          - Eris    
          - EggRoll    
          - xmlns    
        description: Provides basic commands for Bukkit.    
        commands:    
          afk:    
            description:  Marks you as away-from-keyboard.    
            usage: /<command>    
            aliases: /afk    
          ban:    
            description:  Bans a player.    
            usage: /<command> [player]    
            aliases: b    
        
    but we don't want to go into a plugin to do it so we need either a file externally to the jar (which would require the jar to be distributed via a zip or rar) or which is extracted from the jar on FIRST run always (in which case it requires a version number in the filename.
    So let's redo the structure a little:
    Code:
        
        name: Essentials    
                  main: org.bukkit.earth2me.essentials.Essentials    
                  version: 137    
                  website: http://www.earth2me.com/minecraft/    
                  authors:    
                        - Zenexer    
                        - ementalo    
                        - Eris    
                        - EggRoll    
                        - xmlns    
                  description: Provides basic commands for Bukkit    
                  [B]supplied-commands: afk, ban, banip...[/B]    
                  commands:    
                  afk:    
                        description:  Marks you as away-from-keyboard.    
                        usage: /<command>    
                        aliases: /afk    
                        help: true    
                  ban:    
                          description:  Bans a player.    
                          usage: /<command> [player]    
                          aliases: /b    
                          help: false   
        
    adding the help: true / false would allow the admin to control if and when the command would show up when we do a /help... true = show based on permissions, false = don't show
    supplied-commands would give the admin a quick overview which commands are supplied by the plugin. The versionnumber in the filename is required so that the already being used file isn't overwritten.
    if we now dump those files into /alias in the craftbukkit root, craftbukkit could parse all the files and would be able to run with an admin configured alias and help list
    if bukkit would have that api..
    another way would be to just create a alias.yml file which would needed to be created by the admin but that would mean hunting down all the commands by the admin. the plugin.yml is a requirement from bukkit so that would be easy to enhance for that.
    Any comments?
     
  2. Offline

    TnT

    If any official part of Bukkit ever needs a yml file, I'm burning everything I can see to the fucking ground. YML files are fucking atrocious and should be taken out behind the barn and put out of their misery.

    On the rest, yes, commands need to be worked on.
     
  3. Offline

    Don Redhorse

    well atm it already does if I see it correctly.

    but whatever. Looking further into discussions and usage on the server I would like to add that the above mentioned structure would also allow for:

    a) Translation: As commands and help are inside a textfile
    b) Customizable Help: As you can show / not show certain commands to people. If you add not only true / false but also the perm option for Help you could show the command always, never or based on permissions. The nice part about never is that as an admin or regulary user with rights to certain commands I don't really NEED a help for it or it is so compliacted I need to look it up on the web nevertheless, so why should it display when I do a /help?
     
  4. Offline

    TnT

    No. Certain plugins need it. Craftbukkit itself does not.

    Again, Bukkit should never use yml files. They cause way too many problems. I really wish the plugin devs would remove the requirement for them and replace it with something reasonable to use.
     
  5. Offline

    waf

    AMEN!
     
Thread Status:
Not open for further replies.

Share This Page