Repository navigation
Adding more options for configuring ping passthrough. #1870
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
Merged
WouterGritter
merged 14 commits into
PaperMC:dev/4.0.0
from
TheMiningTeamYT:ping-passthrough-clean
Sep 1, 2026
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f9c03d9
Added 'ALLBUTVERSION' option for ping passthrough.
70a4383
Added more configuration options for ping passthrough.
d1640b6
Updated default velocity.toml
a2109cf
Add support for the legacy ping passthrough.
TheMiningTeamYT 3a24c4a
Removed legacy ping passthrough & added config migration
ButterDebugger 8d8acc8
Cleaned up code to match code style
ButterDebugger ec0c630
Update to latest
TheMiningTeamYT 2346929
Move ping passthrough into its own section
TheMiningTeamYT bad5105
Reorder migrations so they occur in the right order.
TheMiningTeamYT 1344650
Clean up ping passthrough related code.
TheMiningTeamYT 1218588
Update file dates and cleanup/consolidate ping-passthrough code.
TheMiningTeamYT e868c43
Update proxy/src/main/java/com/velocitypowered/proxy/config/PingPasst…
WouterGritter 84a2029
Update proxy/src/main/java/com/velocitypowered/proxy/config/PingPasst…
WouterGritter e3c3e97
Remaining nits
WouterGritter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
proxy/src/main/java/com/velocitypowered/proxy/config/migration/PingPassthroughMigration.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| /* | ||
| * Copyright (C) 2024-2026 Velocity Contributors | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| package com.velocitypowered.proxy.config.migration; | ||
|
|
||
| import com.electronwill.nightconfig.core.file.CommentedFileConfig; | ||
| import java.util.Locale; | ||
| import org.apache.logging.log4j.Logger; | ||
|
|
||
| /** | ||
| * Migrate the old ping passthrough entry to separate config entries. | ||
| */ | ||
| public final class PingPassthroughMigration implements ConfigurationMigration { | ||
| @Override | ||
| public boolean shouldMigrate(final CommentedFileConfig config) { | ||
| return configVersion(config) < 2.9; | ||
| } | ||
|
|
||
| @Override | ||
| public void migrate(final CommentedFileConfig config, final Logger logger) { | ||
| // Get legacy ping passthrough value | ||
| final String legacyMode = config.getOrElse("ping-passthrough", "DISABLED") | ||
| .toUpperCase(Locale.ROOT); | ||
| boolean version = false; | ||
| boolean players = false; | ||
| boolean description = false; | ||
| boolean favicon = false; | ||
| boolean modinfo = false; | ||
|
|
||
| switch (legacyMode) { | ||
| case "ALL": | ||
| version = true; | ||
| players = true; | ||
| description = true; | ||
| favicon = true; | ||
| modinfo = true; | ||
| break; | ||
| case "DESCRIPTION": | ||
| description = true; | ||
| modinfo = true; | ||
| break; | ||
| case "MODS": | ||
| modinfo = true; | ||
| break; | ||
| default: // DISABLED | ||
| break; | ||
| } | ||
|
|
||
| config.removeComment("ping-passthrough"); | ||
| config.remove("ping-passthrough"); | ||
|
WouterGritter marked this conversation as resolved.
|
||
|
|
||
| config.setComment("announce-forge", | ||
| " Announce whether or not your server supports Forge. If you run a modded server, we\n" | ||
| + " suggest turning this on.\n" | ||
| + "\n" | ||
| + " If your network runs one modpack consistently, consider using ping-passthrough.modinfo = true\n" | ||
| + " instead for a nicer display in the server list."); | ||
|
|
||
| config.set("ping-passthrough.version", version); | ||
| config.setComment( | ||
| "ping-passthrough.version", | ||
| " Should Velocity pass the version number from the backend server when responding to server list ping requests?" | ||
| ); | ||
|
|
||
| config.set("ping-passthrough.players", players); | ||
| config.setComment( | ||
| "ping-passthrough.players", | ||
| " Should Velocity pass the player count from the backend server when responding to server list ping requests?" | ||
| ); | ||
|
|
||
| config.set("ping-passthrough.description", description); | ||
| config.setComment( | ||
| "ping-passthrough.description", | ||
| " Should Velocity pass the description from the backend server when responding to server list ping requests?" | ||
| ); | ||
|
|
||
| config.set("ping-passthrough.favicon", favicon); | ||
| config.setComment( | ||
| "ping-passthrough.favicon", | ||
| " Should Velocity pass the favicon (also known as the server icon) from the backend server when responding to server list ping requests?" | ||
| ); | ||
|
|
||
| config.set("ping-passthrough.modinfo", modinfo); | ||
| config.setComment( | ||
| "ping-passthrough.modinfo", | ||
| " Should Velocity pass the mod list from the backend server when responding to server list ping requests?" | ||
| ); | ||
|
|
||
| config.set("config-version", "2.9"); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.