Skip to content

Commit

Permalink
chore: TODO comment for initializing NetworkInfo immediately on sessi…
Browse files Browse the repository at this point in the history
…on creation.
  • Loading branch information
MaxCWhitehead committed Jun 9, 2024
1 parent b285a30 commit 856f213
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions framework_crates/bones_framework/src/networking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,11 @@ where
// Input has been consumed, signal that we are in new input frame
self.input_collector.advance_frame();

// TODO: Make sure NetworkInfo is initialized immediately when session is created,
// even before a frame has advanced.
//
// The existance of this resource may be used to determine if in an online match, and there could
// be race if expected it to exist but testing before first frame advance.
world.insert_resource(NetworkInfo {
current_frame: self.session.current_frame(),
last_confirmed_frame: self.session.confirmed_frame(),
Expand Down

0 comments on commit 856f213

Please sign in to comment.