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:
- I need to run my systems before sending and after receiving independent on transport.
- 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.
lucaspoffo commented
-
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.
-
This shouldn't be that hard to add