feat(proxy): prefix-based player suggestions, and ship the plugin image#10
Merged
Conversation
plugin-proxy already had the right shape — local-first lookups, NATS delivery to whichever proxy holds the player — but two things kept it from being usable. It never shipped an artifact: no image, no maven release. So neither it nor anything depending on it (chat, social) could be deployed. Add the standard docker-gradle-build-push workflow and a Dockerfile carrying the shaded JAR at /jar/plugin.jar. And `getOnlinePlayerNames()` asked for every online player on the network. That feeds tab-complete, which Velocity fires on every keystroke — at 10k players online it is a ~200 KB response, thousands of times a second, plus a table scan behind it. Replace it with `suggestPlayerNames(prefix, limit)`: local players are answered from memory, the network is only asked once the prefix is at least two characters, answers are cached for 2s, and the result is capped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E92vTegZqXd2HqjE7jnDJz
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.
plugin-proxy is the piece that makes chat and social work across proxies:
ProxyServiceImplalready resolves a player locally first and falls back to aPlayerSessionQuery, and delivers to remote players over NATS (proxy.system.<id>,proxy.transfer.<id>). Two things kept it from being usable.It never shipped
No image, no maven release — so plugin-proxy could not be deployed, and nothing could compile against
plugin-proxy-api(plugin-chat's build referencedlocal-SNAPSHOT, i.e. whatever was in the developer's mavenLocal). Adds the standarddocker-gradle-build-pushworkflow (edge on main, semver on tag) and a Dockerfile carrying the shaded JAR at/jar/plugin.jar, the shape theplugin-velocity-jarchart expects.getOnlinePlayerNames()does not scaleIt asked for every online player on the network. That call feeds tab-complete, which Velocity fires on every keystroke — so at 10k players online it is a ~200 KB response, issued thousands of times a second, with a table scan behind each one.
Replaced with
suggestPlayerNames(prefix, limit):PlayerSessionQuery.suggestNamesis contractually a prefix search, not a roster dumpPlayerSessionQuery.getOnlinePlayers()is gone from the API for the same reason — an unbounded list on a per-keystroke path is a footgun, not a feature.Tests
SuggestionCacheTest: repeated prefixes hit the cache, prefixes are case-insensitive, stale entries are re-fetched, the cache evicts instead of growing forever, and merge puts local players first while de-duplicating and capping.Image verified with a local
docker build --secret id=github_token ….Next
service-player implements the lookup RPCs (groundsgg/library-grpc-contracts#68, released as player 0.3.0); plugin-player registers a
PlayerSessionQuerybacked by them; chat and social then drop their local-only lookups and useProxyService.🤖 Generated with Claude Code
https://claude.ai/code/session_01E92vTegZqXd2HqjE7jnDJz