Interface ConnectionManager
public interface ConnectionManager
Handles injected UserConnections.
Check
UserConnection.isServerSide()
and UserConnection.isClientSide()
to determine the connection type.-
Method Summary
Modifier and TypeMethodDescription@Nullable UserConnection
getClientConnection
(UUID uuid) Returns the client UserConnection.Returns a map containing the UUIDs and client UserConnections When ViaVersion is reloaded, this method may not return some players.default @Nullable UserConnection
getConnectedClient
(UUID uuid) Deprecated.default Map<UUID,
UserConnection> Deprecated.Returns all UserConnections which are registered May contain duplicated UUIDs on multiple ProtocolInfo.@Nullable UserConnection
getServerConnection
(UUID uuid) Returns the server UserConnection.Returns a map containing the UUIDs and server UserConnections When ViaVersion is reloaded, this method may not return some players.boolean
hasClientConnection
(UUID uuid) Returns if Via has injected.boolean
hasServerConnection
(UUID uuid) Returns if Via has injected.default boolean
isClientConnected
(UUID uuid) Deprecated.void
onDisconnect
(UserConnection connection) void
onLoginSuccess
(UserConnection connection)
-
Method Details
-
hasServerConnection
Returns if Via has injected. See above for the connection types.- Parameters:
uuid
- player uuid- Returns:
- true if the player is handled by Via
-
isClientConnected
Deprecated. -
hasClientConnection
Returns if Via has injected. See above for the connection types.- Parameters:
uuid
- player uuid- Returns:
- true if the player is handled by Via
-
getServerConnection
Returns the server UserConnection. See above for the connection types. When ViaVersion is reloaded, this method may not return some players.Note that connections are removed as soon as their channel is closed, so avoid using this method during player quits for example.
- Returns:
- server UserConnection of the player or null
-
getConnectedClient
Deprecated. -
getClientConnection
Returns the client UserConnection. See above for the connection types. When ViaVersion is reloaded, this method may not return some players.Note that connections are removed as soon as their channel is closed, so avoid using this method during player quits for example.
- Returns:
- client UserConnection of the player or null
-
getServerConnections
Map<UUID,UserConnection> getServerConnections()Returns a map containing the UUIDs and server UserConnections When ViaVersion is reloaded, this method may not return some players.- Returns:
- map containing the UUIDs and frontend UserConnections
-
getConnectedClients
Deprecated. -
getClientConnections
Map<UUID,UserConnection> getClientConnections()Returns a map containing the UUIDs and client UserConnections When ViaVersion is reloaded, this method may not return some players.- Returns:
- map containing the UUIDs and client UserConnections
-
getConnections
Set<UserConnection> getConnections()Returns all UserConnections which are registered May contain duplicated UUIDs on multiple ProtocolInfo. May contain frontend, backend and/or client-sided connections. When ViaVersion is reloaded, this method may not return some players.- Returns:
- connected UserConnections
-
onLoginSuccess
-
onDisconnect
-