1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Implement sign using form field protocol

This commit is contained in:
Perttu Ahola 2012-06-01 20:51:15 +03:00
parent ff8d2bbc36
commit d7447cdf9e
10 changed files with 117 additions and 31 deletions

View file

@ -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 "