You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am currently in the process of porting a plugin of mine from BungeeCord to Velocity.
Without getting in to too much detail, the plugin tries to handle pings and login attempts, but only for specific servers behind the proxy (e.g. only for survival.example.com).
Example, the ProxyPingEvent:
My proxy is set to ping-passthrough = "ALL" and has a list of forced hosts.
Now I want to manipulate the ping (e.g. MOTD) for some specific servers only.
However, Velocity has no API to retrieve the chosen target server for the event.
I know that there isn't always a target server for a connection, but in the case of the ping-passthrough, the ping has to come from a specific backend server eventually (provided it doesn't fail).
Meanwhile, in BungeeCord, I was able to achieve this by using PendingConnection#getListener and matching against the list from getServerPriority.
Proposed API:
I am proposing to add it to InboundConnection as this would simultaneously help other similar events too.
However, it should also be possible to create a sub-interface only for the applicable events (in cases where it isn't always empty), if desired.
publicinterfaceInboundConnection {
// .../** * Returns the chosen target server for this connection, if applicable. * Usually matches with {@link InboundConnection#getVirtualHost()}. * * @return the registered server that is targeted for the client */Optional<RegisteredServer> getTargetServer();
}
Alternatives:
AFAIK, the only workaround without reflection is by parsing the velocity.toml config yourself, duplicating the matching algorithm from Velocity's internal classes and trying to find the right server that matches getVirtualHost.
Which would still not guarantee that it always matches the result of Velocity.
The text was updated successfully, but these errors were encountered:
Hi, I am currently in the process of porting a plugin of mine from BungeeCord to Velocity.
Without getting in to too much detail, the plugin tries to handle pings and login attempts, but only for specific servers behind the proxy (e.g. only for
survival.example.com
).Example, the ProxyPingEvent:
My proxy is set to
ping-passthrough = "ALL"
and has a list of forced hosts.Now I want to manipulate the ping (e.g. MOTD) for some specific servers only.
However, Velocity has no API to retrieve the chosen target server for the event.
I know that there isn't always a target server for a connection, but in the case of the ping-passthrough, the ping has to come from a specific backend server eventually (provided it doesn't fail).
Meanwhile, in BungeeCord, I was able to achieve this by using
PendingConnection#getListener
and matching against the list fromgetServerPriority
.Proposed API:
I am proposing to add it to
InboundConnection
as this would simultaneously help other similar events too.However, it should also be possible to create a sub-interface only for the applicable events (in cases where it isn't always empty), if desired.
Alternatives:
AFAIK, the only workaround without reflection is by parsing the
velocity.toml
config yourself, duplicating the matching algorithm from Velocity's internal classes and trying to find the right server that matchesgetVirtualHost
.Which would still not guarantee that it always matches the result of Velocity.
The text was updated successfully, but these errors were encountered: