Interface ProfileLookupService
Reached through AltsRuntime#profileLookup; there is no public factory.
"No such player" is an answer here, not a failure: a lookup that finds nobody returns empty, and an
AltsException is kept for a service that could not be reached or refused to answer.
Not designed for host implementation; methods may be added in minor releases.
- Since:
- 0.12.0
-
Method Summary
Modifier and TypeMethodDescriptionLooks a player up by username.byNames(Collection<String> names) Looks up several players by username.Looks a player up by UUID.
-
Method Details
-
byName
Looks a player up by username. Names match without regard to case, and the result carries the name as the player capitalised it.- Parameters:
name- the username- Returns:
- the player, or empty when nobody has that name — including a name that no player could hold at all (empty, longer than 16 characters, or using a character outside letters, digits, and underscore), which is answered without a request. A name of one or two characters is looked up: none can be taken today, but accounts that predate the minimum still hold them
- Throws:
AltsException- if the service was rate limiting, refused, or could not be reached- Since:
- 0.12.0
-
byUuid
Looks a player up by UUID.- Parameters:
uuid- the UUID, dashed or undashed- Returns:
- the player, or empty when no player has that UUID — including a value that is not a UUID at all, which is answered without a request
- Throws:
AltsException- if the service was rate limiting, refused, or could not be reached- Since:
- 0.12.0
-
byNames
Looks up several players by username. A name nobody has is simply absent from the result, as is one that is not a valid username; a name given more than once, in any capitalisation, is resolved once.Any number of names is accepted. They are sent to the batch endpoint ten at a time, so the distinct valid names cost one request per ten. A very long list is still the caller's to pace: a rate limit part-way through fails the call with an exception for which the failure's kind is
AltsFailure.Kind.RATE_LIMITEDand itsAltsFailure.retryAfter()carries any stated wait, rather than returning a partial answer that reads as "those players do not exist".- Parameters:
names- the usernames to resolve- Returns:
- the players found, in the order their names were first given
- Throws:
AltsException- if the service was rate limiting, refused, or could not be reached- Since:
- 0.12.0
-