Skip to content

Config system to support overrides and more. #11

@decaprime

Description

@decaprime

Server operators will want to configure and modify aspects of VCF. Some simple examples are: Disabling a command, changing the adminOnly status of a command, or adding an alias. You could imagine more complete features like managing middleware, remapping to resolve conflicts, localizing commands, and updating more contextualized details/usage.

Simple worked example

Given this class from upcoming 0.6 release of LeadAHorseToWater

[CommandGroup("horse")]
public class HorseCommands
{
    [Command("whistle", description:"Sets the horse to you", adminOnly:true)
    public void Whistle(ICommandCtx ctx){/*...*/}
}

You should be able to canonically refer to this command as horse.whistle.

Let's say you want to set this to be a public command you could either run something like:

.vcf set command horse.whistle adminOnly false

or in a file like vcf.cfg

{
"horse.whistle.showAdmin" : false
}

Middleware

This will likely be split into it's own issue but ultimately could be handled by this system. Some considerations:

  • Middleware will require arbitrary data to be configured. All system examples above would just be primitives. While in one view, the framework does enough here: e.g. if you wanted roles plugin that supported sets of people and sets of permissions and to use YAMLSON serialization and have cool commands to manipulate those sets, you can do that today. In the other view, if it's something that would likely benefit most middleware development than it's worth it. Exploring what the framework boundary should be is going to be key, the more approachable and less code duplication the better.
  • Middleware may need to be ordered by operators, this can be done with some int priority value where -1 is aliased to disabled
  • This concept might be too complicated for some operators and have to be a bit concerned with how easy it is to permanently shoot yourself in the foot. Should there always be some adminauth revert to default command maybe?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions