lucaspoffo/renet

Transport abstraction

Closed this issue · 1 comments

Shatur commented

I working on https://github.com/lifescapegame/bevy_replicon. It currently coupled with Netcode. Users started to ask me to decouple it (projectharmonia/bevy_replicon#61), but there are two problems:

  1. I need to run my systems before sending and after receiving independent on transport.
  2. I need conditions to be transport independent.

I think this could be solved on Renet side:

  • For 1 provide labels for sending and receiving systems and inside transports add corresponding systems to these labels. It's not only simple, but also idiomatic for Bevy.
  • For 2 store information about connectivity inside RenetClient. This will reduce duplicated conditions code inside transports.
  1. Yeah, this is something that should be implemented. Now that we have multiple transport abstractions this is pretty clear. Adding a simple enum that returns Disconnected/Connected/Connecting should be enough, and the transport layer would need to update this whenever the client transport state changes.

  2. This shouldn't be that hard to add