SpigotMC / BungeeCord

BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft servers.
https://www.spigotmc.org/go/bungeecord
Other
1.53k stars 1.09k forks source link

Add ChannelInitializeEvent #3697

Open Outfluencer opened 3 weeks ago

Outfluencer commented 3 weeks ago

Would be a great access point for Developers to inject the pipe of incoming connections and connections from the proxy to the backend. ViaVersion would like to have this as accesspoint as they don't have nice accesspoints to get the channel for proxy to backend connection

Outfluencer commented 3 weeks ago

i am not sure if netty channels are fine as api but they would appreciate it

md-5 commented 2 weeks ago

There's no guarantee that bungee uses Netty (and earlier versions didn't)

FlorianMichael commented 2 weeks ago

Anything against moving this event to an internal submodule/marking it as internal API then? Also in case Bungee ever drops Netty, this will effect all plugins which would need this event anyway, making no real difference.

Janmm14 commented 2 weeks ago

maybe prefixing this event class name with "Unsafe" could be an acceptable solution?

Outfluencer commented 2 weeks ago

There's no guarantee that bungee uses Netty (and earlier versions didn't)

I am a bit confused.

bungeecord-protocol is part of the api and it fully depends on netty. so whats the problem with adding an event for channel initialization.

Also would it not make more sence if the compress package in the proxy module would be in the protocol module? (same with netty cipher package)?

They dont depend on any proxy module stuff and all the other netty codec stuff is also in the protocol module

Outfluencer commented 2 weeks ago

if we change this we could also put the ChannelWrapper into the protocol package and call the Event for the creation of an ChannelWrapper instead of a channel initialization. (the channelwrapper is created in the channelActive in the HandlerBoss (everyone who want to can inject right there) also the ChannelWrapper is an api like wrapper

md-5 commented 2 weeks ago

bungeecord-protocol is part of the api and it fully depends on netty. so whats the problem with adding an event for channel initialization.

Only as part of the .unsafe() packet sending

Outfluencer commented 2 weeks ago

bungeecord-protocol is part of the api and it fully depends on netty. so whats the problem with adding an event for channel initialization.

Only as part of the .unsafe() packet sending

we can also move the event into the protocol module and call it unsafe like @Janmm14 suggests Edit: nvm we need to extend from event we cant move it to protocol module

md-5 commented 2 weeks ago

I still don't think this should be API