Closed Veritius closed 10 months ago
Thought I'd link my implementation I made in the meantime. https://github.com/Veritius/bevy-net-playground/blob/e6cf7d3dc7e6acab75927b05923adaf854331b3f/server/src/network/entity.rs
This uses a workaround due to #178
The Bevy adapter depends on naia
, not the other way around. naia
should be able to work outside a Bevy app. So User
and Room
will never be stored within a Bevy world like you suggest. Thank you for the suggestions though!
To re-iterate my points in Discord: Using Bevy entities allows arbitrary data to be associated with, for example, a
User
orRoom
, without using many, many associative arrays. This is also much more aligned with the ECS pattern. Bevy already does this withWindow
s, among other things.Deleting an
Entity
associated with aUser
orRoom
key would probably disconnect/destroy the relevant object in the server, likely using removal detection.I am only talking about the Bevy adapter, I'm not yet knowledgable enough about naia to comment on the rest of the crate.