X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fclient.cpp;h=216d86cd412c6d0ffa0e9ae3cd1d8593614887e5;hb=69bd803a3221bf02672431390e672b0510695254;hp=cb7afe29f8fe8bc5ed0bc39e5d5dd95c07938c48;hpb=896e1a30b093fbdd501dc2e46624bf2460ce86bb;p=oweals%2Fminetest.git diff --git a/src/client.cpp b/src/client.cpp index cb7afe29f..216d86cd4 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1900,6 +1900,20 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id) } inv->deSerialize(is); } + else if(command == TOCLIENT_SHOW_FORMSPEC) + { + std::string datastring((char*)&data[2], datasize-2); + std::istringstream is(datastring, std::ios_base::binary); + + std::string formspec = deSerializeLongString(is); + + ClientEvent event; + event.type = CE_SHOW_FORMSPEC; + // pointer is required as event is a struct only! + // adding a std:string to a struct isn't possible + event.show_formspec.formspec = new std::string(formspec); + m_client_event_queue.push_back(event); + } else { infostream<<"Client: Ignoring unknown command "