Simple Voice Chat

Simple Voice Chat

31M Downloads

Unhandled exception occured in onPacketReceiving(PacketEvent) for voicechat

EpicnessTwo opened this issue ยท 4 comments

commented

Please read the FAQ before submitting a bug report!

Bug description
When a player joins the server, an error is shown in the server's console. And players with the mod installed can't hear eachother.

Steps to reproduce the issue

  1. Join the server with the latest fabric mod and spigot plugin installed.
  2. Error is shown

Expected behavior
I'd expect this to work?

Log files
I'm only posting the error so using gist isn't really needed.

[20:49:03 INFO]: [voicechat] Successfully authenticated player 2f7eec5b-58f1-4634-b18c-fc7e39e413a1
[20:49:03 ERROR]: [voicechat] Unhandled exception occured in onPacketReceiving(PacketEvent) for voicechat
java.lang.IndexOutOfBoundsException: index: 19, length: 88 (expected: range(0, 54))
        at io.netty.buffer.AbstractByteBuf.checkRangeBounds(AbstractByteBuf.java:1390) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.buffer.AbstractByteBuf.checkIndex0(AbstractByteBuf.java:1397) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1384) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.buffer.UnsafeByteBufUtil.getBytes(UnsafeByteBufUtil.java:481) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.buffer.PooledUnsafeDirectByteBuf.getBytes(PooledUnsafeDirectByteBuf.java:130) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.buffer.ByteBufUtil.decodeString(ByteBufUtil.java:1151) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.buffer.AbstractByteBuf.toString(AbstractByteBuf.java:1246) ~[patched_1.17.jar:git-Paper-71]
        at net.minecraft.network.FriendlyByteBuf.toString(FriendlyByteBuf.java:1296) ~[?:?]
        at de.maxhenkel.voicechat.util.FriendlyByteBuf.toString(FriendlyByteBuf.java:986) ~[?:?]
        at de.maxhenkel.voicechat.util.FriendlyByteBuf.readUtf(FriendlyByteBuf.java:100) ~[?:?]
        at de.maxhenkel.voicechat.util.FriendlyByteBuf.readUtf(FriendlyByteBuf.java:122) ~[?:?]
        at de.maxhenkel.voicechat.voice.common.PlayerState.fromBytes(PlayerState.java:63) ~[?:?]
        at de.maxhenkel.voicechat.net.PlayerStatePacket.fromBytes(PlayerStatePacket.java:33) ~[?:?]
        at de.maxhenkel.voicechat.net.NetManager.onPlayCustomPayload(NetManager.java:98) ~[?:?]
        at de.maxhenkel.voicechat.net.NetManager$1.onPacketReceiving(NetManager.java:48) ~[?:?]
        at com.comphenix.protocol.injector.SortedPacketListenerList.invokeReceivingListener(SortedPacketListenerList.java:114) ~[?:?]
        at com.comphenix.protocol.injector.SortedPacketListenerList.invokePacketRecieving(SortedPacketListenerList.java:67) ~[?:?]
        at com.comphenix.protocol.injector.PacketFilterManager.handlePacket(PacketFilterManager.java:537) ~[?:?]
        at com.comphenix.protocol.injector.PacketFilterManager.invokePacketRecieving(PacketFilterManager.java:509) ~[?:?]
        at com.comphenix.protocol.injector.netty.ProtocolInjector.packetReceived(ProtocolInjector.java:360) ~[?:?]
        at com.comphenix.protocol.injector.netty.ProtocolInjector.onPacketReceiving(ProtocolInjector.java:325) ~[?:?]
        at com.comphenix.protocol.injector.netty.ChannelInjector.decode(ChannelInjector.java:593) ~[?:?]
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:507) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:446) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[patched_1.17.jar:git-Paper-71]
        at com.comphenix.protocol.injector.netty.ChannelInjector$2.channelRead(ChannelInjector.java:289) ~[?:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.handler.flush.FlushConsolidationHandler.channelRead(FlushConsolidationHandler.java:152) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[patched_1.17.jar:git-Paper-71]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[patched_1.17.jar:git-Paper-71]
        at java.lang.Thread.run(Thread.java:831) [?:?]
[20:49:03 ERROR]: Parameters: 
  net.minecraft.network.protocol.game.PacketPlayInCustomPayload@29fcdd94[
    c=voicechat:player_state
    d=PooledUnsafeDirectByteBuf(ridx: 19, widx: 54, cap: 54)
  ]

Versions

  • Minecraft version: 1.17.0
  • Forge version: Not using Forge. Fabric Version is 0.11.6 and the Paper Spigot version is git-Paper-71
  • Mod version: 1.2.3

Other mods
AwesomeSnow*, BungeeTabListPlus, Citizens, DeluxeHub, Essentials, EssentialsChat, LiteBans, LuckPerms, PrometheusExporter, ProtocolLib, Vault, voicechat, WorldEdit

Has also been tested with only voicechat and ProtocolLib installed and the same results occur

commented

This happens if some other application sends data to the voice chat port.
Consider switching to another port.

I'm assuming you are using BungeeCord, since you have BungeeTabListPlus installed. When using a proxy, the compatibility check is being suppressed. This means players with an incompatible version can join. This can also cause this exception.

Please try updating to this version: voicechat-bukkit-1.17-1.4.1.zip

commented

Updated the plugin to the version you've specified and whilst there's no longer an error when a user joins, the client is now stating that "Voice chat unavailable".

Yes, we are using Bungeecord (Waterfall) as we operate a network.

We are using a custom port as we have multiple servers on the network, all with their own Voice Chat port assigned (In this case, we are using 30001). I've also checked and confirmed that this port is open through firewalls.

It was working perfectly fine when we were testing with PlasmoVoice on the same setup and port configuration but as your mod offers more features, we are interested in moving over to use it.

commented

Try setting the voice_host option to the IP this specific MC server is running on.
For more help I would recommend joining the Discord server.

commented

Joined the Discord a few mins ago. I've set the voice_host to the public IP of our server and nothing has changed.

For reference, this is the config for the server we are testing it on atm:

#
#Sat Jul 03 22:27:13 CEST 2021
open_groups=false
codec=VOIP
voice_fade_distance=24.0
port=30001
mtu_size=1024
voice_host=195.201.83.234
voice_distance=48.0
keep_alive=1000
bind_address=0.0.0.0
enable_groups=true