-
-
Notifications
You must be signed in to change notification settings - Fork 776
Feature: per-server info forwarding mode #1655
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
base: dev/3.0.0
Are you sure you want to change the base?
Feature: per-server info forwarding mode #1655
Conversation
What's this?
Every server can use a different forwarding mode to obtain and forward player info.
For instance, if you are running a 1.12 (or lower version) server on a velocity proxy with MODERN player info forwarding the server doesn't support MODERN forwarding. So you need to set LEGACY forwarding mode for that server and velocity will use ONLY FOR THAT SERVER the legacy forwarding mode. The default mode is "FOLLOWUP" mode which uses the player info forwarding mode set in the config.
The main configuration now supports two syntaxes for describing a server:
classic syntax (FOLLOWUP mode): server = "address:port"
new syntax: server = {address = "address:port", forwarding-mode = "MODE"}
all servers created without defining a forwarding mode will use the FOLLOWUP mode.
api/src/main/java/com/velocitypowered/api/proxy/config/ProxyConfig.java
Outdated
Show resolved
Hide resolved
api/src/main/java/com/velocitypowered/api/proxy/server/ServerInfoForwardingMode.java
Outdated
Show resolved
Hide resolved
proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java
Show resolved
Hide resolved
api/src/main/java/com/velocitypowered/api/proxy/server/ServerInfoForwardingMode.java
Show resolved
Hide resolved
proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java
Show resolved
Hide resolved
…Servers() method to avoid breaking compatibility with current versions. ServerInfoForwardingMode.java: added a javadoc for the FOLLOWUP mode and added the NONE mode VelocityConfiguration.java: made "mode" field optional for the new server syntax. Restored old forwarding secret check. VelocityRegisteredServer.java: added the forwarding secret check if forwarding mode is MODERN or BUNGEEGUARD ServerForwardingModeUtil.java: mapped NONE mode to NONE mode in PlayerInfoForwarding.java
proxy/src/main/java/com/velocitypowered/proxy/server/VelocityRegisteredServer.java
Outdated
Show resolved
Hide resolved
proxy/src/main/java/com/velocitypowered/proxy/config/server/BackendServerConfigImpl.java
Outdated
Show resolved
Hide resolved
…guration#validate added requiresNonNull checks on BackendServerConfigImpl
api/src/main/java/com/velocitypowered/api/proxy/config/BackendServerConfig.java
Outdated
Show resolved
Hide resolved
proxy/src/main/java/com/velocitypowered/proxy/ProxyOptions.java
Outdated
Show resolved
Hide resolved
proxy/src/main/java/com/velocitypowered/proxy/util/ServerForwardingModeUtil.java
Outdated
Show resolved
Hide resolved
…rverConfig. Made address and forwardingMode final in its implementation class. deprecated getServers() in favor of getBackendServers() Fixed proxy option syntax for "add-server". Now the syntax is: <name>:<host>:[port]:[forwardingmode] moved ServerInfoForwardingMode conversion from util package to VelocityRegisteredServer#getConfiguredPlayerInfoForwarding
|
did everything! Let me know if there's any other change to do |
api/src/main/java/com/velocitypowered/api/proxy/config/ProxyConfig.java
Outdated
Show resolved
Hide resolved
proxy/src/main/java/com/velocitypowered/proxy/config/server/BackendServerConfigImpl.java
Outdated
Show resolved
Hide resolved
…mentation class in the proxy module. Modified comment in ProxyConfig#getServers
Re-added null checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@Emilxyz we are waiting for you :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are waiting for you
I'm not a team member, just sharing my thoughts, so my approval is not actually required. Also a friendly reminder that everyone is doing this on their free time, so it's not really needed to bump a review request after only a day.
I gave this another look and it basically lgtm other than these minor things in review comments.
Another thought I had (but I would wait with doing any changes) is that maybe we can just use ServerInfo for this instead of adding a new type, they basically share the same fields and probably will continue to do so in the future as well.
Also there is the issue of the planned config api switch which is holding up other things already that would make changes to the config, so be prepared for this pr to also be affected by this
What's this?
With this edit every server can use a different forwarding mode to obtain and forward player info. For instance, if you are running a 1.12 (or lower version) server on a velocity proxy with MODERN player info forwarding the server doesn't support MODERN forwarding. So you can set LEGACY forwarding mode for that server and velocity will use ONLY FOR THAT SERVER the legacy forwarding mode. The default mode is "INHERIT" which uses the player info forwarding mode set in the config.
Note: the INHERIT mode doesn't physically exists. Just set the server forwarding mode to NULL or avoid valuing it in the config
The main configuration now supports two syntaxes for describing a server:
classic syntax (INHERIT mode):
server = "address:port"new syntax:
server = {address = "address:port", forwarding-mode = "MODE"}all servers created without defining a forwarding mode will use the INHERIT mode.
Example of use
Imagine a simple network with a lobby, a 1.8 game mode (like bedwars) and maybe a Fabric 1.21 server.
Fabric needs MODERN forwarding but the 1.8 server cannot use it. So you have two choices:
This system could be very useful for these types of situations!