diff options
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/client.cpp b/src/client.cpp index d5abcd7de..1daeeba36 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -452,7 +452,7 @@ void Client::step(float dtime) snprintf((char*)&data[23], PASSWORD_SIZE, "%s", m_password.c_str()); // This should be incremented in each version - writeU16(&data[51], 3); + writeU16(&data[51], PROTOCOL_VERSION); // Send as unreliable Send(0, data, false); @@ -1506,6 +1506,23 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id) event.deathscreen.camera_point_target_z = camera_point_target.Z; m_client_event_queue.push_back(event); } + else if(command == TOCLIENT_TOOLDEF) + { + infostream<<"Client: Received tool definitions"<<std::endl; + + std::string datastring((char*)&data[2], datasize-2); + std::istringstream is(datastring, std::ios_base::binary); + + // Stop threads while updating content definitions + m_mesh_update_thread.stop(); + + std::istringstream tmp_is(deSerializeLongString(is), std::ios::binary); + m_tooldef->deSerialize(tmp_is); + + // Resume threads + m_mesh_update_thread.setRun(true); + m_mesh_update_thread.Start(); + } else { infostream<<"Client: Ignoring unknown command " |