-
Notifications
You must be signed in to change notification settings - Fork 11
Custom Serialization #18
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
base: main
Are you sure you want to change the base?
Custom Serialization #18
Conversation
…ypes::Text, make it possible to utilize different serialization methods over the wire and assign certain network messages specific serialization methods. Update examples to include a network request message to make sure it works
|
BEMW branch: https://github.com/NoahShomette/bevy_eventwork_mod_websockets/tree/serialization @davi4046 If you are still using this and the custom serialization can you test if this works for you? @mraof I saw you forked the custom serialization repos also so can you test this and see if it works for you as well? |
|
I will try to have a look at it tommorow👍 |
|
I have two errors when attempting to make this work. Firstly, Secondly, the registration functions are not available on App in the example you provided. I guess it's because at the point of implementation, the app has not had the necessary plugins added yet. Let me know if I'm doing anything wrong and I'll try again. |
|
Just to make sure are you on bevy 0.14? I forgot you were working from 0.13 so that might be a pain for you to test sorry :(
|
|
Ah, I totally forgot about the bevy version. Compilation errors are gone now, thanks! Unfortunately I get Server to client seems to work fine, although I had to change how the client handles received messages. I might still be doing something wrong, sorry. You can have a look at the repo: https://github.com/davi4046/bevy_eventwork_websocket_json_demo |
|
Thanks for the link to the repo that is very helpful! It's unfortunately running into some issues that I couldn't resolve over the weekend so theres definitely a good amount of more work to fix this pr up |


fixes #15 .
Adds custom serialization which allows users to supply custom serialization functions for messages to utilize different serialization formats with minimal change to current user ergonomics.
Changes
Networkis now a system param, Network was changed toNetworkInstance. Users need to interact with the network through the Network system param now.recv_loopandsend_loopnow take a hashmap of serialization functions to enable serialization and deserialization of messages according to different settings.listen_for_messageis nowregister_messagelisten_for_request_messageis nowregister_receive_request_messagelisten_for_response_messageis nowregister_send_request_messageCustom Serialization
See BEMW JSON for an example. Recommend making a trait to help with registration. You need a generic serialization and deserialization function each and then one each for serializing and deserializing network packets. See BEMW for an example of how it should be implemented.
Limitations
TextorBinaryover the network.Todo