diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-06-01 20:51:15 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-06-03 22:31:01 +0300 |
commit | d7447cdf9e4df3c345218886ab2bae0e0cc4fc55 (patch) | |
tree | 4ebc1c2fd91d66f8711ed87013af80a4adf53cc0 /src/server.cpp | |
parent | ff8d2bbc3682b12d40d1dfb212d39a50c498fb93 (diff) | |
download | minetest-d7447cdf9e4df3c345218886ab2bae0e0cc4fc55.tar.gz minetest-d7447cdf9e4df3c345218886ab2bae0e0cc4fc55.tar.bz2 minetest-d7447cdf9e4df3c345218886ab2bae0e0cc4fc55.zip |
Implement sign using form field protocol
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 " |