Skip to content

Commit f43d1cf

Browse files
committedOct 14, 2020
Rely on max_simultaneous_block_sends_per_client to limit blocks sent to the client.
1 parent 2f871e3 commit f43d1cf

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed
 

Diff for: ‎src/clientiface.cpp

+1-17
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ void RemoteClient::GetNextBlocks (
9999
{
100100
// Increment timers
101101
m_nothing_to_send_pause_timer -= dtime;
102-
m_nearest_unsent_reset_timer += dtime;
103102

104103
if (m_nothing_to_send_pause_timer >= 0)
105104
return;
@@ -154,14 +153,6 @@ void RemoteClient::GetNextBlocks (
154153
/*infostream<<"m_nearest_unsent_reset_timer="
155154
<<m_nearest_unsent_reset_timer<<std::endl;*/
156155

157-
// Reset periodically to workaround for some bugs or stuff
158-
if (m_nearest_unsent_reset_timer > 20.0f) {
159-
m_nearest_unsent_reset_timer = 0.0f;
160-
m_nearest_unsent_d = 0;
161-
//infostream<<"Resetting m_nearest_unsent_d for "
162-
// <<server->getPlayerName(peer_id)<<std::endl;
163-
}
164-
165156
//s16 last_nearest_unsent_d = m_nearest_unsent_d;
166157
s16 d_start = m_nearest_unsent_d;
167158

@@ -212,16 +203,9 @@ void RemoteClient::GetNextBlocks (
212203
wanted_range);
213204
const s16 d_blocks_in_sight = full_d_max * BS * MAP_BLOCKSIZE;
214205

215-
s16 d_max = full_d_max;
216206
s16 d_max_gen = std::min(adjustDist(m_max_gen_distance, prop_zoom_fov),
217207
wanted_range);
218208

219-
// Don't loop very much at a time, adjust with distance,
220-
// do more work per RTT with greater distances.
221-
s16 max_d_increment_at_time = full_d_max / 9 + 1;
222-
if (d_max > d_start + max_d_increment_at_time)
223-
d_max = d_start + max_d_increment_at_time;
224-
225209
// cos(angle between velocity and camera) * |velocity|
226210
// Limit to 0.0f in case player moves backwards.
227211
f32 dot = rangelim(camera_dir.dotProduct(playerspeed), 0.0f, 300.0f);
@@ -238,7 +222,7 @@ void RemoteClient::GetNextBlocks (
238222
const v3s16 cam_pos_nodes = floatToInt(camera_pos, BS);
239223

240224
s16 d;
241-
for (d = d_start; d <= d_max; d++) {
225+
for (d = d_start; d <= full_d_max; d++) {
242226
/*
243227
Get the border/face dot coordinates of a "d-radiused"
244228
box

Diff for: ‎src/clientiface.h

-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@ class RemoteClient
364364
std::set<v3s16> m_blocks_sent;
365365
s16 m_nearest_unsent_d = 0;
366366
v3s16 m_last_center;
367-
float m_nearest_unsent_reset_timer = 0.0f;
368367

369368
const u16 m_max_simul_sends;
370369
const float m_min_time_from_building;

0 commit comments

Comments
 (0)
Please sign in to comment.