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

Kotlin serialization based networking

Open SilverAndro opened this issue 1 year ago • 4 comments

yeah 😎

Inspired by the concept of https://github.com/FabricMC/fabric/pull/2820, banged out during class so might have fucked up some stuff.

Wasnt able to include a lot of the goodies like encodeNbt and whatever because we dont have serializers for those atm, worth looking into if its possible with mixin or if we need chasm?

Keeps compat with any java users wanting to parse this, nulls are encoded the same way as Optionals and such, as you can see in this diagram of the serialized form of the sample data serialized_packet

SilverAndro avatar Apr 04 '23 22:04 SilverAndro

Why not use either of

the existing CBOR encoder, getting rid of need for a custom format, and just dumping the resulting byte array, or

codec serialization with a bytebuf Ops (something previously discussed over at QuiltMC/quilt-standard-libraries#180), enabling codec support? I'm sure sending identifiers in a packet is common enough for this to be appreciated.

Cypher121 avatar Apr 07 '23 07:04 Cypher121

codec serialization with a bytebuf Ops

good idea, ill see about that after finals. gonna make this draft until then

SilverAndro avatar Apr 11 '23 00:04 SilverAndro

Is it okay if I port this and work on it?

sylv256 avatar Mar 31 '24 23:03 sylv256

fine by me, probably needs a rewrite as suggested https://github.com/QuiltMC/quilt-kotlin-libraries/pull/69#issuecomment-1500040519

SilverAndro avatar Mar 31 '24 23:03 SilverAndro