Skip to content
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

Networked example needed #12

Open
vilcans opened this issue Jul 27, 2021 · 3 comments
Open

Networked example needed #12

vilcans opened this issue Jul 27, 2021 · 3 comments

Comments

@vilcans
Copy link
Contributor

vilcans commented Jul 27, 2021

The example uses a mock connection, so when I tried to implement real networking, that took a while. It would be nice to have an example of a simple but more "real" project.

FWIW, here's what I made: https://github.com/vilcans/orbgame. It's maybe not simple enough to use as an example, and maybe I'm not doing things the right way either, as I'm new to Bevy and hence also crystalorb in Bevy. I haven't figured out how to get events for disconnects yet, so players never disappear.

@ErnWong
Copy link
Owner

ErnWong commented Jul 28, 2021

Nice! Thanks for sharing orbgame - I'm sure that'll be quite useful for others to look at. If I get time this weekend (or maybe the weekend after), I'll update the readme with links to some more examples, including yours.

I haven't figured out how to get events for disconnects yet, so players never disappear.

FYI, I had to either:

  • Add some kind of heartbeat messages and disconnecting players when they timeout, or,
  • Patch the transport layer library to expose WebRTC's disconnection events when making wasm builds, if that transport layer library doesn't already expose them.

@vilcans
Copy link
Contributor Author

vilcans commented Jul 28, 2021

* Add some kind of heartbeat messages and disconnecting players when they timeout, or,

Yes, that should work, but I haven't figured out how to send messages to the server. I haven't seen if Crystalorb has functionality for sending messages from a client to the server or from the server to a specific client. Am I supposed to use bevy_networking_turbulence directly for that? I didn't figure out how to register my Heartbeat message types.

@ErnWong
Copy link
Owner

ErnWong commented Sep 25, 2021

Am I supposed to use bevy_networking_turbulence directly for that?

Sorry for the very late reply 😅 Yes, at the moment, any other kind of messaging would need use the transport layer directly.

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

No branches or pull requests

2 participants