summaryrefslogtreecommitdiff
path: root/src/client/client.h
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-08-24 19:07:38 +0200
committerGitHub <noreply@github.com>2019-08-24 19:07:38 +0200
commit0b4f424f414380b7a46270e1389e8aa0524d8fba (patch)
tree5731cbe72bb3178d697b3cda43b838f26ba34f7d /src/client/client.h
parent008b80fe1ca9d46610b8971e2ac92fb56da8e69f (diff)
downloadminetest-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/client/client.h')
-rw-r--r--src/client/client.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/client/client.h b/src/client/client.h
index 3bfb1631e..85456fe4d 100644
--- a/src/client/client.h
+++ b/src/client/client.h
@@ -274,9 +274,7 @@ public:
// Returns true if the inventory of the local player has been
// updated from the server. If it is true, it is set to false.
- bool getLocalInventoryUpdated();
- // Copies the inventory of the local player to parameter
- void getLocalInventory(Inventory &dst);
+ bool updateWieldedItem();
/* InventoryManager interface */
Inventory* getInventory(const InventoryLocation &loc) override;
@@ -504,7 +502,7 @@ private:
// If 0, server init hasn't been received yet.
u16 m_proto_ver = 0;
- bool m_inventory_updated = false;
+ bool m_update_wielded_item = false;
Inventory *m_inventory_from_server = nullptr;
float m_inventory_from_server_age = 0.0f;
PacketCounter m_packetcounter;