Skip to content

Kotlin serialization based networking#69

Draft
SilverAndro wants to merge 7 commits intomainfrom
dev/serialized-networking
Draft

Kotlin serialization based networking#69
SilverAndro wants to merge 7 commits intomainfrom
dev/serialized-networking

Conversation

@SilverAndro
Copy link
Copy Markdown
Contributor

yeah 😎

Inspired by the concept of FabricMC/fabric-api#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

* @param direction The directions that this packet can be sent in.
* @param serializersModule The serializers module to be used for decoding
*/
public class SerializedPacketRegistration<P>(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be reasonable to add an alternative to this supporting class-based declarations in addition to the DSL-style declaration.

Copy link
Copy Markdown
Contributor Author

@SilverAndro SilverAndro Apr 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given theres no namespaces yet, ill probably throw that on the other objects i created

@Cypher121
Copy link
Copy Markdown
Contributor

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.

@SilverAndro
Copy link
Copy Markdown
Contributor Author

codec serialization with a bytebuf Ops

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

@SilverAndro SilverAndro marked this pull request as draft April 11, 2023 00:07
@sylv256
Copy link
Copy Markdown
Contributor

sylv256 commented Mar 31, 2024

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

@SilverAndro
Copy link
Copy Markdown
Contributor Author

fine by me, probably needs a rewrite as suggested #69 (comment)

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.

4 participants