-
-
Notifications
You must be signed in to change notification settings - Fork 763
Switch config system to Configurate #5010
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: master
Are you sure you want to change the base?
Conversation
Improve node ordering when updating configs
core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java
Outdated
Show resolved
Hide resolved
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.
14 files left that are more closely related to config loading. can probably get to those on friday
core/src/main/java/org/geysermc/geyser/util/metrics/MetricsPlatform.java
Show resolved
Hide resolved
core/src/test/java/org/geysermc/geyser/configuration/ConfigLoaderTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/text/AsteriskSerializer.java
Outdated
Show resolved
Hide resolved
try { | ||
// Workaround for JsonAdapter not being allowed on methods | ||
ConfigurationOptions options = InterfaceDefaultOptions.addTo(ConfigurationOptions.defaults(), builder -> | ||
builder.addProcessor(AsteriskSerializer.Asterisk.class, String.class, AsteriskSerializer.CONFIGURATE_SERIALIZER)) | ||
.shouldCopyDefaults(false); | ||
|
||
ConfigurationNode configNode = CommentedConfigurationNode.root(options); | ||
configNode.set(geyser.config()); | ||
this.config = configNode.get(geyser.config().getClass()); | ||
|
||
ConfigurationNode advancedConfigNode = CommentedConfigurationNode.root(options); | ||
advancedConfigNode.set(geyser.config().advanced()); | ||
this.advancedConfig = advancedConfigNode.get(AdvancedConfig.class); | ||
} catch (SerializationException e) { | ||
if (geyser.config().debugMode()) { | ||
e.printStackTrace(); | ||
} | ||
} |
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.
Can we use configurate-gson
instead? Should only increase jar size by 6 classes at first glance
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 did attempt that once... I think I can try again.
bootstrap/mod/src/main/java/org/geysermc/geyser/platform/mod/GeyserModBootstrap.java
Show resolved
Hide resolved
Co-authored-by: Konicai <[email protected]>
# Conflicts: # bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/GeyserSpigotInjector.java # bootstrap/standalone/src/main/java/org/geysermc/geyser/platform/standalone/GeyserStandaloneBootstrap.java # bootstrap/standalone/src/main/java/org/geysermc/geyser/platform/standalone/GeyserStandaloneLogger.java # bootstrap/viaproxy/src/main/java/org/geysermc/geyser/platform/viaproxy/GeyserViaProxyPlugin.java # core/src/main/java/org/geysermc/geyser/GeyserImpl.java # core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java # core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java # core/src/main/java/org/geysermc/geyser/registry/populator/CreativeItemRegistryPopulator.java # core/src/main/java/org/geysermc/geyser/registry/type/GeyserMappingItem.java # core/src/main/java/org/geysermc/geyser/session/GeyserSession.java # core/src/main/resources/mappings
# Conflicts: # bootstrap/viaproxy/src/main/java/org/geysermc/geyser/platform/viaproxy/GeyserViaProxyLogger.java # build-logic/src/main/kotlin/geyser.base-conventions.gradle.kts # core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java # core/src/main/java/org/geysermc/geyser/pack/GeyserResourcePackManifest.java # core/src/main/java/org/geysermc/geyser/registry/loader/SoundRegistryLoader.java # core/src/main/java/org/geysermc/geyser/util/WebUtils.java # gradle/libs.versions.toml
* Add and rename some config options, add section notes * adjust message * Update core/src/main/java/org/geysermc/geyser/command/defaults/ConnectionTestCommand.java Co-authored-by: Eclipse <[email protected]> * Update core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java Co-authored-by: Eclipse <[email protected]> * Update ConfigLoader.java * Update AdvancedConfig.java * clarify that we're talking about the HAProxy protocol * rename config option to use-haproxy-protocol * remove ominous warning sign on xbox auth warning * adjust wording --------- Co-authored-by: Eclipse <[email protected]>
# Conflicts: # bootstrap/bungeecord/build.gradle.kts # bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeePlugin.java # bootstrap/mod/neoforge/build.gradle.kts # bootstrap/spigot/build.gradle.kts # bootstrap/velocity/build.gradle.kts # bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityInjector.java # bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityPlugin.java # core/src/main/java/org/geysermc/geyser/GeyserImpl.java # core/src/main/java/org/geysermc/geyser/command/CommandRegistry.java # core/src/main/java/org/geysermc/geyser/command/defaults/DumpCommand.java # core/src/main/java/org/geysermc/geyser/command/defaults/VersionCommand.java # core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java # core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java # core/src/main/java/org/geysermc/geyser/network/netty/GeyserServer.java # core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java # core/src/main/java/org/geysermc/geyser/session/GeyserSessionAdapter.java # core/src/main/java/org/geysermc/geyser/skin/SkinManager.java # core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockCommandRequestTranslator.java # core/src/main/java/org/geysermc/geyser/util/LoginEncryptionUtils.java # core/src/main/java/org/geysermc/geyser/util/WebUtils.java # gradle/libs.versions.toml
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.
LGTM, let's get this merged!
// TODO remove | ||
if (System.getProperty("geyser.viaproxy.disableIpPassthrough") != null) { // Temporary until Configurate branch is merged | ||
return; | ||
} |
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.
marking the todo
logger.warning("Geyser is configured to use proxy protocol when connecting to the Java server."); | ||
logger.warning("If you do not know what this is, open the Geyser config, and set \"use-haproxy-protocol\" under the \"java\" section to \"false\"."); | ||
} | ||
|
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.
which version is better? Both are fine for me; but they should probably be the same
if (session.getGeyser().getConfig().getEmoteOffhandWorkaround() != EmoteOffhandWorkaroundOption.DISABLED) { | ||
// Activate the workaround - we should trigger the offhand now | ||
session.requestOffhandSwap(); | ||
|
||
if (session.getGeyser().getConfig().getEmoteOffhandWorkaround() == EmoteOffhandWorkaroundOption.NO_EMOTES) { | ||
return; | ||
} | ||
} | ||
|
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.
are we sure we want to yeet this? if yes, we should make an official replacement
The primary goal of this PR is to facilitate config changes required for the Floodgate merge, while also allowing for automatic config file generation and updates, as well as customizing configs depending on the features available to a platform.
We have also decided to remove usage of the Jackson library within Geyser. While it has its benefits over Gson, ultimately all platforms have Gson access (and our libraries utilize Gson alongside that) and Jackson is a hefty dependency to shade within Geyser.
User-facing changes
The config file is split into two files -This will be done at a later date.config.yml
andconfig-advanced.yml
(name subject to change to something that will always place it belowconfig.yml
alphabetically). The primary config will consist of values that a typical user needs to change for a typical setup or other basic config values. The advanced config will consist of values that we don't want most users to change, while still being accessible to tech-savvy users.The ultimate goal is to keep setup super-simple while still allowing Geyser to be customizable.
Metrics config options are now moved to platform global configs, if they currently exist.