Package moe.kyokobot.koe
Interface KoeEventListener
- All Known Implementing Classes:
EventDispatcher,KoeEventAdapter
public interface KoeEventListener
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidexternalIPDiscovered(InetSocketAddress address) default voidgatewayClosed(int code, @Nullable String reason, boolean byRemote) Called when the gateway connection is closed.default voidgatewayError(Throwable cause) default voidgatewayReady(InetSocketAddress target, int ssrc) default voidsessionDescription(JsonObject session) default voidsessionLost(int code, @Nullable String reason) Called aftergatewayClosed(int, java.lang.String, boolean)when the voice server no longer knows the session and Koe couldn't start a new one.default voidCalled when one or more users have disconnected from the voice channel.default voidusersConnected(List<String> userIds) Called when one or more users have connected to the voice channel.default voiduserStreamsChanged(String id, int audioSSRC, int videoSSRC, int rtxSSRC) Called when the stream information for a user has changed.
-
Method Details
-
gatewayError
-
gatewayReady
-
gatewayClosed
Called when the gateway connection is closed.- Parameters:
code- the WebSocket close code.reason- the close reason if present, null otherwise.byRemote- true if the connection was closed by the gateway, false if it was closed by Koe.
-
sessionLost
Called aftergatewayClosed(int, java.lang.String, boolean)when the voice server no longer knows the session and Koe couldn't start a new one. Koe can't recover from this on its own, the bot has to rejoin the voice channel through the main gateway (opcode 4) to get a new session and pass the new server info toMediaConnection.connect(moe.kyokobot.koe.VoiceServerInfo).- Parameters:
code- the WebSocket close code.reason- the close reason if present, null otherwise.
-
userStreamsChanged
Called when the stream information for a user has changed. Not state tracked by Koe, provides data frommoe.kyokobot.koe.gateway.Op#USER_SPEAKINGas-is.- Parameters:
id- the user ID of the user whose stream information has changed.audioSSRC- the SSRC of the user's audio stream, or 0 if not present or just disabled.videoSSRC- the SSRC of the user's video stream, or 0 if not present or just disabled.rtxSSRC- the SSRC of the user's retransmission stream, or 0 if not present or just disabled.
-
usersConnected
Called when one or more users have connected to the voice channel. Not state tracked by Koe, provides data fromOp.CLIENT_CONNECTas-is.- Parameters:
userIds- the list of user IDs that have connected, as provided by the gateway.
-
userDisconnected
Called when one or more users have disconnected from the voice channel. Not state tracked by Koe, provides data fromOp.CLIENT_DISCONNECTas-is.- Parameters:
userIds- the list of user IDs that have disconnected, as provided by the gateway.
-
externalIPDiscovered
-
sessionDescription
-