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

Formspecs: Introduce formspec_version to mods

This commit is contained in:
SmallJoker 2019-09-10 21:18:42 +02:00
parent b0baa698a4
commit 9acd36bf99
11 changed files with 54 additions and 10 deletions

View file

@ -1568,7 +1568,7 @@ void Server::SendChatMessage(session_t peer_id, const ChatMessage &message)
void Server::SendShowFormspecMessage(session_t peer_id, const std::string &formspec,
const std::string &formname)
{
NetworkPacket pkt(TOCLIENT_SHOW_FORMSPEC, 0 , peer_id);
NetworkPacket pkt(TOCLIENT_SHOW_FORMSPEC, 0, peer_id);
if (formspec.empty()){
//the client should close the formspec
//but make sure there wasn't another one open in meantime
@ -1579,7 +1579,7 @@ void Server::SendShowFormspecMessage(session_t peer_id, const std::string &forms
pkt.putLongString("");
} else {
m_formspec_state_data[peer_id] = formname;
pkt.putLongString(FORMSPEC_VERSION_STRING + formspec);
pkt.putLongString(formspec);
}
pkt << formname;
@ -1908,7 +1908,8 @@ void Server::SendPlayerInventoryFormspec(session_t peer_id)
return;
NetworkPacket pkt(TOCLIENT_INVENTORY_FORMSPEC, 0, peer_id);
pkt.putLongString(FORMSPEC_VERSION_STRING + player->inventory_formspec);
pkt.putLongString(player->inventory_formspec);
Send(&pkt);
}
@ -1920,7 +1921,7 @@ void Server::SendPlayerFormspecPrepend(session_t peer_id)
return;
NetworkPacket pkt(TOCLIENT_FORMSPEC_PREPEND, 0, peer_id);
pkt << FORMSPEC_VERSION_STRING + player->formspec_prepend;
pkt << player->formspec_prepend;
Send(&pkt);
}