PaperMC / Velocity

The modern, next-generation Minecraft server proxy.
https://papermc.io/software/velocity
GNU General Public License v3.0
1.78k stars 627 forks source link

Config version updates breaks forced-hosts section #1405

Closed valaphee closed 2 months ago

valaphee commented 2 months ago

Expected Behavior

When a config version is update the forced-hosts section should stay

[servers]
# Configure your servers here. Each key represents the server's name, and the value
# represents the IP address of the server to connect to.
lobby = "127.0.0.1:25578"
#factions = "127.0.0.1:30067"
#minigames = "127.0.0.1:30068"

# In what order we should try servers when a player logs in or is kicked from a server.
try = ["lobby"]

[forced-hosts]
# Configure your forced hosts here.
#"lobby.example.com" = [
#    "lobby"
#]
#"factions.example.com" = [
#    "factions"
#]
#"minigames.example.com" = [
#    "minigames"
#]

Actual Behavior

forced-hosts = {}

[servers]
    # Configure your servers here. Each key represents the server's name, and the value
    # represents the IP address of the server to connect to.
    lobby = "127.0.0.1:25578"
    #factions = "127.0.0.1:30067"
    #minigames = "127.0.0.1:30068"
    # In what order we should try servers when a player logs in or is kicked from a server.
    try = ["lobby"]
# Configure your forced hosts here.
#"lobby.example.com" = [
#    "lobby"
#]
#"factions.example.com" = [
#    "factions"
#]
#"minigames.example.com" = [
#    "minigames"
#]

Steps to Reproduce

Having a legacy config (or changing the config version), and starting velocity

Plugin List

N/A

Velocity Version

Latest commit

Additional Information

No response

electronicboy commented 2 months ago

those both represent the exact same thing, just in a different format?

valaphee commented 2 months ago

They are semantically the same, but they get reordered except the comments, which are now misleading.

    try = ["lobby"]
# Configure your forced hosts here.
#"lobby.example.com" = [
#    "lobby"
#]

uncommenting would logically break the config, and its also not immediately clear where it even belongs,

just smth I noticed, would probably better to correct the order, have a placeholder value (like Bungee) or to remove this comment if it breaks anyway.

electronicboy commented 2 months ago

This is generally just how trailing comments tend to work, they're not affixed to a node and so are generally just kept inline or something. This is not really something worth spending our time on.