Repository navigation
fix(lobbyswitcher): report the configured player limit to CloudNet - #416
Merged
Merged
Conversation
CloudNet's Minestom bridge fires one ServerListPingEvent while the extensions load and stores its maximum as the service's Max-Players. Titan set none, so Minestom's default (online + 1 = 1) was stored and the switcher showed a lobby with 2 players as full (2/1). Add lobby.maxPlayers (default 100), report it in every ping and announce it through a JDK-only holder; the bridge extension applies it to the bridge service helper and publishes a service info update. Claude-Session: https://claude.ai/code/session_01GXose9rakuRNZoM3TP3xj1
Contributor
Test results 876 files 876 suites 51m 22s ⏱️ Results for commit c986126. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Root cause
The lobby switcher showed a lobby with 2 players as "Full (2/1)". CloudNet's Minestom bridge (
MinestomBridgeManagement) fires a singleServerListPingEventwhile the extensions load and storesstatus.playerInfo().maxPlayers()as the service'sMax-Players. That happens duringbootstrap.init(), before Titan builds its bean scope, and Titan never set a maximum, so Minestom's default (PlayerInfo.onlineCount()= online, online + 1, i.e. 1 at boot) was stored and never refreshed.Fix
lobby.maxPlayers(default 100, must be >= 1, fails startup naming the key) inruntime.yaml.LobbyPlayerLimitAnnouncerreports it in everyServerListPingEvent(online count and description untouched).TitanPlayerLimit(common). The:bridgeextension registers a listener at init, setsBridgeServiceHelper.maxPlayers()and publishes a service info update once Titan announces. No CloudNet patch; only JDK types cross the classloader boundary.Tests
LobbyPlayerLimitTest: Minestom default is online + 1; ping reports the limit and keeps online/description; limit < 1 is rejected.LobbyPlayerLimitAnnouncerTest: ping reports the limit and the bridge listener hears it.TitanPlayerLimitTest: announce, replay to late listener, clear.ApplicationYamlDefaultsCharacterizationTest: ships 100.check,buildandbootSmokeTestpass locally.Not verified live: the bridge extension's CloudNet calls (no unit test, needs a running CloudNet node).
https://claude.ai/code/session_01GXose9rakuRNZoM3TP3xj1