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

@ -1454,6 +1454,19 @@ void ServerEnvironment::step(float dtime)
++i;
}
}
// Send outdated player inventories
for (RemotePlayer *player : m_players) {
if (player->getPeerId() == PEER_ID_INEXISTENT)
continue;
PlayerSAO *sao = player->getPlayerSAO();
if (sao && player->inventory.checkModified())
m_server->SendInventory(sao, true);
}
// Send outdated detached inventories
m_server->sendDetachedInventories(PEER_ID_INEXISTENT, true);
}
u32 ServerEnvironment::addParticleSpawner(float exptime)