Fix list_players and get_player_position hanging forever#3
Open
ChadRM wants to merge 1 commit into
Open
Conversation
Both handlers called Universe.get().getPlayers()/PlayerRef.getTransform() directly on the Jetty request thread instead of hopping onto the world thread via world.execute(), unlike every other stateful feature (get_world_info, give_item, set_block, etc). They also used stale types (List<PlayerRef> instead of Collection<PlayerRef>, and fully-qualified Vector3d/Vector3f which no longer exist) that no longer match the live HytaleServer API (getPlayers() returns Collection; Transform.getPosition() returns org.joml.Vector3d; Transform.getRotation() returns Rotation3f). Because the outer catch only caught Exception, the resulting NoSuchMethodError/NoClassDefFoundError was swallowed by whatever thread ran the sync tool handler without ever completing the MCP SDK's response future, so HttpServletStreamableServerTransportProvider.doPost's Mono.block() hung forever with no server-side log output at all. Verified against a live server: both tools now return correctly instead of timing out, with a connected player and with zero players. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
Fixes the hang reported in #2 for
list_playersandget_player_position.Both handlers called
Universe.get().getPlayers()/PlayerRef.getTransform()directly on the Jetty request thread instead of hopping onto the world thread viaworld.execute(), unlike every other stateful feature (get_world_info,give_item,set_block, etc). They also used stale types (List<PlayerRef>instead ofCollection<PlayerRef>, and fully-qualifiedVector3d/Vector3ftypes that no longer exist) that don't match the currentHytaleServerAPI:Universe.getPlayers()returnsCollection<PlayerRef>, notList<PlayerRef>Transform.getPosition()returnsorg.joml.Vector3d, notcom.hypixel.hytale.math.vector.Vector3dTransform.getRotation()returnscom.hypixel.hytale.math.vector.Rotation3f, notVector3fBecause the outer
catchonly caughtException, the resultingNoSuchMethodError/NoClassDefFoundErrorfrom this API mismatch was silently swallowed by whatever thread ran the sync tool handler, without ever completing the MCP SDK's response future. That leftHttpServletStreamableServerTransportProvider.doPost'sMono.block()blocked forever, with zero server-side log output — indistinguishable from a network-level hang.Root cause (confirmed via thread dump)
A
jstackthread dump taken mid-hang showed every stuck request parked at:Compiling the plugin against the actual live
HytaleServer.jar(rather than whatever version it was originally built against) reproduced the API mismatch directly as compile errors, confirming the root cause.Test plan
mvn test— all 9 existing tests passmvn package— builds cleanly against the live server's actualHytaleServer.jarandnitrado-webserver.jarlist_playerswith 0 players connected:{"count":0,"players":[]}(previously hung forever)list_playerswith 1 player connected: returns correct player listget_player_positionfor a connected player: returns correct live x/y/z/yaw/pitch🤖 Generated with Claude Code