Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Attempt to release ByteBufs." #258

Merged
merged 1 commit into from
Sep 6, 2019
Merged

Revert "Attempt to release ByteBufs." #258

merged 1 commit into from
Sep 6, 2019

Conversation

FoxMcloud5655
Copy link
Contributor

This breaks Draconic Evolution and potentially any other mod that relies on PacketCustom.java.

This breaks Draconic Evolution and potentially any other mod that relies on PacketCustom.java.
@FoxMcloud5655
Copy link
Contributor Author

It may be worth trying to implement this in a different way, but for now, leaving out the line of code makes DE work again. I don't know enough about this mod to help otherwise!

@covers1624
Copy link
Member

'makes DE work again' explain, does it crash? whats wrong?

@FoxMcloud5655
Copy link
Contributor Author

It causes clients connecting to a single-player world hosted locally to become disconnected upon receiving a packet based on PacketCustom.

@covers1624
Copy link
Member

Please provide logs.

@FoxMcloud5655
Copy link
Contributor Author

Alrighty. Don't have access to my computer currently, but I will get them first thing in the morning.

@FoxMcloud5655
Copy link
Contributor Author

In this test case, I was using an Energy Core from Draconic Evolution to test CCL. The client is disconnected upon receiving the packet, and the server throws the same error many times:

[09:22:02] [Netty Server IO #3/ERROR] [FML]: NetworkDispatcher exception
io.netty.util.IllegalReferenceCountException: refCnt: 0
	at io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1408) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.buffer.UnpooledHeapByteBuf.array(UnpooledHeapByteBuf.java:154) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at net.minecraft.network.PacketBuffer.array(PacketBuffer.java:1264) ~[gy.class:?]
	at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.toS3FPackets(FMLProxyPacket.java:151) ~[FMLProxyPacket.class:?]
	at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.write(NetworkDispatcher.java:537) ~[NetworkDispatcher.class:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:801) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:831) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1032) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:296) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at net.minecraft.network.NetworkManager$4.run(NetworkManager.java:245) [gw$4.class:?]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51]

It was hard to trace down, but I finally managed to find this one line of code. Removing it fixed the problem, and I don't know how to redesign the code to release the packet safely, as I don't know much about networking.

@calebjway
Copy link

calebjway commented Sep 5, 2019

Is there anyway I could implement this before the next update? Its making it hard to play a LAN game with my friends.

@FoxMcloud5655
Copy link
Contributor Author

Just downgrade to the previous version. If you have a mod that depends on the latest version, you can compile it locally from my fork. Just remember to change the build number to something high like '9999', both so you know it's unofficial and so mods see it as a higher version than the one they're looking for.

@calebjway
Copy link

Have never done a custom compile before for a mod like this. Unfortunately the modpack I am using requires the newest version so I guess I am waiting for now. Thanks for the help.

@covers1624 covers1624 merged commit 53ce8d0 into TheCBProject:master Sep 6, 2019
@covers1624
Copy link
Member

New build will be pushed to curse immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants