mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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.
This commit is contained in:
parent
008b80fe1c
commit
0b4f424f41
16 changed files with 193 additions and 160 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue