1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Send cumulated inventory changes only each step (#8856)

Applies to player and detached inventories
This commit is contained in:
SmallJoker 2019-08-25 10:55:27 +02:00
parent a57f951e02
commit fae6242d4e
5 changed files with 35 additions and 27 deletions

View file

@ -195,7 +195,7 @@ public:
Shall be called with the environment and the connection locked.
*/
Inventory* getInventory(const InventoryLocation &loc);
void setInventoryModified(const InventoryLocation &loc, bool playerSend = true);
void setInventoryModified(const InventoryLocation &loc);
// Connection must be locked when called
std::wstring getStatusString();
@ -337,6 +337,8 @@ public:
void SendMovePlayer(session_t peer_id);
void SendPlayerSpeed(session_t peer_id, const v3f &added_vel);
void sendDetachedInventories(session_t peer_id, bool incremental);
virtual bool registerModStorage(ModMetadata *storage);
virtual void unregisterModStorage(const std::string &name);
@ -443,7 +445,6 @@ private:
const std::vector<std::string> &tosend);
void sendDetachedInventory(const std::string &name, session_t peer_id);
void sendDetachedInventories(session_t peer_id);
// Adds a ParticleSpawner on peer with peer_id (PEER_ID_INEXISTENT == all)
void SendAddParticleSpawner(session_t peer_id, u16 protocol_version,