Interface Client
-
Method Summary
Modifier and TypeMethodDescriptionThe display name of the character on this client, once the host knows it.Returns the event bus for this client.Returns the game API for this client.getName()Returns the unique name identifying this client connection.booleanChecks whether this client is still connected to the game server.snapshot()Returns a tick-scoped read view of the producer's current game state.
-
Method Details
-
getName
String getName()Returns the unique name identifying this client connection.- Returns:
- the client name
-
getGameAPI
-
getEventBus
-
isConnected
boolean isConnected()Checks whether this client is still connected to the game server.- Returns:
trueif the connection is active
-
snapshot
GameSnapshot snapshot()Returns a tick-scoped read view of the producer's current game state. Each call returns a fresh snapshot bound to the producer's currently published buffer; do not cache the result across ticks. Returnsnullwhen this client was constructed without a shared-memory binding (e.g. headless/test contexts).- Returns:
- a
GameSnapshot, ornullwhen unbound
-
getDisplayName
The display name of the character on this client, once the host knows it.When the client was launched for a known Jagex character, this is that character's name from the login screen on, and through the lobby. Once in a world it is the name the client reports for the logged-in player; if that differs from the launched character (the client was relogged as someone else), the logged-in name wins. Otherwise, for a client not launched for a known Jagex character, it is empty until the client is in a world and the host has read the name, and empty again after a logout. Either way it can be briefly empty right after a login state change while the host re-reads it. A later login, including as a different character, is picked up without reconnecting. Cheap to call: it never blocks on the client.
The default returns empty, for clients that are not bound to a live game client (test and headless contexts).
- Returns:
- the character's display name, or empty while it is not known
-