-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Kotlin serialization based networking #69
base: main
Are you sure you want to change the base?
Conversation
...main/kotlin/org/quiltmc/qkl/library/networking/serialization/serializedPacketRegistration.kt
Outdated
Show resolved
Hide resolved
.../src/main/kotlin/org/quiltmc/qkl/library/networking/serialization/serializedPacketSending.kt
Show resolved
Hide resolved
* @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>( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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. |
good idea, ill see about that after finals. gonna make this draft until then |
Is it okay if I port this and work on it? |
fine by me, probably needs a rewrite as suggested #69 (comment) |
yeah 😎
Inspired by the concept of FabricMC/fabric#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
Optional
s and such, as you can see in this diagram of the serialized form of the sample data