Skip to content

check if channel is active before injecting on velocity#629

Closed
linsaftw wants to merge 2 commits intoGeyserMC:masterfrom
linsaftw:master
Closed

check if channel is active before injecting on velocity#629
linsaftw wants to merge 2 commits intoGeyserMC:masterfrom
linsaftw:master

Conversation

@linsaftw
Copy link
Copy Markdown
Contributor

This fixes anti-bot support with forks like VeloFlame that act before Geyser and Floodgate and fixes a critical error during initialization if the channel was closed

@Camotoy
Copy link
Copy Markdown
Member

Camotoy commented Oct 28, 2025

Hi! Thanks for the PR. Would you be able to attach a code snippet or exception log explaining why this code breaks on your fork? Thanks!

@linsaftw
Copy link
Copy Markdown
Contributor Author

linsaftw commented Oct 28, 2025

Hi! Thanks for the PR. Would you be able to attach a code snippet or exception log explaining why this code breaks on your fork? Thanks!

https://mclo.gs/SkjhrJq Basically we apply anti-bot measures on init, so the channel is closed before floodgate handles it.

@Camotoy
Copy link
Copy Markdown
Member

Camotoy commented Oct 28, 2025

I would double-check to ensure this PR addresses those changes. We call that original ServerChannelInitializer that would have your anti-bot changes with the invoke(original, initChannel, channel); command that's below the return statement you presented. I could most certainly be wrong though.

@linsaftw

This comment was marked as spam.

@linsaftw
Copy link
Copy Markdown
Contributor Author

Member

You need to skip invoking anything on initChannel if the channel is closed.

@Tim203
Copy link
Copy Markdown
Member

Tim203 commented Oct 31, 2025

Have you tried without PacketEvents? Seems like this exception is caused by PacketEvents

@Kas-tle
Copy link
Copy Markdown
Member

Kas-tle commented Nov 1, 2025

@linsaftw
Copy link
Copy Markdown
Contributor Author

linsaftw commented Nov 1, 2025

Have you tried without PacketEvents? Seems like this exception is caused by PacketEvents

No thats one of many exceptions. I already made a PR for PacketEvents, I also have made a PR for floodgate, and now for ViaVersion. You have to handle inactive channel from other pipeline handlers! Weird to see this hasn't been merged yet. Its not overly complicated! VeloFlame (close and dont inject minecraft decoder when vpn detected) -> Floodgate (channel was not injected, error) -> PacketEvents (same as floodgate) -> ViaVersion (same as floodgate)

@linsaftw
Copy link
Copy Markdown
Contributor Author

linsaftw commented Nov 1, 2025

Done, thank you guys for your insight, you actually right!

@linsaftw
Copy link
Copy Markdown
Contributor Author

linsaftw commented Nov 2, 2025

image Works perfectly!

@Tim203
Copy link
Copy Markdown
Member

Tim203 commented Nov 2, 2025

I have to agree with the comment made on your PR to ViaVersion: ViaVersion/ViaVersion#4701 (comment)
I know you're only suggesting a minor change, but we shouldn't have to check whether the channel is closed.
You simply shouldn't call our initializer if we shouldn't init the channel (or manually clear the pipeline).
Especially as a fork you have so many options to make a generic solution that works across all plugins, instead of every plugin having to work around your behavior.

@Tim203 Tim203 closed this Nov 2, 2025
@linsaftw
Copy link
Copy Markdown
Contributor Author

linsaftw commented Nov 2, 2025

I have to agree with the comment made on your PR to ViaVersion: ViaVersion/ViaVersion#4701 (comment) I know you're only suggesting a minor change, but we shouldn't have to check whether the channel is closed. You simply shouldn't call our initializer if we shouldn't init the channel (or manually clear the pipeline). Especially as a fork you have so many options to make a generic solution that works across all plugins, instead of every plugin having to work around your behavior.

Thank you so much. We changed this on our end. Thank you so much for pointing out the issue!

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.

5 participants