bevy_eventwork
bevy_eventwork copied to clipboard
Sending messages from JavaScript
How are messages supposed to be formatted to be able to be send by JavaScript?
For example, this doesn't work:
const socket = new WebSocket('ws://localhost:8081');
const message = {
kind: 'balls_of_steel:ChatMessage',
data: {
message: 'Hi Server!',
},
};
socket.send(JSON.stringify(message))
Btw, I'm using the bevy_eventwork_mod_websockets crate. But I assume the message format is the same regardless.
Responded more in depth in this issue on BEMW: https://github.com/NoahShomette/bevy_eventwork_mod_websockets/issues/2#issuecomment-2198267057.
I'll try and take a look and see if its reasonable to allow eventwork/network providers to use a different serialization method