summaryrefslogtreecommitdiff
path: root/src/clientiface.cpp
diff options
context:
space:
mode:
authorLars <larsh@apache.org>2020-10-13 12:38:34 -0700
committerlhofhansl <larsh@apache.org>2020-10-13 19:39:43 -0700
commitf43d1cfa81aa496174af6cdfa648dab9dd17288c (patch)
tree1a2e72dd7594bcbce385d8a70126a0e2ece85c00 /src/clientiface.cpp
parent2f871e3b49d87b0ae0e7b52f7ead6d3512727f0f (diff)
downloadminetest-f43d1cfa81aa496174af6cdfa648dab9dd17288c.tar.gz
minetest-f43d1cfa81aa496174af6cdfa648dab9dd17288c.tar.bz2
minetest-f43d1cfa81aa496174af6cdfa648dab9dd17288c.zip
Rely on max_simultaneous_block_sends_per_client to limit blocks sent to the client.
Diffstat (limited to 'src/clientiface.cpp')
-rw-r--r--src/clientiface.cpp18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/clientiface.cpp b/src/clientiface.cpp
index 28a0ee770..a01cba7e0 100644
--- a/src/clientiface.cpp
+++ b/src/clientiface.cpp
@@ -99,7 +99,6 @@ void RemoteClient::GetNextBlocks (
{
// Increment timers
m_nothing_to_send_pause_timer -= dtime;
- m_nearest_unsent_reset_timer += dtime;
if (m_nothing_to_send_pause_timer >= 0)
return;
@@ -154,14 +153,6 @@ void RemoteClient::GetNextBlocks (
/*infostream<<"m_nearest_unsent_reset_timer="
<<m_nearest_unsent_reset_timer<<std::endl;*/
- // Reset periodically to workaround for some bugs or stuff
- if (m_nearest_unsent_reset_timer > 20.0f) {
- m_nearest_unsent_reset_timer = 0.0f;
- m_nearest_unsent_d = 0;
- //infostream<<"Resetting m_nearest_unsent_d for "
- // <<server->getPlayerName(peer_id)<<std::endl;
- }
-
//s16 last_nearest_unsent_d = m_nearest_unsent_d;
s16 d_start = m_nearest_unsent_d;
@@ -212,16 +203,9 @@ void RemoteClient::GetNextBlocks (
wanted_range);
const s16 d_blocks_in_sight = full_d_max * BS * MAP_BLOCKSIZE;
- s16 d_max = full_d_max;
s16 d_max_gen = std::min(adjustDist(m_max_gen_distance, prop_zoom_fov),
wanted_range);
- // Don't loop very much at a time, adjust with distance,
- // do more work per RTT with greater distances.
- s16 max_d_increment_at_time = full_d_max / 9 + 1;
- if (d_max > d_start + max_d_increment_at_time)
- d_max = d_start + max_d_increment_at_time;
-
// cos(angle between velocity and camera) * |velocity|
// Limit to 0.0f in case player moves backwards.
f32 dot = rangelim(camera_dir.dotProduct(playerspeed), 0.0f, 300.0f);
@@ -238,7 +222,7 @@ void RemoteClient::GetNextBlocks (
const v3s16 cam_pos_nodes = floatToInt(camera_pos, BS);
s16 d;
- for (d = d_start; d <= d_max; d++) {
+ for (d = d_start; d <= full_d_max; d++) {
/*
Get the border/face dot coordinates of a "d-radiused"
box