quilt-standard-libraries icon indicating copy to clipboard operation
quilt-standard-libraries copied to clipboard

NetworkChannels.

Open 0xJoeMama opened this issue 1 year ago • 5 comments

This PR adds:

  • NetworkChannels to the networking API. They started as a test for NetworkCodecs but ended up making me like them enough to make them public API. They are a wrapper around Server/ClientPlayerNetworking that makes it so the user never has to interact with a PacketByteBuf. They contain a NetworkCodec and they use that as well as a supplied handler in order to handle messages. The user just needs to create the channel and specify a way to handle it.

More tests coming soon(TM). This depends on #180 since it uses NetworkCodecs.

0xJoeMama avatar Aug 22 '22 12:08 0xJoeMama

With Patbox we were thinking of making so you could extend Packet in a way so you could use Vanilla's methods but internally they would turn back into CustomPayload packets. So I'm not sure I am a fan of the network channel stuff. Also it kinda looks complicated? I'm not sure what to think of it.

LambdAurora avatar Aug 22 '22 13:08 LambdAurora

Also it kinda looks complicated? I'm not sure what to think of it.

What is the complicated part? NetworkCodecs or the channels?

0xJoeMama avatar Aug 22 '22 13:08 0xJoeMama

The channels.

The codec stuff looks straightforward, I mean, it's codecs.

LambdAurora avatar Aug 22 '22 13:08 LambdAurora

The channels.

Do you mean in terms of implementation or in terms of user experience?

0xJoeMama avatar Aug 22 '22 13:08 0xJoeMama

Both.

LambdAurora avatar Aug 22 '22 13:08 LambdAurora