mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 10:59:20 +02:00
hardware protocol v2: answer a subscription with current state
The snapshot sent right after SUBSCRIBE was taken from the previous frame, which on the first frame of a session meant every value came back as UNAVAILABLE. The link now publishes the state of the current frame before the received frames are processed.
This commit is contained in:
@@ -202,6 +202,9 @@ void hardware_link::update( double const Deltatime, state_snapshot const &Snapsh
|
||||
m_lastframeerrors = counters;
|
||||
m_session.add_frame_errors( delta );
|
||||
|
||||
// the session answers a subscription with an immediate snapshot, so it needs the current state first
|
||||
m_session.set_snapshot( Snapshot );
|
||||
|
||||
for( auto const &packet : packets )
|
||||
{
|
||||
m_session.handle_packet( packet );
|
||||
|
||||
Reference in New Issue
Block a user