diff --git a/networktransport.hpp b/networktransport.hpp index 7c3234c..55a47eb 100644 --- a/networktransport.hpp +++ b/networktransport.hpp @@ -131,6 +131,8 @@ namespace Network { string get_remote_diff( void ); + RemoteState &get_remote_state_mutable( void ) { return received_states.back().state; } + uint64_t get_remote_state_num( void ) { return received_states.back().num; } int fd( void ) { return connection.fd(); } diff --git a/stm.cpp b/stm.cpp index 5f23e9a..7a65f97 100644 --- a/stm.cpp +++ b/stm.cpp @@ -187,8 +187,13 @@ void client( const char *ip, int port, const char *key ) return; } - /* tell emulator */ - network.get_current_state().push_back( Parser::Resize( window_size.ws_col, window_size.ws_row ) ); + /* tell remote emulator */ + Parser::Resize res( window_size.ws_col, window_size.ws_row ); + + network.get_current_state().push_back( res ); + + /* tell local emulator -- there is probably a safer way to do this */ + network.get_remote_state_mutable().act( &res ); } if ( (pollfds[ 0 ].revents | pollfds[ 1 ].revents)