public interface ConnectionManager
Modifier and Type | Method and Description |
---|---|
@Nullable UserConnection |
getConnectedClient(java.util.UUID clientIdentifier)
Returns the frontend UserConnection from the player connected to this proxy server
Returns null when there isn't a server or connection was not found
When ViaVersion is reloaded, this method may not return some players.
|
@Nullable java.util.UUID |
getConnectedClientId(UserConnection connection)
Returns the UUID from the frontend connection to this proxy server
Returns null when there isn't a server or this connection isn't frontend or it doesn't have an id
When ViaVersion is reloaded, this method may not return some players.
|
java.util.Map<java.util.UUID,UserConnection> |
getConnectedClients()
Returns a map containing the UUIDs and frontend UserConnections from players connected to this proxy server
Returns empty list when there isn't a server
When ViaVersion is reloaded, this method may not return some players.
|
java.util.Set<UserConnection> |
getConnections()
Returns all UserConnections which are registered
May contain duplicated UUIDs on multiple ProtocolInfo.
|
boolean |
isClientConnected(java.util.UUID playerId)
Returns if Via injected into this player connection.
|
default boolean |
isFrontEnd(UserConnection connection)
Frontend connections will have the UUID stored.
|
void |
onDisconnect(UserConnection connection) |
void |
onLoginSuccess(UserConnection connection) |
boolean isClientConnected(java.util.UUID playerId)
playerId
- player uuiddefault boolean isFrontEnd(UserConnection connection)
@Nullable UserConnection getConnectedClient(java.util.UUID clientIdentifier)
Note that connections are removed as soon as their channel is closed, so avoid using this method during player quits for example.
@Nullable java.util.UUID getConnectedClientId(UserConnection connection)
Note that connections are removed as soon as their channel is closed, so avoid using this method during player quits for example.
java.util.Set<UserConnection> getConnections()
java.util.Map<java.util.UUID,UserConnection> getConnectedClients()
void onLoginSuccess(UserConnection connection)
void onDisconnect(UserConnection connection)