diff options
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp index 0ee0ef465..fbeff83bf 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -3126,6 +3126,24 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) m_playing_sounds.erase(i++); } } + else if(command == TOSERVER_NODEMETA_FIELDS) + { + std::string datastring((char*)&data[2], datasize-2); + std::istringstream is(datastring, std::ios_base::binary); + + v3s16 p = readV3S16(is); + std::string formname = deSerializeString(is); + int num = readU16(is); + std::map<std::string, std::string> fields; + for(int k=0; k<num; k++){ + std::string fieldname = deSerializeString(is); + std::string fieldvalue = deSerializeLongString(is); + fields[fieldname] = fieldvalue; + } + + scriptapi_node_on_receive_fields(m_lua, p, formname, fields, + playersao); + } else { infostream<<"Server::ProcessData(): Ignoring " |