UdpServerConnectionManager

Manages UdpServerConnections and their secrets. Also used to send Plasmo Voice related UDP packets to the players. Secrets are used to identify UDP connection owners.

Functions

Link copied to clipboard
abstract fun addConnection(@NotNull connection: @NotNull UdpServerConnection)
Adds a connection to the connection map.
Link copied to clipboard
abstract fun broadcast(p: @NotNull Packet<T>, p1: Predicate<P>)
Link copied to clipboard
abstract fun clearConnections()
Clears all connections.
Link copied to clipboard
abstract fun getConnectionByPlayerId(p: @NotNull UUID): Optional<C>
Link copied to clipboard
abstract fun getConnectionBySecret(p: @NotNull UUID): Optional<C>
Link copied to clipboard
abstract fun getConnections(): Collection<C>
Link copied to clipboard
abstract fun getPlayerIdBySecret(@NotNull secret: @NotNull UUID): Optional<UUID>
Gets the player UUID by secret.
Link copied to clipboard
@NotNull
abstract fun getSecretByPlayerId(@NotNull playerUUID: @NotNull UUID): @NotNull UUID
Gets the stored secret or generates a new one for a player UUID.
Link copied to clipboard
abstract fun removeConnection(secret: UUID): Boolean
Removes a connection by secret from the connection map.
abstract fun removeConnection(@NotNull player: @NotNull VoiceServerPlayer): Boolean
Removes a connection by player from the connection map.
abstract fun removeConnection(@NotNull connection: @NotNull UdpServerConnection): Boolean
Removes a connection from the connection map.