Closed RockasMockas closed 2 months ago
This looks great - one thing that I think may be nice is a is_online()
func, right now can check something like this, but not super clear:
let is_online = session
.world
.get_resource::<SyncingInfo>()
.is_some_and(|x| x.socket().is_some());
Or can do this, but not super slick either
let is_online = match session.world.get_resource::<SyncingInfo>().as_deref() {
Some(SyncingInfo::Online { .. }) => true,
_ => false,
};
Great point, added.
This PR covers the following:
NetworkingInfo
struct toSyncingInfo
(as discussed previously on discord) which supports both Online/Offline variants and put all fields behind getters. This will allow us to have a standardized interface for implementing EventManager in the future that watches current/last confirmed frame. (Of note this hasn't inserted the offline variant anywhere, as that can wait for the EventManager work itself).