naia-lib / naia

a cross-platform (including Wasm!) networking library built in Rust. Intended to make multiplayer game development dead-simple & lightning-fast
Apache License 2.0
911 stars 58 forks source link

Enable/disable Replication by inserting/removing component #182

Open connorcarpenter opened 1 year ago

connorcarpenter commented 1 year ago

Using the Bevy adapter crates, right now replication is enabled/disabled by calling commands.entity(entity).enable_replication(&mut client) or commands.entity(entity).disable_replication(&mut server) .. It may be more ergonomic to just insert a Marker Component in order to begin/end replication.

What should this Marker Component be called? Replication ? ShouldReplicate ? Needs some further thought. Please leave feedback if you have it!

Veritius commented 1 year ago

I called it Replicated for my implementation I made in the meantime.

Also, to further elaborate on the reasoning for a marker component: