Remove or restrict some client settings ()

This commit is contained in:
sfan5
2025-01-08 10:56:45 +01:00
committed by GitHub
parent 41f7031e49
commit e5542e5b02
11 changed files with 48 additions and 128 deletions

@ -377,17 +377,12 @@ fog_start (Fog start) float 0.4 0.0 0.99
[**Clouds] [**Clouds]
# Clouds are a client-side effect. # Allow clouds to look 3D instead of flat.
enable_clouds (Clouds) bool true
# Use 3D cloud look instead of flat.
#
# Requires: enable_clouds
enable_3d_clouds (3D clouds) bool true enable_3d_clouds (3D clouds) bool true
# Use smooth cloud shading. # Use smooth cloud shading.
# #
# Requires: enable_3d_clouds, enable_clouds # Requires: enable_3d_clouds
soft_clouds (Soft clouds) bool false soft_clouds (Soft clouds) bool false
[**Filtering and Antialiasing] [**Filtering and Antialiasing]
@ -472,9 +467,6 @@ smooth_lighting (Smooth lighting) bool true
# at the expense of minor visual glitches that do not impact game playability. # at the expense of minor visual glitches that do not impact game playability.
performance_tradeoffs (Tradeoffs for performance) bool false performance_tradeoffs (Tradeoffs for performance) bool false
# Adds particles when digging a node.
enable_particles (Digging particles) bool true
[**Waving Nodes] [**Waving Nodes]
@ -642,8 +634,7 @@ sound_volume (Volume) float 0.8 0.0 1.0
# Volume multiplier when the window is unfocused. # Volume multiplier when the window is unfocused.
sound_volume_unfocused (Volume when unfocused) float 0.3 0.0 1.0 sound_volume_unfocused (Volume when unfocused) float 0.3 0.0 1.0
# Whether to mute sounds. You can unmute sounds at any time, unless the # Whether to mute sounds. You can unmute sounds at any time.
# sound system is disabled (enable_sound=false).
# In-game, you can toggle the mute state with the mute key or by using the # In-game, you can toggle the mute state with the mute key or by using the
# pause menu. # pause menu.
mute_sound (Mute sound) bool false mute_sound (Mute sound) bool false
@ -684,12 +675,6 @@ formspec_fullscreen_bg_color (Formspec Full-Screen Background Color) string (0,0
# to hardware (e.g. render-to-texture for nodes in inventory). # to hardware (e.g. render-to-texture for nodes in inventory).
gui_scaling_filter (GUI scaling filter) bool false gui_scaling_filter (GUI scaling filter) bool false
# When gui_scaling_filter_txr2img is true, copy those images
# from hardware to software for scaling. When false, fall back
# to the old scaling method, for video drivers that don't
# properly support downloading textures back from hardware.
gui_scaling_filter_txr2img (GUI scaling filter txr2img) bool true
# Delay showing tooltips, stated in milliseconds. # Delay showing tooltips, stated in milliseconds.
tooltip_show_delay (Tooltip delay) int 400 0 18446744073709551615 tooltip_show_delay (Tooltip delay) int 400 0 18446744073709551615
@ -1844,10 +1829,7 @@ transparency_sorting_group_by_buffers (Transparency Sorting Group by Buffers) bo
# Radius of cloud area stated in number of 64 node cloud squares. # Radius of cloud area stated in number of 64 node cloud squares.
# Values larger than 26 will start to produce sharp cutoffs at cloud area corners. # Values larger than 26 will start to produce sharp cutoffs at cloud area corners.
cloud_radius (Cloud radius) int 12 1 62 cloud_radius (Cloud radius) int 12 8 62
# Whether node texture animations should be desynchronized per mapblock.
desynchronize_mapblock_texture_animation (Desynchronize block animation) bool false
# Delay between mesh updates on the client in ms. Increasing this will slow # Delay between mesh updates on the client in ms. Increasing this will slow
# down the rate of mesh updates, thus reducing jitter on slower clients. # down the rate of mesh updates, thus reducing jitter on slower clients.
@ -2101,9 +2083,6 @@ max_block_send_distance (Max block send distance) int 12 1 65535
# Set this to -1 to disable the limit. # Set this to -1 to disable the limit.
max_forceloaded_blocks (Maximum forceloaded blocks) int 16 -1 max_forceloaded_blocks (Maximum forceloaded blocks) int 16 -1
# Interval of sending time of day to clients, stated in seconds.
time_send_interval (Time send interval) float 5.0 0.001
# Interval of saving important changes in the world, stated in seconds. # Interval of saving important changes in the world, stated in seconds.
server_map_save_interval (Map save interval) float 5.3 0.001 server_map_save_interval (Map save interval) float 5.3 0.001
@ -2112,7 +2091,7 @@ server_map_save_interval (Map save interval) float 5.3 0.001
server_unload_unused_data_timeout (Unload unused server data) int 29 0 4294967295 server_unload_unused_data_timeout (Unload unused server data) int 29 0 4294967295
# Maximum number of statically stored objects in a block. # Maximum number of statically stored objects in a block.
max_objects_per_block (Maximum objects per block) int 256 1 65535 max_objects_per_block (Maximum objects per block) int 256 256 65535
# Length of time between active block management cycles, stated in seconds. # Length of time between active block management cycles, stated in seconds.
active_block_mgmt_interval (Active block management interval) float 2.0 0.0 active_block_mgmt_interval (Active block management interval) float 2.0 0.0
@ -2331,12 +2310,6 @@ show_technical_names (Show technical names) bool false
# Controlled by a checkbox in the settings menu. # Controlled by a checkbox in the settings menu.
show_advanced (Show advanced settings) bool false show_advanced (Show advanced settings) bool false
# Enables the sound system.
# If disabled, this completely disables all sounds everywhere and the in-game
# sound controls will be non-functional.
# Changing this setting requires a restart.
enable_sound (Sound) bool true
# Key for moving the player forward. # Key for moving the player forward.
keymap_forward (Forward key) key KEY_KEY_W keymap_forward (Forward key) key KEY_KEY_W

@ -91,8 +91,7 @@ bool ClientLauncher::run(GameStartData &start_data, const Settings &cmd_args)
init_args(start_data, cmd_args); init_args(start_data, cmd_args);
#if USE_SOUND #if USE_SOUND
if (g_settings->getBool("enable_sound")) g_sound_manager_singleton = createSoundManagerSingleton();
g_sound_manager_singleton = createSoundManagerSingleton();
#endif #endif
if (!init_engine()) if (!init_engine())

@ -445,8 +445,8 @@ void Clouds::readSettings()
// chosen to avoid exactly that. // chosen to avoid exactly that.
// refer to vertex_count in updateMesh() // refer to vertex_count in updateMesh()
m_enable_3d = g_settings->getBool("enable_3d_clouds"); m_enable_3d = g_settings->getBool("enable_3d_clouds");
const u16 maximum = m_enable_3d ? 62 : 25; const u16 maximum = !m_enable_3d ? 62 : 25;
m_cloud_radius_i = rangelim(g_settings->getU16("cloud_radius"), 1, maximum); m_cloud_radius_i = rangelim(g_settings->getU16("cloud_radius"), 8, maximum);
invalidateMesh(); invalidateMesh();
} }

