Skip to content

Conversation

Camotoy
Copy link
Member

@Camotoy Camotoy commented Aug 31, 2024

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 - config.yml and config-advanced.yml (name subject to change to something that will always place it below config.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. This will be done at a later date.
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.

Camotoy and others added 25 commits May 23, 2024 19:57
Improve node ordering when updating configs
@Camotoy Camotoy added the PR: Needs Testing When a PR needs testing but is currently not under review label Sep 25, 2024
@Konicai Konicai linked an issue Sep 26, 2024 that may be closed by this pull request
Copy link
Member

@Konicai Konicai left a 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

Comment on lines 101 to 118
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();
}
}
Copy link
Member

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

Copy link
Member Author

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.

@onebeastchris onebeastchris linked an issue Jan 29, 2025 that may be closed by this pull request
onebeastchris and others added 9 commits February 27, 2025 19:31
# 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
Copy link
Member

@onebeastchris onebeastchris left a 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!

Comment on lines +124 to 127
// TODO remove
if (System.getProperty("geyser.viaproxy.disableIpPassthrough") != null) { // Temporary until Configurate branch is merged
return;
}
Copy link
Member

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\".");
}

Copy link
Member

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

Comment on lines -42 to -50
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;
}
}

Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Needs Testing When a PR needs testing but is currently not under review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expired Discord CDN links Per-Platform Configuration Options
4 participants