ServerConnection

Represents a client connection to the server.

The connection is initialized upon receiving the first plasmo:voice/v2 channel packet.

Functions

Link copied to clipboard
abstract fun close()
Closes and cleans up the server connection.
Link copied to clipboard
Gets the encryption information for the server connection.
Link copied to clipboard
@NotNull
abstract fun getKeyPair(): @NotNull KeyPair
Gets the key pair associated with the server connection.
Link copied to clipboard
@NotNull
abstract fun getLanguage(): @NotNull Map<String, String>
Gets the language of the server.
Link copied to clipboard
Gets the voice player information for the local player if the player is connected to Plasmo Voice.
Link copied to clipboard
abstract fun getPlayerById(@NotNull playerId: @NotNull UUID): Optional<VoicePlayerInfo>
Gets voice player information by player unique identifier.
Link copied to clipboard
@NotNull
abstract fun getPlayers(): @NotNull Collection<VoicePlayerInfo>
Gets a collection of voice player information for the connected players with Plasmo Voice installed.
Link copied to clipboard
@NotNull
abstract fun getRemoteAddress(): @NotNull SocketAddress
Gets the remote socket address of the server.
Link copied to clipboard
@NotNull
abstract fun getRemoteIp(): @NotNull String
Gets the remote IP address of the server.
Link copied to clipboard
open fun sendPacket(@NotNull packet: @NotNull Packet<out Any>)
Sends a packet to the server with UDP connection check.
abstract fun sendPacket(@NotNull packet: @NotNull Packet<out Any>, checkUdpConnection: Boolean)
Sends a packet to the server.
Link copied to clipboard
abstract fun setKeyPair(@NotNull keyPair: @NotNull KeyPair)
Sets the key pair associated with the server connection.