Interface Client
public interface Client
A player session represents the state of an online player and its corresponding web client connection.
It's used to interact with the webclient, determine and change state and hook back into the platform specific user object.
-
Method Summary
Modifier and TypeMethodDescriptiongetActor()
Get the actor of the underlying User (usually a player)int
Get the volume of the client (media volume, 0-100, -1 if unknown or not applicable)boolean
If this session has an active voice chat instanceboolean
If this client currently has the web session openboolean
If this the actor's microphone is muted, false if the actor is not in a voice chatboolean
If the actor is currently in moderation modevoid
kickProximityPeer
(@NotNull Client otherClient) Forcefully remove a player from my proximity chat peers.void
Add a on connect handler, which fires when the client gets opened for the playervoid
onDisconnect
(Runnable runnable) Add a on connect handler, which fires when the client gets closed for by playervoid
Play a media for this client
-
Method Details
-
getActor
Actor getActor()Get the actor of the underlying User (usually a player)- Returns:
- the actor
-
onConnect
Add a on connect handler, which fires when the client gets opened for the player- Parameters:
runnable
- Handler
-
onDisconnect
Add a on connect handler, which fires when the client gets closed for by player- Parameters:
runnable
- Handler
-
isConnected
boolean isConnected()If this client currently has the web session open- Returns:
- if the client is connected
-
hasVoicechatEnabled
boolean hasVoicechatEnabled()If this session has an active voice chat instance- Returns:
- if the client is in a voice chat
-
isMicrophoneMuted
boolean isMicrophoneMuted()If this the actor's microphone is muted, false if the actor is not in a voice chat- Returns:
- if the microphone is muted
-
getVolume
int getVolume()Get the volume of the client (media volume, 0-100, -1 if unknown or not applicable)- Returns:
- the volume
-
isModerating
boolean isModerating()If the actor is currently in moderation mode- Returns:
- if the actor is moderating
-
playMedia
Play a media for this client- Parameters:
media
- the media to play
-
kickProximityPeer
Forcefully remove a player from my proximity chat peers. This will cause the otherClient to trigger a new ClientPeerAddEvent Useful for refreshing peers when someone changes game modes, for example. This method will not do anything if this user isn't in voice chat, if they aren't a peer, or if the other client isn't in voice chat. This action is **one-sided**. The other client will still be listening to this client.- Parameters:
otherClient
- the client to remove
-