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

Expose ChannelInitializerHolder in protocol module #3776

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Outfluencer
Copy link
Collaborator

As the protocol module already exposes netty, i think its the best to also put this ChannelInitializerHolder here.

It allows for big plugins like Geyser and ViaVersion to access and modify the channel initializers of the serverchild and backendconnector.

This PR makes the development of software that modifies the networking much easier

I tried to impl it as simple as possible, and expose only the ChannelInitilizers in a nice way

@Outfluencer Outfluencer added java Pull requests that update Java code PR: Needs Review labels Feb 1, 2025
@Outfluencer
Copy link
Collaborator Author

@md-5 what do you think about those changes, i think they are much better than #3697

@md-5
Copy link
Member

md-5 commented Feb 6, 2025

I think if we're going to go down this path it should be a proper factory design

@Outfluencer
Copy link
Collaborator Author

Outfluencer commented Feb 6, 2025

I think if we're going to go down this path it should be a proper factory design

Can you tell me what a proper factory design looks like for you?

…to make-channel-init-accessable

# Conflicts:
#	protocol/src/main/java/net/md_5/bungee/protocol/holder/ChannelInitializerHolder.java
#	proxy/src/main/java/net/md_5/bungee/netty/PipelineUtils.java
@Outfluencer Outfluencer requested a review from md-5 February 7, 2025 09:42
* Holds the channel initializer for incoming connections
*/
@Getter
private static BungeeChannelInitializer frontendHolder;
Copy link
Member

Choose a reason for hiding this comment

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

I think these shouldn't be static

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should i put the non static objects into BungeeCord.java and make them accessable via

ProxyServer.getInstance().unsafe()?

@Outfluencer Outfluencer requested a review from md-5 February 11, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java Pull requests that update Java code PR: Needs Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants