mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Optimize/adjust blocks/ActiveObjects sent at the server based on client settings. (#4811)
Optimize/adjust blocks and active blocks sent at the server based on client settings.
This commit is contained in:
parent
c38985825f
commit
5dc6198878
11 changed files with 99 additions and 28 deletions
|
@ -705,11 +705,15 @@ void Server::AsyncRunStep(bool initial_step)
|
|||
if (playersao == NULL)
|
||||
continue;
|
||||
|
||||
s16 my_radius = MYMIN(radius, playersao->getWantedRange() * MAP_BLOCKSIZE);
|
||||
if (my_radius <= 0) my_radius = radius;
|
||||
//infostream << "Server: Active Radius " << my_radius << std::endl;
|
||||
|
||||
std::queue<u16> removed_objects;
|
||||
std::queue<u16> added_objects;
|
||||
m_env->getRemovedActiveObjects(playersao, radius, player_radius,
|
||||
m_env->getRemovedActiveObjects(playersao, my_radius, player_radius,
|
||||
client->m_known_objects, removed_objects);
|
||||
m_env->getAddedActiveObjects(playersao, radius, player_radius,
|
||||
m_env->getAddedActiveObjects(playersao, my_radius, player_radius,
|
||||
client->m_known_objects, added_objects);
|
||||
|
||||
// Ignore if nothing happened
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue