File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,14 +126,14 @@ void Game::Update() {
126126 NpcMovementHandler::UpdateNpcMovement (*npc_);
127127
128128 // TODO(ramirezfernando): Send local player state to server.
129- const std::string msg = " Hello from client" ;
129+ const auto & [x, y] = player_->GetCoordinate ();
130+ const std::string msg = std::to_string (x) + " _" + std::to_string (y);
130131 client_->Send (msg.c_str (), msg.size ());
131132
132133 // TODO(ramirezfernando): Receive updated other player state from server.
133134 std::array<char , Constants::MAX_BUFFER_SIZE > buffer{};
134135 const ssize_t bytes_received = client_->Receive (buffer.data (), buffer.size ());
135136 if (bytes_received > 0 ) {
136- buffer.at (static_cast <size_t >(bytes_received)) = ' \0 ' ;
137137 Logger::Debug (" Game" , " Received: " + std::string (buffer.data ()));
138138 }
139139}
You can’t perform that action at this time.
0 commit comments