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/client/client.h | |
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/client/client.h')
-rw-r--r-- | src/client/client.h | 6 |
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; |