MCProtocolLib icon indicating copy to clipboard operation
MCProtocolLib copied to clipboard

Implementation for inbound and outbound splitting

Open AlexProgrammerDE opened this issue 1 year ago • 1 comments

This PR basically splits PacketProtocol into PacketProtocol and packetRegistry. A PacketProtocol defines basic stuff about the protocol like SRV and it provides incoming and outgoing Packet registries. A PacketRegistry only contains packet id mappings and everything related to the actual packet classes. The MinecraftProtocol extends the PacketProtocol and allows dynamically switching the PacketRegistries that are incoming and outgoing.

AlexProgrammerDE avatar Jun 16 '24 05:06 AlexProgrammerDE

I've looked deeper and it seems packets all initially get handled on the netty thread and the conditionally get moved away onto the main tick thread. This does of course create issues with the way MCPLs impl works and may lead to different behaviour compared to vanilla on a few packets since they were expected to run on the netty thread, but actually got offloaded to the packet eventloop.

AlexProgrammerDE avatar Jun 17 '24 08:06 AlexProgrammerDE

This PR is read-only and not supposed to be merged. While it is fixing packet race conditions, it will be replaced by many smaller PRs focused on aspects of splitting. This PR will be closed once different PRs have added all its functionality. This PR is only a reference for myself on a working impl.

AlexProgrammerDE avatar Jul 20 '24 08:07 AlexProgrammerDE

Not needed anymore, the new impl is coded.

AlexProgrammerDE avatar Sep 10 '24 08:09 AlexProgrammerDE