Package moe.kyokobot.koe
Class KoeOptionsBuilder
java.lang.Object
moe.kyokobot.koe.KoeOptionsBuilder
- Direct Known Subclasses:
KoeOptionsBuilderExperimental
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected io.netty.buffer.ByteBufAllocatorprotected CodecRegistryprotected Class<? extends io.netty.channel.socket.DatagramChannel>protected booleanprotected booleanprotected booleanprotected io.netty.channel.EventLoopGroupprotected booleanprotected FramePollerFactoryprotected GatewayVersionprotected booleanprotected Class<? extends io.netty.channel.socket.SocketChannel>protected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate()setByteBufAllocator(io.netty.buffer.ByteBufAllocator byteBufAllocator) Sets a NettyByteBufAllocatorto use for the Koe client.setCodecRegistry(CodecRegistry codecRegistry) Sets a custom codec registry.setDatagramChannelClass(Class<? extends io.netty.channel.socket.DatagramChannel> datagramChannelClass) Sets a class of NettyDatagramChannelto use for the Koe client.setDAVEEnabled(boolean enabled) Sets whether End-to-End encryption using Discord's DAVE protocol is enabled.voidsetDeafened(boolean deafened) Sets whether the client should be deafened by default.setEnableWSSPortOverride(boolean enableWSSPortOverride) Sets whether to enable port :80 -> :443 override for voice server endpoint passed inVoiceServerInfoDefaults to true.setEventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup) Sets an implementation of NettyEventLoopGroupto use for the Koe client.setFramePollerFactory(FramePollerFactory framePollerFactory) Sets a factory for creating frame pollers.setGatewayVersion(GatewayVersion gatewayVersion) Sets the gateway version to use for the Koe client.setHighPacketPriority(boolean highPacketPriority) Sets whether to set IP_TOS flags to request high priority/low-delay for sent RTP packets.setSocketChannelClass(Class<? extends io.netty.channel.socket.SocketChannel> socketChannelClass) Sets a class of NettySocketChannelto use for the Koe client.setVerifyWSSHostname(boolean verifyWSSHostname) Sets whether to verify the server certificate hostname for WSS voice gateway connections.
-
Field Details
-
eventLoopGroup
protected io.netty.channel.EventLoopGroup eventLoopGroup -
socketChannelClass
-
datagramChannelClass
-
byteBufAllocator
protected io.netty.buffer.ByteBufAllocator byteBufAllocator -
gatewayVersion
-
framePollerFactory
-
codecRegistry
-
experimental
protected boolean experimental -
highPacketPriority
protected boolean highPacketPriority -
deafened
protected boolean deafened -
enableWSSPortOverride
protected boolean enableWSSPortOverride -
verifyWSSHostname
protected boolean verifyWSSHostname -
enableDAVE
protected boolean enableDAVE
-
-
Constructor Details
-
KoeOptionsBuilder
protected KoeOptionsBuilder()
-
-
Method Details
-
setEventLoopGroup
Sets an implementation of NettyEventLoopGroupto use for the Koe client. Defaults to Epoll if available (Linux) or NIO on everything else.. Use this if you need KQueue on macOS/BSD hosts or other native transport with Koe.- Parameters:
eventLoopGroup- An instance ofEventLoopGroupto use for the Koe client.
-
setSocketChannelClass
public KoeOptionsBuilder setSocketChannelClass(@NotNull Class<? extends io.netty.channel.socket.SocketChannel> socketChannelClass) Sets a class of NettySocketChannelto use for the Koe client. Defaults toEpollSocketChannelif Epoll is available (Linux) orNioSocketChannelon everything else. Use this if you need KQueue on macOS/BSD hosts or other native transport with Koe.- Parameters:
socketChannelClass- An implementation class ofSocketChannelto use for the Koe client. Same as class passed intoAbstractBootstrap.channel(Class)method when creating socket channels.
-
setDatagramChannelClass
public KoeOptionsBuilder setDatagramChannelClass(@NotNull Class<? extends io.netty.channel.socket.DatagramChannel> datagramChannelClass) Sets a class of NettyDatagramChannelto use for the Koe client. Defaults toEpollDatagramChannelif Epoll is available (Linux) orNioDatagramChannelon everything else. Use this if you need KQueue on macOS/BSD hosts or other native transport with Koe.- Parameters:
datagramChannelClass- An implementation class ofDatagramChannelto use for the Koe client. Same as class passed intoAbstractBootstrap.channel(Class)method when creating datagram channels.
-
setByteBufAllocator
public KoeOptionsBuilder setByteBufAllocator(@NotNull io.netty.buffer.ByteBufAllocator byteBufAllocator) Sets a NettyByteBufAllocatorto use for the Koe client. Defaults toPooledByteBufAllocator.- Parameters:
byteBufAllocator- An instance ofByteBufAllocatorto use for the Koe client.
-
setGatewayVersion
Sets the gateway version to use for the Koe client.- Parameters:
gatewayVersion- An instance ofGatewayVersionto use for the Koe client.
-
setFramePollerFactory
Sets a factory for creating frame pollers. Defaults toNettyFramePollerFactory.- Parameters:
framePollerFactory- An instance ofFramePollerFactoryto use for the Koe client.
-
setCodecRegistry
Sets a custom codec registry. Useful for registering custom codecs or removing built-in ones. Defaults toDefaultCodecRegistrywith built-in codecs.- Parameters:
codecRegistry- An instance ofCodecRegistryto use for the Koe client.
-
setHighPacketPriority
Sets whether to set IP_TOS flags to request high priority/low-delay for sent RTP packets. Defaults to true. -
setDeafened
public void setDeafened(boolean deafened) Sets whether the client should be deafened by default. Defaults to false. -
setEnableWSSPortOverride
Sets whether to enable port :80 -> :443 override for voice server endpoint passed inVoiceServerInfoDefaults to true. -
setVerifyWSSHostname
Sets whether to verify the server certificate hostname for WSS voice gateway connections. Defaults to true. Set to false only for custom or self-signed voice endpoints.- Parameters:
verifyWSSHostname- true to verify hostname (default), false to disable verification
-
setDAVEEnabled
Sets whether End-to-End encryption using Discord's DAVE protocol is enabled. Defaults to true. -
create
-