-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add configuration interface to expose certain config values #12273
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: main
Are you sure you want to change the base?
Conversation
This commit introduces methods to check the online mode and enablement status of Velocity and BungeeCord. These changes allow plugins to easily query proxy-related server configurations.
I wouldn't be immediately opposed to a new interface where select values from the configuration can be exposed more directly. I wouldn't want even more methods on Bukkit/Server for this though. I think there are probably these and several more values which we can consider stable enough to expose in the API. |
I like that idea, let me cook something up |
moved all previously added methods to the new server config interface
I've added a new interface |
@@ -0,0 +1,38 @@ | |||
package io.papermc.paper.configuration; | |||
|
|||
public interface ServerConfiguration { |
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.
Probably wanna note here that this class doesn't aim to expose every single config option in existance, only select ones.
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.
I feel like "selected critical settings." still makes it rather vague. Like why exactly are those critical? Are they critical for the server? The plugin dev? Both?
Maybe mentioning why they are considered critical would be beneficial here.
paper-api/src/main/java/io/papermc/paper/configuration/ServerConfiguration.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/configuration/ServerConfiguration.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/configuration/ServerConfiguration.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/configuration/ServerConfiguration.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/configuration/ServerConfiguration.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/configuration/ServerConfiguration.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/configuration/ServerConfiguration.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/configuration/ServerConfiguration.java
Outdated
Show resolved
Hide resolved
paper-server/src/main/java/io/papermc/paper/configuration/PaperServerConfiguration.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/configuration/ServerConfiguration.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/configuration/ServerConfiguration.java
Outdated
Show resolved
Hide resolved
While I approve of the general concept of this, I'm not entirely fond about having highly specific stuff exposed if the context starts relating into stuff like security aspects, etc; i.e. what happens if we add a brand new forwarding mechanism that has its own option, does that get merged into the existing one or do we have an entire open hole? Do we really need this level of accessibility? |
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.
Some comments regarding the comments.
@@ -0,0 +1,38 @@ | |||
package io.papermc.paper.configuration; | |||
|
|||
public interface ServerConfiguration { |
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.
I feel like "selected critical settings." still makes it rather vague. Like why exactly are those critical? Are they critical for the server? The plugin dev? Both?
Maybe mentioning why they are considered critical would be beneficial here.
paper-api/src/main/java/io/papermc/paper/configuration/ServerConfiguration.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/configuration/ServerConfiguration.java
Outdated
Show resolved
Hide resolved
# Conflicts: # paper-api/src/main/java/org/bukkit/Bukkit.java # paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java
As written in the ServerConfiguration docs, it only aims to provide the most important settings
|
these settings are important why? What is the merit of exposing them individually rather than exposing the underlying concepts behind them? |
I don't think I can follow. What do you mean by "the underlying concepts"? |
Yes, so, isProxyOnline mode makes sense, individual bungee/velocity forwarding mode ones, I'm not sure about |
You are right, thinking about it, I don't see a real upside in exposing them. |
I removed the forwarding mode related methods |
It could be useful in case there would be Velocity-only features to use through Paper in the future. |
If there are such features in the future, we can expand this type 😉 |
I mean, the two major things I'd imagine plugins might want to see on this front are "Are we in online mode?" and "Are we behind a proxy?" disambiguation is complex, I generally wouldn't want us to be in a state where we add support for some new proxy mode and now every plugin relying on this API to check that is broken |
Previously, people (I) have been using the spigot and paper file configurations to determine whether the server is configured for proxy online mode
Now the spigot interface got deprecated for good reasons, but there is no alternative
This commit introduces methods to check the online mode and enablement status of Velocity and BungeeCord. These changes allow plugins to easily query proxy-related server configurations.
I would like to have some input on the method names since Bukkit uses getOnlineMode
Also, I wasn't really sure on whether to return bungee/velocity online mode true only if the server is actually using bungee or velocity