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

Implemented a way to close forms from floodgate #5247

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RochBlondiaux
Copy link

Hey guys!
My PRs are quite small and just aims to add the ability to close forms from the floodgate api.

I made it the simplest possible, it's just sending empty form data to geyser through the form plugin channel and then when geyser receive that empty data it send a form close packet down the connection pipeline.

This PR goes along with this one I made on the floodgate repo.

@@ -67,6 +69,12 @@ public void translate(GeyserSession session, ClientboundCustomPayloadPacket pack
session.ensureInEventLoop(() -> {
byte[] data = packet.getData();

// If the data is empty, we just need to close the form
if (data.length == 0) {
session.sendUpstreamPacketImmediately(new ClientboundCloseFormPacket());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can use session#closeForm instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants