m_nothing_to_send_pause_timer -= dtime;
m_map_send_completion_timer += dtime;
+ if (m_map_send_completion_timer > g_settings->getFloat("server_unload_unused_data_timeout") * 0.8f) {
+ infostream << "Server: Player " << m_name << ", peer_id=" << peer_id
+ << ": full map send is taking too long ("
+ << m_map_send_completion_timer
+ << "s), restarting to avoid visible blocks being unloaded."
+ << std::endl;
+ m_map_send_completion_timer = 0.0f;
+ m_nearest_unsent_d = 0;
+ }
+
if (m_nothing_to_send_pause_timer >= 0)
return;
if (m_last_center != center) {
m_nearest_unsent_d = 0;
m_last_center = center;
+ m_map_send_completion_timer = 0.0f;
}
// reset the unsent distance if the view angle has changed more that 10% of the fov
// (this matches isBlockInSight which allows for an extra 10%)
if (camera_dir.dotProduct(m_last_camera_dir) < std::cos(camera_fov * 0.1f)) {
m_nearest_unsent_d = 0;
m_last_camera_dir = camera_dir;
+ m_map_send_completion_timer = 0.0f;
}
if (m_nearest_unsent_d > 0) {
// make sure any blocks modified since the last time we sent blocks are resent
if (d <= BLOCK_SEND_DISABLE_LIMITS_MAX_D)
max_simul_dynamic = m_max_simul_sends;
- // Don't select too many blocks for sending
- if (num_blocks_selected >= max_simul_dynamic) {
- //queue_is_full = true;
- goto queue_full_break;
- }
-
- // Don't send blocks that are currently being transferred
- if (m_blocks_sending.find(p) != m_blocks_sending.end())
- continue;
-
/*
Do not go over max mapgen limit
*/
block->resetUsageTimer();
}
+ // Don't select too many blocks for sending
+ if (num_blocks_selected >= max_simul_dynamic) {
+ //queue_is_full = true;
+ goto queue_full_break;
+ }
+
+ // Don't send blocks that are currently being transferred
+ if (m_blocks_sending.find(p) != m_blocks_sending.end())
+ continue;
+
/*
Don't send already sent blocks
*/