diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2019-08-24 19:07:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-24 19:07:38 +0200 |
commit | 0b4f424f414380b7a46270e1389e8aa0524d8fba (patch) | |
tree | 5731cbe72bb3178d697b3cda43b838f26ba34f7d /src/network/serverpackethandler.cpp | |
parent | 008b80fe1ca9d46610b8971e2ac92fb56da8e69f (diff) | |
download | minetest-0b4f424f414380b7a46270e1389e8aa0524d8fba.tar.gz minetest-0b4f424f414380b7a46270e1389e8aa0524d8fba.tar.bz2 minetest-0b4f424f414380b7a46270e1389e8aa0524d8fba.zip |
Inventory: Send dirty lists where appropriate (#8742)
This change reduces the amount of sent data towards clients. Inventory lists that are already known to the player are skipped, saving quite some data over time.
Raises protocol version to 38 to ensure correct backwards-compatible code.
Diffstat (limited to 'src/network/serverpackethandler.cpp')
-rw-r--r-- | src/network/serverpackethandler.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index 5ad60f48a..1965d87aa 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -732,7 +732,7 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt) // Eat the action delete a; - SendInventory(playersao); + SendInventory(playersao, true); } void Server::handleCommand_ChatMessage(NetworkPacket* pkt) @@ -1310,7 +1310,7 @@ void Server::handleCommand_Interact(NetworkPacket *pkt) // Apply returned ItemStack if (playersao->setWieldedItem(item)) { - SendInventory(playersao); + SendInventory(playersao, true); } } @@ -1346,7 +1346,7 @@ void Server::handleCommand_Interact(NetworkPacket *pkt) item, playersao, pointed)) { // Apply returned ItemStack if (playersao->setWieldedItem(item)) { - SendInventory(playersao); + SendInventory(playersao, true); } } @@ -1364,7 +1364,7 @@ void Server::handleCommand_Interact(NetworkPacket *pkt) if (m_script->item_OnSecondaryUse( item, playersao)) { if( playersao->setWieldedItem(item)) { - SendInventory(playersao); + SendInventory(playersao, true); } } } // action == INTERACT_ACTIVATE |