@ -741,11 +741,8 @@ private:
* (as opposed to the this local caching). This can be addressed in * (as opposed to the this local caching). This can be addressed in
* a later release. * a later release.
*/ */
bool m_cache_disable_escape_sequences;
bool m_cache_doubletap_jump; bool m_cache_doubletap_jump;
bool m_cache_enable_clouds;
bool m_cache_enable_joysticks; bool m_cache_enable_joysticks;
bool m_cache_enable_particles;
bool m_cache_enable_fog; bool m_cache_enable_fog;
bool m_cache_enable_noclip; bool m_cache_enable_noclip;
bool m_cache_enable_free_move; bool m_cache_enable_free_move;
@ -787,16 +784,10 @@ Game::Game() :
{ {
g_settings->registerChangedCallback("chat_log_level", g_settings->registerChangedCallback("chat_log_level",
&settingChangedCallback, this); &settingChangedCallback, this);
g_settings->registerChangedCallback("disable_escape_sequences",
&settingChangedCallback, this);
g_settings->registerChangedCallback("doubletap_jump", g_settings->registerChangedCallback("doubletap_jump",
&settingChangedCallback, this); &settingChangedCallback, this);
g_settings->registerChangedCallback("enable_clouds",
&settingChangedCallback, this);
g_settings->registerChangedCallback("enable_joysticks", g_settings->registerChangedCallback("enable_joysticks",
&settingChangedCallback, this); &settingChangedCallback, this);
g_settings->registerChangedCallback("enable_particles",
&settingChangedCallback, this);
g_settings->registerChangedCallback("enable_fog", g_settings->registerChangedCallback("enable_fog",
&settingChangedCallback, this); &settingChangedCallback, this);
g_settings->registerChangedCallback("mouse_sensitivity", g_settings->registerChangedCallback("mouse_sensitivity",
@ -1138,7 +1129,7 @@ bool Game::init(
bool Game::initSound() bool Game::initSound()
{ {
#if USE_SOUND #if USE_SOUND
if (g_settings->getBool("enable_sound") && g_sound_manager_singleton.get()) { if (g_sound_manager_singleton.get()) {
infostream << "Attempting to use OpenAL audio" << std::endl; infostream << "Attempting to use OpenAL audio" << std::endl;
sound_manager = createOpenALSoundManager(g_sound_manager_singleton.get(), sound_manager = createOpenALSoundManager(g_sound_manager_singleton.get(),
std::make_unique<SoundFallbackPathProvider>()); std::make_unique<SoundFallbackPathProvider>());
@ -1296,8 +1287,7 @@ bool Game::createClient(const GameStartData &start_data)
/* Clouds /* Clouds
*/ */
if (m_cache_enable_clouds) clouds = make_irr<Clouds>(smgr, shader_src, -1, myrand());
clouds = make_irr<Clouds>(smgr, shader_src, -1, rand());
/* Skybox /* Skybox
*/ */
@ -1873,34 +1863,22 @@ void Game::processKeyInput()
toggleNoClip(); toggleNoClip();
#if USE_SOUND #if USE_SOUND
} else if (wasKeyDown(KeyType::MUTE)) { } else if (wasKeyDown(KeyType::MUTE)) {
if (g_settings->getBool("enable_sound")) { bool new_mute_sound = !g_settings->getBool("mute_sound");
bool new_mute_sound = !g_settings->getBool("mute_sound"); g_settings->setBool("mute_sound", new_mute_sound);
g_settings->setBool("mute_sound", new_mute_sound); if (new_mute_sound)
if (new_mute_sound) m_game_ui->showTranslatedStatusText("Sound muted");
m_game_ui->showTranslatedStatusText("Sound muted"); else
else m_game_ui->showTranslatedStatusText("Sound unmuted");
m_game_ui->showTranslatedStatusText("Sound unmuted");
} else {
m_game_ui->showTranslatedStatusText("Sound system is disabled");
}
} else if (wasKeyDown(KeyType::INC_VOLUME)) { } else if (wasKeyDown(KeyType::INC_VOLUME)) {
if (g_settings->getBool("enable_sound")) { float new_volume = g_settings->getFloat("sound_volume", 0.0f, 0.9f) + 0.1f;
float new_volume = g_settings->getFloat("sound_volume", 0.0f, 0.9f) + 0.1f; g_settings->setFloat("sound_volume", new_volume);
g_settings->setFloat("sound_volume", new_volume); std::wstring msg = fwgettext("Volume changed to %d%%", myround(new_volume * 100));
std::wstring msg = fwgettext("Volume changed to %d%%", myround(new_volume * 100)); m_game_ui->showStatusText(msg);
m_game_ui->showStatusText(msg);
} else {
m_game_ui->showTranslatedStatusText("Sound system is disabled");
}
} else if (wasKeyDown(KeyType::DEC_VOLUME)) { } else if (wasKeyDown(KeyType::DEC_VOLUME)) {
if (g_settings->getBool("enable_sound")) { float new_volume = g_settings->getFloat("sound_volume", 0.1f, 1.0f) - 0.1f;
float new_volume = g_settings->getFloat("sound_volume", 0.1f, 1.0f) - 0.1f; g_settings->setFloat("sound_volume", new_volume);
g_settings->setFloat("sound_volume", new_volume); std::wstring msg = fwgettext("Volume changed to %d%%", myround(new_volume * 100));
std::wstring msg = fwgettext("Volume changed to %d%%", myround(new_volume * 100)); m_game_ui->showStatusText(msg);
m_game_ui->showStatusText(msg);
} else {
m_game_ui->showTranslatedStatusText("Sound system is disabled");
}
#else #else
} else if (wasKeyDown(KeyType::MUTE) || wasKeyDown(KeyType::INC_VOLUME) } else if (wasKeyDown(KeyType::MUTE) || wasKeyDown(KeyType::INC_VOLUME)
|| wasKeyDown(KeyType::DEC_VOLUME)) { || wasKeyDown(KeyType::DEC_VOLUME)) {
@ -2859,9 +2837,6 @@ void Game::handleClientEvent_OverrideDayNigthRatio(ClientEvent *event,
void Game::handleClientEvent_CloudParams(ClientEvent *event, CameraOrientation *cam) void Game::handleClientEvent_CloudParams(ClientEvent *event, CameraOrientation *cam)
{ {
if (!clouds)
return;
clouds->setDensity(event->cloud_params.density); clouds->setDensity(event->cloud_params.density);
clouds->setColorBright(video::SColor(event->cloud_params.color_bright)); clouds->setColorBright(video::SColor(event->cloud_params.color_bright));
clouds->setColorAmbient(video::SColor(event->cloud_params.color_ambient)); clouds->setColorAmbient(video::SColor(event->cloud_params.color_ambient));
@ -2898,10 +2873,7 @@ void Game::updateChat(f32 dtime)
std::vector<LogEntry> entries = m_chat_log_buf.take(); std::vector<LogEntry> entries = m_chat_log_buf.take();
for (const auto& entry : entries) { for (const auto& entry : entries) {
std::string line; std::string line;
if (!m_cache_disable_escape_sequences) { line.append(color_for(entry.level)).append(entry.combined);
line.append(color_for(entry.level));
}
line.append(entry.combined);
chat_backend->addMessage(L"", utf8_to_wide(line)); chat_backend->addMessage(L"", utf8_to_wide(line));
} }
@ -2986,8 +2958,7 @@ void Game::updateCamera(f32 dtime)
client->updateCameraOffset(camera_offset); client->updateCameraOffset(camera_offset);
client->getEnv().updateCameraOffset(camera_offset); client->getEnv().updateCameraOffset(camera_offset);
if (clouds) clouds->updateCameraOffset(camera_offset);
clouds->updateCameraOffset(camera_offset);
} }
} }
} }
@ -3646,10 +3617,8 @@ void Game::handleDigging(const PointedThing &pointed, const v3s16 &nodepos,
} else { } else {
runData.dig_time_complete = params.time; runData.dig_time_complete = params.time;
if (m_cache_enable_particles) { client->getParticleManager()->addNodeParticle(client,
client->getParticleManager()->addNodeParticle(client, player, nodepos, n, features);
player, nodepos, n, features);
}
} }
if (!runData.digging) { if (!runData.digging) {
@ -3734,11 +3703,8 @@ void Game::handleDigging(const PointedThing &pointed, const v3s16 &nodepos,
client->interact(INTERACT_DIGGING_COMPLETED, pointed); client->interact(INTERACT_DIGGING_COMPLETED, pointed);
if (m_cache_enable_particles) { client->getParticleManager()->addDiggingParticles(client,
client->getParticleManager()->addDiggingParticles(client, player, nodepos, n, features);
player, nodepos, n, features);
}
// Send event to trigger sound // Send event to trigger sound
client->getEventManager()->put(new NodeDugEvent(nodepos, n)); client->getEventManager()->put(new NodeDugEvent(nodepos, n));
@ -3829,8 +3795,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
/* /*
Update clouds Update clouds
*/ */
if (clouds) updateClouds(dtime);
updateClouds(dtime);
/* /*
Update particles Update particles
@ -4092,11 +4057,8 @@ void Game::readSettings()
} }
m_chat_log_buf.setLogLevel(chat_log_level); m_chat_log_buf.setLogLevel(chat_log_level);
m_cache_disable_escape_sequences = g_settings->getBool("disable_escape_sequences");
m_cache_doubletap_jump = g_settings->getBool("doubletap_jump"); m_cache_doubletap_jump = g_settings->getBool("doubletap_jump");
m_cache_enable_clouds = g_settings->getBool("enable_clouds");
m_cache_enable_joysticks = g_settings->getBool("enable_joysticks"); m_cache_enable_joysticks = g_settings->getBool("enable_joysticks");
m_cache_enable_particles = g_settings->getBool("enable_particles");
m_cache_enable_fog = g_settings->getBool("enable_fog"); m_cache_enable_fog = g_settings->getBool("enable_fog");
m_cache_mouse_sensitivity = g_settings->getFloat("mouse_sensitivity", 0.001f, 10.0f); m_cache_mouse_sensitivity = g_settings->getFloat("mouse_sensitivity", 0.001f, 10.0f);
m_cache_joystick_frustum_sensitivity = std::max(g_settings->getFloat("joystick_frustum_sensitivity"), 0.001f); m_cache_joystick_frustum_sensitivity = std::max(g_settings->getFloat("joystick_frustum_sensitivity"), 0.001f);

@ -333,12 +333,11 @@ void GameFormSpec::showPauseMenu()
#ifndef __ANDROID__ #ifndef __ANDROID__
#if USE_SOUND #if USE_SOUND
if (g_settings->getBool("enable_sound")) { os << "button_exit[4," << (ypos++) << ";3,0.5;btn_sound;"
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_sound;" << strgettext("Sound Volume") << "]";
<< strgettext("Sound Volume") << "]";
}
#endif #endif
#endif #endif
if (g_touchcontrols) { if (g_touchcontrols) {
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_touchscreen_layout;" os << "button_exit[4," << (ypos++) << ";3,0.5;btn_touchscreen_layout;"
<< strgettext("Touchscreen Layout") << "]"; << strgettext("Touchscreen Layout") << "]";

@ -94,8 +94,7 @@ video::ITexture *guiScalingResizeCached(video::IVideoDriver *driver,
auto it_img = g_imgCache.find(origname); auto it_img = g_imgCache.find(origname);
video::IImage *srcimg = (it_img != g_imgCache.end()) ? it_img->second : nullptr; video::IImage *srcimg = (it_img != g_imgCache.end()) ? it_img->second : nullptr;
if (!srcimg) { if (!srcimg) {
if (!g_settings->getBool("gui_scaling_filter_txr2img")) // Download image from GPU
return src;
srcimg = driver->createImageFromData(src->getColorFormat(), srcimg = driver->createImageFromData(src->getColorFormat(),
src->getSize(), src->lock(video::ETLM_READ_ONLY), false); src->getSize(), src->lock(video::ETLM_READ_ONLY), false);
src->unlock(); src->unlock();

@ -640,9 +640,6 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data, v3s16 camera_offs
Convert MeshCollector to SMesh Convert MeshCollector to SMesh
*/ */
const bool desync_animations = g_settings->getBool(
"desynchronize_mapblock_texture_animation");
m_bounding_radius = std::sqrt(collector.m_bounding_radius_sq); m_bounding_radius = std::sqrt(collector.m_bounding_radius_sq);
for (int layer = 0; layer < MAX_TILE_LAYERS; layer++) { for (int layer = 0; layer < MAX_TILE_LAYERS; layer++) {
@ -679,16 +676,7 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data, v3s16 camera_offs
auto &info = m_animation_info[{layer, i}]; auto &info = m_animation_info[{layer, i}];
info.tile = p.layer; info.tile = p.layer;
info.frame = 0; info.frame = 0;
if (desync_animations) { info.frame_offset = 0;
// Get starting position from noise
info.frame_offset =
100000 * (2.0 + noise3d(
data->m_blockpos.X, data->m_blockpos.Y,
data->m_blockpos.Z, 0));
} else {
// Play all synchronized
info.frame_offset = 0;
}
// Replace tile texture with the first animation frame // Replace tile texture with the first animation frame
p.layer.texture = (*p.layer.frames)[0].texture; p.layer.texture = (*p.layer.frames)[0].texture;
} }

@ -82,7 +82,6 @@ void set_default_settings()
// Client // Client
settings->setDefault("address", ""); settings->setDefault("address", "");
settings->setDefault("enable_sound", "true");
#if defined(__unix__) && !defined(__APPLE__) && !defined (__ANDROID__) #if defined(__unix__) && !defined(__APPLE__) && !defined (__ANDROID__)
// On Linux+X11 (not Linux+Wayland or Linux+XWayland), I've encountered a bug // On Linux+X11 (not Linux+Wayland or Linux+XWayland), I've encountered a bug
// where fake mouse events were generated from touch events if in relative // where fake mouse events were generated from touch events if in relative
@ -270,7 +269,6 @@ void set_default_settings()
settings->setDefault("cinematic", "false"); settings->setDefault("cinematic", "false");
settings->setDefault("camera_smoothing", "0.0"); settings->setDefault("camera_smoothing", "0.0");
settings->setDefault("cinematic_camera_smoothing", "0.7"); settings->setDefault("cinematic_camera_smoothing", "0.7");
settings->setDefault("enable_clouds", "true");
settings->setDefault("view_bobbing_amount", "1.0"); settings->setDefault("view_bobbing_amount", "1.0");
settings->setDefault("fall_bobbing_amount", "0.03"); settings->setDefault("fall_bobbing_amount", "0.03");
settings->setDefault("enable_3d_clouds", "true"); settings->setDefault("enable_3d_clouds", "true");
@ -292,14 +290,11 @@ void set_default_settings()
settings->setDefault("hud_scaling", "1.0"); settings->setDefault("hud_scaling", "1.0");
settings->setDefault("gui_scaling", "1.0"); settings->setDefault("gui_scaling", "1.0");
settings->setDefault("gui_scaling_filter", "false"); settings->setDefault("gui_scaling_filter", "false");
settings->setDefault("gui_scaling_filter_txr2img", "true");
settings->setDefault("smooth_scrolling", "true"); settings->setDefault("smooth_scrolling", "true");
settings->setDefault("desynchronize_mapblock_texture_animation", "false");
settings->setDefault("hud_hotbar_max_width", "1.0"); settings->setDefault("hud_hotbar_max_width", "1.0");
settings->setDefault("enable_local_map_saving", "false"); settings->setDefault("enable_local_map_saving", "false");
settings->setDefault("show_entity_selectionbox", "false"); settings->setDefault("show_entity_selectionbox", "false");
settings->setDefault("ambient_occlusion_gamma", "1.8"); settings->setDefault("ambient_occlusion_gamma", "1.8");
settings->setDefault("enable_particles", "true");
settings->setDefault("arm_inertia", "true"); settings->setDefault("arm_inertia", "true");
settings->setDefault("show_nametag_backgrounds", "true"); settings->setDefault("show_nametag_backgrounds", "true");
settings->setDefault("show_block_bounds_radius_near", "4"); settings->setDefault("show_block_bounds_radius_near", "4");
@ -415,7 +410,6 @@ void set_default_settings()
#endif #endif
// Server // Server
settings->setDefault("disable_escape_sequences", "false");
settings->setDefault("strip_color_codes", "false"); settings->setDefault("strip_color_codes", "false");
#ifndef NDEBUG #ifndef NDEBUG
settings->setDefault("random_mod_load_order", "true"); settings->setDefault("random_mod_load_order", "true");
@ -435,7 +429,6 @@ void set_default_settings()
settings->setDefault("protocol_version_min", "1"); settings->setDefault("protocol_version_min", "1");
settings->setDefault("player_transfer_distance", "0"); settings->setDefault("player_transfer_distance", "0");
settings->setDefault("max_simultaneous_block_sends_per_client", "40"); settings->setDefault("max_simultaneous_block_sends_per_client", "40");
settings->setDefault("time_send_interval", "5");
settings->setDefault("motd", ""); settings->setDefault("motd", "");
settings->setDefault("max_users", "15"); settings->setDefault("max_users", "15");

@ -130,7 +130,7 @@ GUIEngine::GUIEngine(JoystickController *joystick,
// create soundmanager // create soundmanager
#if USE_SOUND #if USE_SOUND
if (g_settings->getBool("enable_sound") && g_sound_manager_singleton.get()) { if (g_sound_manager_singleton.get()) {
m_sound_manager = createOpenALSoundManager(g_sound_manager_singleton.get(), m_sound_manager = createOpenALSoundManager(g_sound_manager_singleton.get(),
std::make_unique<MenuMusicFetcher>()); std::make_unique<MenuMusicFetcher>());
} }

@ -73,6 +73,12 @@ MapBlock::~MapBlock()
porting::TrackFreedMemory(sizeof(MapNode) * nodecount); porting::TrackFreedMemory(sizeof(MapNode) * nodecount);
} }
static inline size_t get_max_objects_per_block()
{
u16 ret = g_settings->getU16("max_objects_per_block");
return MYMAX(256, ret);
}
bool MapBlock::onObjectsActivation() bool MapBlock::onObjectsActivation()
{ {
// Ignore if no stored objects (to not set changed flag) // Ignore if no stored objects (to not set changed flag)
@ -84,7 +90,7 @@ bool MapBlock::onObjectsActivation()
<< "activating " << count << " objects in block " << getPos() << "activating " << count << " objects in block " << getPos()
<< std::endl; << std::endl;
if (count > g_settings->getU16("max_objects_per_block")) { if (count > get_max_objects_per_block()) {
errorstream << "suspiciously large amount of objects detected: " errorstream << "suspiciously large amount of objects detected: "
<< count << " in " << getPos() << "; removing all of them." << count << " in " << getPos() << "; removing all of them."
<< std::endl; << std::endl;
@ -99,7 +105,7 @@ bool MapBlock::onObjectsActivation()
bool MapBlock::saveStaticObject(u16 id, const StaticObject &obj, u32 reason) bool MapBlock::saveStaticObject(u16 id, const StaticObject &obj, u32 reason)
{ {
if (m_static_objects.getStoredSize() >= g_settings->getU16("max_objects_per_block")) { if (m_static_objects.getStoredSize() >= get_max_objects_per_block()) {
warningstream << "MapBlock::saveStaticObject(): Trying to store id = " << id warningstream << "MapBlock::saveStaticObject(): Trying to store id = " << id
<< " statically but block " << getPos() << " already contains " << " statically but block " << getPos() << " already contains "
<< m_static_objects.getStoredSize() << " objects." << m_static_objects.getStoredSize() << " objects."

@ -650,9 +650,10 @@ void Server::AsyncRunStep(float dtime, bool initial_step)
Send to clients at constant intervals Send to clients at constant intervals
*/ */
static const float time_send_interval = 5.0f;
m_time_of_day_send_timer -= dtime; m_time_of_day_send_timer -= dtime;
if (m_time_of_day_send_timer < 0.0) { if (m_time_of_day_send_timer < 0) {
m_time_of_day_send_timer = g_settings->getFloat("time_send_interval"); m_time_of_day_send_timer = time_send_interval;
u16 time = m_env->getTimeOfDay(); u16 time = m_env->getTimeOfDay();
float time_speed = g_settings->getFloat("time_speed"); float time_speed = g_settings->getFloat("time_speed");
SendTimeOfDay(PEER_ID_INEXISTENT, time, time_speed); SendTimeOfDay(PEER_ID_INEXISTENT, time, time_speed);