Skip to content
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

Command implementation - part I #2430

Merged
merged 1 commit into from
Jul 11, 2020
Merged

Command implementation - part I #2430

merged 1 commit into from
Jul 11, 2020

Conversation

dualspiral
Copy link
Contributor

@dualspiral dualspiral commented Dec 4, 2019

After much deliberation, I've started gluing our system to Brigadier. I wasn't originally going to do so, just sending packets to emulate the client completion, but sitting and thinking about how we can abuse it meant that I could come up with a couple of clever ways to do so.

We will create a Sponge specific Brigadier tree that will accept CommandCause. We'll mix in CommandCause into CommandSource. Under the hood, this will be a ICommandSource and (crucially) ISuggestionProvider - which will allow us to send completions to the client with minimal fuss.

There are a couple of things we do to sit within Brig, the big one is where we add our command context to the String Reader. We do this to allow us to pass the context to parsers without mixins and further headaches with trying to make things painless for mods that use Brig directly.

The logic putting the nodes together hasn't been written yet. I expect a lot of fun when it comes to creating "optional" nodes.

This isn't complete and so won't work as is, but it's a good way to what we're expecting. Custom registrars and parsers, along with suggestion providing for external frameworks, will come later.

This PR, then, is to get it checked over by @Zidane for compliance with the standards we wish to adopt. I think I got them all, but a good check would not go amiss before merging.

@dualspiral dualspiral force-pushed the api8/commands2 branch 2 times, most recently from bf6d638 to 48d2758 Compare April 3, 2020 18:24
@dualspiral dualspiral force-pushed the api8/commands2 branch 3 times, most recently from 23975a9 to d84d8a7 Compare May 23, 2020 11:40
@dualspiral dualspiral force-pushed the api8/commands2 branch 2 times, most recently from bf66ca6 to 94b3c0a Compare June 26, 2020 10:54
@dualspiral dualspiral force-pushed the api8/commands2 branch 2 times, most recently from 4434aac to f7eeb0b Compare July 3, 2020 19:09
@dualspiral dualspiral force-pushed the api8/commands2 branch 11 times, most recently from 4ccaa79 to f7613c7 Compare July 10, 2020 21:02
There are a couple of things we do to sit within Brig, the big one is where we add our command context to the String Reader. We do this to allow us to pass the context to parsers without mixins and further headaches with trying to make things painless for mods that use Brig directly.

This isn't complete, but it's a good way to what we're expecting. Registrars and parsers will come last.

Impl for CommandTreeBuilders

Currently missing the actual translation into Json - that's later

Add final modifiers, CommandCause is now a Subject and MessageReceiever.

Add interface to get CommandSources from the Cause easily.

Adding the CommandTreeBuilder scaffolding for custom frameworks

Once this is done, it's on to our own framework

More supporting code to enable Brig support.

Mostly need to do the grunt work - support our parameters now.

Starting to write class that builds the brig tree.

Starting complex parameters and how they will translate to the command tree

Add ClientCompletionType
@dualspiral dualspiral merged commit c1a6063 into api-8 Jul 11, 2020
@dualspiral dualspiral deleted the api8/commands2 branch July 11, 2020 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants