2010-12-20 13:04:31 +01:00
|
|
|
/*
|
2013-02-24 18:40:43 +01:00
|
|
|
Minetest
|
2013-02-24 19:38:45 +01:00
|
|
|
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
2010-12-20 13:04:31 +01:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
2012-06-05 16:56:56 +02:00
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
2010-12-20 13:04:31 +01:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2012-06-05 16:56:56 +02:00
|
|
|
GNU Lesser General Public License for more details.
|
2010-12-20 13:04:31 +01:00
|
|
|
|
2012-06-05 16:56:56 +02:00
|
|
|
You should have received a copy of the GNU Lesser General Public License along
|
2010-12-20 13:04:31 +01:00
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2019-07-25 00:01:25 +02:00
|
|
|
#include <IrrCompileConfig.h>
|
2011-10-12 12:53:38 +02:00
|
|
|
#include "settings.h"
|
2014-02-16 00:20:15 +01:00
|
|
|
#include "porting.h"
|
2013-02-03 13:19:09 +01:00
|
|
|
#include "filesys.h"
|
2013-08-04 20:18:56 +02:00
|
|
|
#include "config.h"
|
2014-06-14 11:22:09 +02:00
|
|
|
#include "constants.h"
|
|
|
|
#include "porting.h"
|
2020-01-25 16:56:54 +01:00
|
|
|
#include "mapgen/mapgen.h" // Mapgen::setDefaultSettings
|
2015-10-15 19:16:26 +02:00
|
|
|
#include "util/string.h"
|
2010-12-20 13:04:31 +01:00
|
|
|
|
2011-10-12 12:53:38 +02:00
|
|
|
void set_default_settings(Settings *settings)
|
2010-12-20 13:04:31 +01:00
|
|
|
{
|
2011-02-08 00:12:55 +01:00
|
|
|
// Client and server
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("language", "");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("name", "");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("bind_address", "");
|
|
|
|
settings->setDefault("serverlist_url", "servers.minetest.net");
|
2011-02-08 00:12:55 +01:00
|
|
|
|
2015-10-15 19:16:26 +02:00
|
|
|
// Client
|
|
|
|
settings->setDefault("address", "");
|
|
|
|
settings->setDefault("enable_sound", "true");
|
|
|
|
settings->setDefault("sound_volume", "0.8");
|
2017-09-26 08:17:50 +02:00
|
|
|
settings->setDefault("mute_sound", "false");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("enable_mesh_cache", "false");
|
2017-02-18 19:53:05 +01:00
|
|
|
settings->setDefault("mesh_generation_interval", "0");
|
2017-04-15 09:55:52 +02:00
|
|
|
settings->setDefault("meshgen_block_cache_size", "20");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("enable_vbo", "true");
|
|
|
|
settings->setDefault("free_move", "false");
|
2018-12-31 01:07:30 +01:00
|
|
|
settings->setDefault("pitch_move", "false");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("fast_move", "false");
|
|
|
|
settings->setDefault("noclip", "false");
|
2020-04-06 16:54:12 +02:00
|
|
|
settings->setDefault("screenshot_path", "screenshots");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("screenshot_format", "png");
|
|
|
|
settings->setDefault("screenshot_quality", "0");
|
|
|
|
settings->setDefault("client_unload_unused_data_timeout", "600");
|
2020-11-04 00:39:03 +01:00
|
|
|
settings->setDefault("client_mapblock_limit", "7500");
|
2017-09-12 19:48:09 +02:00
|
|
|
settings->setDefault("enable_build_where_you_stand", "false");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("curl_timeout", "5000");
|
|
|
|
settings->setDefault("curl_parallel_limit", "8");
|
|
|
|
settings->setDefault("curl_file_download_timeout", "300000");
|
|
|
|
settings->setDefault("curl_verify_cert", "true");
|
|
|
|
settings->setDefault("enable_remote_media_server", "true");
|
2017-03-13 15:55:30 +01:00
|
|
|
settings->setDefault("enable_client_modding", "false");
|
2017-07-15 09:28:10 +02:00
|
|
|
settings->setDefault("max_out_chat_queue_size", "20");
|
2017-09-10 04:17:47 +02:00
|
|
|
settings->setDefault("pause_on_lost_focus", "false");
|
2019-01-26 20:26:37 +01:00
|
|
|
settings->setDefault("enable_register_confirmation", "true");
|
2015-10-15 19:16:26 +02:00
|
|
|
|
|
|
|
// Keymap
|
2013-11-28 21:43:06 +01:00
|
|
|
settings->setDefault("remote_port", "30000");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("keymap_forward", "KEY_KEY_W");
|
2017-06-08 09:57:00 +02:00
|
|
|
settings->setDefault("keymap_autoforward", "");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("keymap_backward", "KEY_KEY_S");
|
|
|
|
settings->setDefault("keymap_left", "KEY_KEY_A");
|
|
|
|
settings->setDefault("keymap_right", "KEY_KEY_D");
|
|
|
|
settings->setDefault("keymap_jump", "KEY_SPACE");
|
|
|
|
settings->setDefault("keymap_sneak", "KEY_LSHIFT");
|
2020-06-05 15:06:35 +02:00
|
|
|
settings->setDefault("keymap_dig", "KEY_LBUTTON");
|
|
|
|
settings->setDefault("keymap_place", "KEY_RBUTTON");
|
2011-11-27 04:01:38 +01:00
|
|
|
settings->setDefault("keymap_drop", "KEY_KEY_Q");
|
2013-03-31 05:30:32 +02:00
|
|
|
settings->setDefault("keymap_zoom", "KEY_KEY_Z");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("keymap_inventory", "KEY_KEY_I");
|
2011-10-17 19:40:55 +02:00
|
|
|
settings->setDefault("keymap_special1", "KEY_KEY_E");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("keymap_chat", "KEY_KEY_T");
|
|
|
|
settings->setDefault("keymap_cmd", "/");
|
2017-03-25 00:43:36 +01:00
|
|
|
settings->setDefault("keymap_cmd_local", ".");
|
2020-05-04 08:45:31 +02:00
|
|
|
settings->setDefault("keymap_minimap", "KEY_KEY_V");
|
2011-12-03 09:01:14 +01:00
|
|
|
settings->setDefault("keymap_console", "KEY_F10");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("keymap_rangeselect", "KEY_KEY_R");
|
|
|
|
settings->setDefault("keymap_freemove", "KEY_KEY_K");
|
2019-04-03 22:37:30 +02:00
|
|
|
settings->setDefault("keymap_pitchmove", "KEY_KEY_P");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("keymap_fastmove", "KEY_KEY_J");
|
2012-12-09 13:34:16 +01:00
|
|
|
settings->setDefault("keymap_noclip", "KEY_KEY_H");
|
2014-07-03 07:46:19 +02:00
|
|
|
settings->setDefault("keymap_hotbar_next", "KEY_KEY_N");
|
|
|
|
settings->setDefault("keymap_hotbar_previous", "KEY_KEY_B");
|
|
|
|
settings->setDefault("keymap_mute", "KEY_KEY_M");
|
|
|
|
settings->setDefault("keymap_increase_volume", "");
|
|
|
|
settings->setDefault("keymap_decrease_volume", "");
|
2016-07-04 19:01:58 +02:00
|
|
|
settings->setDefault("keymap_cinematic", "");
|
2012-02-01 00:56:30 +01:00
|
|
|
settings->setDefault("keymap_toggle_hud", "KEY_F1");
|
|
|
|
settings->setDefault("keymap_toggle_chat", "KEY_F2");
|
2018-01-29 18:21:49 +01:00
|
|
|
settings->setDefault("keymap_toggle_fog", "KEY_F3");
|
2014-10-17 18:58:36 +02:00
|
|
|
#if DEBUG
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("keymap_toggle_update_camera", "KEY_F4");
|
2014-10-17 18:58:36 +02:00
|
|
|
#else
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("keymap_toggle_update_camera", "");
|
2014-10-17 18:58:36 +02:00
|
|
|
#endif
|
2012-02-01 00:56:30 +01:00
|
|
|
settings->setDefault("keymap_toggle_debug", "KEY_F5");
|
|
|
|
settings->setDefault("keymap_toggle_profiler", "KEY_F6");
|
2020-05-04 08:45:31 +02:00
|
|
|
settings->setDefault("keymap_camera_mode", "KEY_KEY_C");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("keymap_screenshot", "KEY_F12");
|
2012-03-12 20:27:29 +01:00
|
|
|
settings->setDefault("keymap_increase_viewing_range_min", "+");
|
|
|
|
settings->setDefault("keymap_decrease_viewing_range_min", "-");
|
2016-12-18 23:34:52 +01:00
|
|
|
settings->setDefault("keymap_slot1", "KEY_KEY_1");
|
|
|
|
settings->setDefault("keymap_slot2", "KEY_KEY_2");
|
|
|
|
settings->setDefault("keymap_slot3", "KEY_KEY_3");
|
|
|
|
settings->setDefault("keymap_slot4", "KEY_KEY_4");
|
|
|
|
settings->setDefault("keymap_slot5", "KEY_KEY_5");
|
|
|
|
settings->setDefault("keymap_slot6", "KEY_KEY_6");
|
|
|
|
settings->setDefault("keymap_slot7", "KEY_KEY_7");
|
|
|
|
settings->setDefault("keymap_slot8", "KEY_KEY_8");
|
|
|
|
settings->setDefault("keymap_slot9", "KEY_KEY_9");
|
|
|
|
settings->setDefault("keymap_slot10", "KEY_KEY_0");
|
|
|
|
settings->setDefault("keymap_slot11", "");
|
|
|
|
settings->setDefault("keymap_slot12", "");
|
|
|
|
settings->setDefault("keymap_slot13", "");
|
|
|
|
settings->setDefault("keymap_slot14", "");
|
|
|
|
settings->setDefault("keymap_slot15", "");
|
|
|
|
settings->setDefault("keymap_slot16", "");
|
|
|
|
settings->setDefault("keymap_slot17", "");
|
|
|
|
settings->setDefault("keymap_slot18", "");
|
|
|
|
settings->setDefault("keymap_slot19", "");
|
|
|
|
settings->setDefault("keymap_slot20", "");
|
|
|
|
settings->setDefault("keymap_slot21", "");
|
|
|
|
settings->setDefault("keymap_slot22", "");
|
|
|
|
settings->setDefault("keymap_slot23", "");
|
2018-12-02 23:34:29 +01:00
|
|
|
settings->setDefault("keymap_slot24", "");
|
|
|
|
settings->setDefault("keymap_slot25", "");
|
|
|
|
settings->setDefault("keymap_slot26", "");
|
|
|
|
settings->setDefault("keymap_slot27", "");
|
|
|
|
settings->setDefault("keymap_slot28", "");
|
|
|
|
settings->setDefault("keymap_slot29", "");
|
|
|
|
settings->setDefault("keymap_slot30", "");
|
|
|
|
settings->setDefault("keymap_slot31", "");
|
|
|
|
settings->setDefault("keymap_slot32", "");
|
2016-12-18 23:34:52 +01:00
|
|
|
|
2011-05-14 14:43:26 +02:00
|
|
|
// Some (temporary) keys for debugging
|
2012-03-12 20:27:29 +01:00
|
|
|
settings->setDefault("keymap_quicktune_prev", "KEY_HOME");
|
|
|
|
settings->setDefault("keymap_quicktune_next", "KEY_END");
|
|
|
|
settings->setDefault("keymap_quicktune_dec", "KEY_NEXT");
|
|
|
|
settings->setDefault("keymap_quicktune_inc", "KEY_PRIOR");
|
2011-05-14 14:43:26 +02:00
|
|
|
|
2015-10-15 19:16:26 +02:00
|
|
|
// Visuals
|
|
|
|
#ifdef NDEBUG
|
2012-02-01 00:56:30 +01:00
|
|
|
settings->setDefault("show_debug", "false");
|
2015-10-15 19:16:26 +02:00
|
|
|
#else
|
2012-02-01 00:56:30 +01:00
|
|
|
settings->setDefault("show_debug", "true");
|
2015-10-15 19:16:26 +02:00
|
|
|
#endif
|
|
|
|
settings->setDefault("fsaa", "0");
|
2017-01-12 10:19:36 +01:00
|
|
|
settings->setDefault("undersampling", "0");
|
2017-10-15 09:34:14 +02:00
|
|
|
settings->setDefault("world_aligned_mode", "enable");
|
|
|
|
settings->setDefault("autoscale_mode", "disable");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("enable_fog", "true");
|
|
|
|
settings->setDefault("fog_start", "0.4");
|
|
|
|
settings->setDefault("3d_mode", "none");
|
|
|
|
settings->setDefault("3d_paralax_strength", "0.025");
|
|
|
|
settings->setDefault("tooltip_show_delay", "400");
|
2017-09-16 18:42:17 +02:00
|
|
|
settings->setDefault("tooltip_append_itemname", "false");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("fps_max", "60");
|
2020-10-03 18:33:51 +02:00
|
|
|
settings->setDefault("fps_max_unfocused", "20");
|
2020-11-04 00:39:03 +01:00
|
|
|
settings->setDefault("viewing_range", "190");
|
2020-03-28 21:53:55 +01:00
|
|
|
#if ENABLE_GLES
|
2017-10-07 15:11:48 +02:00
|
|
|
settings->setDefault("near_plane", "0.1");
|
2020-03-28 21:53:55 +01:00
|
|
|
#endif
|
2017-07-12 15:44:58 +02:00
|
|
|
settings->setDefault("screen_w", "1024");
|
2017-07-17 22:19:46 +02:00
|
|
|
settings->setDefault("screen_h", "600");
|
2017-05-05 13:47:11 +02:00
|
|
|
settings->setDefault("autosave_screensize", "true");
|
2012-04-03 13:59:02 +02:00
|
|
|
settings->setDefault("fullscreen", "false");
|
|
|
|
settings->setDefault("fullscreen_bpp", "24");
|
|
|
|
settings->setDefault("vsync", "false");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("fov", "72");
|
2015-07-08 11:20:07 +02:00
|
|
|
settings->setDefault("leaves_style", "fancy");
|
2014-09-27 18:16:26 +02:00
|
|
|
settings->setDefault("connected_glass", "false");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("smooth_lighting", "true");
|
2017-08-17 00:23:20 +02:00
|
|
|
settings->setDefault("lighting_alpha", "0.0");
|
2017-11-18 01:22:15 +01:00
|
|
|
settings->setDefault("lighting_beta", "1.5");
|
2017-08-17 00:23:20 +02:00
|
|
|
settings->setDefault("display_gamma", "1.0");
|
2017-11-18 01:22:15 +01:00
|
|
|
settings->setDefault("lighting_boost", "0.2");
|
|
|
|
settings->setDefault("lighting_boost_center", "0.5");
|
|
|
|
settings->setDefault("lighting_boost_spread", "0.2");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("texture_path", "");
|
2012-03-19 02:59:12 +01:00
|
|
|
settings->setDefault("shader_path", "");
|
2019-07-25 00:01:25 +02:00
|
|
|
#if ENABLE_GLES
|
|
|
|
#ifdef _IRR_COMPILE_WITH_OGLES1_
|
|
|
|
settings->setDefault("video_driver", "ogles1");
|
|
|
|
#else
|
|
|
|
settings->setDefault("video_driver", "ogles2");
|
|
|
|
#endif
|
|
|
|
#else
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("video_driver", "opengl");
|
2019-07-25 00:01:25 +02:00
|
|
|
#endif
|
2015-02-15 20:27:15 +01:00
|
|
|
settings->setDefault("cinematic", "false");
|
|
|
|
settings->setDefault("camera_smoothing", "0");
|
|
|
|
settings->setDefault("cinematic_camera_smoothing", "0.7");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("enable_clouds", "true");
|
2011-10-15 15:32:24 +02:00
|
|
|
settings->setDefault("view_bobbing_amount", "1.0");
|
2018-11-12 19:34:47 +01:00
|
|
|
settings->setDefault("fall_bobbing_amount", "0.03");
|
2012-03-28 13:10:54 +02:00
|
|
|
settings->setDefault("enable_3d_clouds", "true");
|
2015-05-04 19:53:58 +02:00
|
|
|
settings->setDefault("cloud_radius", "12");
|
2013-03-05 23:23:03 +01:00
|
|
|
settings->setDefault("menu_clouds", "true");
|
2011-11-03 22:06:57 +01:00
|
|
|
settings->setDefault("opaque_water", "false");
|
2017-12-17 05:38:54 +01:00
|
|
|
settings->setDefault("console_height", "0.6");
|
2011-12-03 09:01:14 +01:00
|
|
|
settings->setDefault("console_color", "(0,0,0)");
|
|
|
|
settings->setDefault("console_alpha", "200");
|
2017-08-29 19:25:16 +02:00
|
|
|
settings->setDefault("formspec_fullscreen_bg_color", "(0,0,0)");
|
|
|
|
settings->setDefault("formspec_fullscreen_bg_opacity", "140");
|
|
|
|
settings->setDefault("formspec_default_bg_color", "(0,0,0)");
|
|
|
|
settings->setDefault("formspec_default_bg_opacity", "140");
|
2012-12-26 22:35:48 +01:00
|
|
|
settings->setDefault("selectionbox_color", "(0,0,0)");
|
2016-02-07 04:08:43 +01:00
|
|
|
settings->setDefault("selectionbox_width", "2");
|
|
|
|
settings->setDefault("node_highlighting", "box");
|
2012-12-26 22:35:48 +01:00
|
|
|
settings->setDefault("crosshair_color", "(255,255,255)");
|
|
|
|
settings->setDefault("crosshair_alpha", "255");
|
2017-10-16 02:22:22 +02:00
|
|
|
settings->setDefault("recent_chat_messages", "6");
|
2015-01-07 00:10:46 +01:00
|
|
|
settings->setDefault("hud_scaling", "1.0");
|
2015-01-09 19:07:55 +01:00
|
|
|
settings->setDefault("gui_scaling", "1.0");
|
2015-03-09 14:32:11 +01:00
|
|
|
settings->setDefault("gui_scaling_filter", "false");
|
|
|
|
settings->setDefault("gui_scaling_filter_txr2img", "true");
|
2012-06-16 21:37:20 +02:00
|
|
|
settings->setDefault("desynchronize_mapblock_texture_animation", "true");
|
2016-02-07 04:08:43 +01:00
|
|
|
settings->setDefault("hud_hotbar_max_width", "1.0");
|
2014-10-09 14:02:02 +02:00
|
|
|
settings->setDefault("enable_local_map_saving", "false");
|
2020-07-14 19:12:17 +02:00
|
|
|
settings->setDefault("show_entity_selectionbox", "false");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("texture_clean_transparent", "false");
|
|
|
|
settings->setDefault("texture_min_size", "64");
|
2020-09-01 20:18:32 +02:00
|
|
|
settings->setDefault("ambient_occlusion_gamma", "1.8");
|
2019-07-25 00:01:25 +02:00
|
|
|
#if ENABLE_GLES
|
|
|
|
settings->setDefault("enable_shaders", "false");
|
|
|
|
#else
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("enable_shaders", "true");
|
2019-07-25 00:01:25 +02:00
|
|
|
#endif
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("enable_particles", "true");
|
2017-06-26 20:03:48 +02:00
|
|
|
settings->setDefault("arm_inertia", "true");
|
2015-10-15 19:16:26 +02:00
|
|
|
|
|
|
|
settings->setDefault("enable_minimap", "true");
|
|
|
|
settings->setDefault("minimap_shape_round", "true");
|
|
|
|
settings->setDefault("minimap_double_scan_height", "true");
|
2012-03-11 19:45:14 +01:00
|
|
|
|
2015-10-15 19:16:26 +02:00
|
|
|
// Effects
|
|
|
|
settings->setDefault("directional_colored_fog", "true");
|
|
|
|
settings->setDefault("inventory_items_animations", "false");
|
2012-11-27 08:38:21 +01:00
|
|
|
settings->setDefault("mip_map", "false");
|
|
|
|
settings->setDefault("anisotropic_filter", "false");
|
|
|
|
settings->setDefault("bilinear_filter", "false");
|
|
|
|
settings->setDefault("trilinear_filter", "false");
|
2016-01-25 13:33:22 +01:00
|
|
|
settings->setDefault("tone_mapping", "false");
|
2013-12-03 17:21:40 +01:00
|
|
|
settings->setDefault("enable_waving_water", "false");
|
|
|
|
settings->setDefault("water_wave_height", "1.0");
|
|
|
|
settings->setDefault("water_wave_length", "20.0");
|
|
|
|
settings->setDefault("water_wave_speed", "5.0");
|
|
|
|
settings->setDefault("enable_waving_leaves", "false");
|
|
|
|
settings->setDefault("enable_waving_plants", "false");
|
2015-06-22 04:34:56 +02:00
|
|
|
|
2012-12-14 12:30:17 +01:00
|
|
|
|
2015-10-15 19:16:26 +02:00
|
|
|
// Input
|
|
|
|
settings->setDefault("invert_mouse", "false");
|
|
|
|
settings->setDefault("mouse_sensitivity", "0.2");
|
2020-06-05 15:06:35 +02:00
|
|
|
settings->setDefault("repeat_place_time", "0.25");
|
2017-08-24 08:30:46 +02:00
|
|
|
settings->setDefault("safe_dig_and_place", "false");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("random_input", "false");
|
|
|
|
settings->setDefault("aux1_descends", "false");
|
|
|
|
settings->setDefault("doubletap_jump", "false");
|
|
|
|
settings->setDefault("always_fly_fast", "true");
|
2018-11-22 22:47:15 +01:00
|
|
|
#ifdef __ANDROID__
|
|
|
|
settings->setDefault("autojump", "true");
|
|
|
|
#else
|
|
|
|
settings->setDefault("autojump", "false");
|
|
|
|
#endif
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("continuous_forward", "false");
|
|
|
|
settings->setDefault("enable_joysticks", "false");
|
2017-04-03 00:00:34 +02:00
|
|
|
settings->setDefault("joystick_id", "0");
|
|
|
|
settings->setDefault("joystick_type", "");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("repeat_joystick_button_time", "0.17");
|
|
|
|
settings->setDefault("joystick_frustum_sensitivity", "170");
|
2014-04-26 01:15:46 +02:00
|
|
|
|
2015-10-15 19:16:26 +02:00
|
|
|
// Main menu
|
|
|
|
settings->setDefault("main_menu_path", "");
|
2012-12-25 12:20:51 +01:00
|
|
|
settings->setDefault("serverlist_file", "favoriteservers.txt");
|
2016-05-31 17:30:11 +02:00
|
|
|
|
2013-08-04 20:18:56 +02:00
|
|
|
#if USE_FREETYPE
|
|
|
|
settings->setDefault("freetype", "true");
|
2017-02-14 10:08:17 +01:00
|
|
|
settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "Arimo-Regular.ttf"));
|
2019-09-10 15:11:26 +02:00
|
|
|
settings->setDefault("font_path_italic", porting::getDataPath("fonts" DIR_DELIM "Arimo-Italic.ttf"));
|
|
|
|
settings->setDefault("font_path_bold", porting::getDataPath("fonts" DIR_DELIM "Arimo-Bold.ttf"));
|
|
|
|
settings->setDefault("font_path_bold_italic", porting::getDataPath("fonts" DIR_DELIM "Arimo-BoldItalic.ttf"));
|
|
|
|
settings->setDefault("font_bold", "false");
|
|
|
|
settings->setDefault("font_italic", "false");
|
2013-12-12 18:47:54 +01:00
|
|
|
settings->setDefault("font_shadow", "1");
|
2016-09-15 17:53:17 +02:00
|
|
|
settings->setDefault("font_shadow_alpha", "127");
|
2017-02-14 10:08:17 +01:00
|
|
|
settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "Cousine-Regular.ttf"));
|
2019-09-10 15:11:26 +02:00
|
|
|
settings->setDefault("mono_font_path_italic", porting::getDataPath("fonts" DIR_DELIM "Cousine-Italic.ttf"));
|
|
|
|
settings->setDefault("mono_font_path_bold", porting::getDataPath("fonts" DIR_DELIM "Cousine-Bold.ttf"));
|
|
|
|
settings->setDefault("mono_font_path_bold_italic", porting::getDataPath("fonts" DIR_DELIM "Cousine-BoldItalic.ttf"));
|
2017-02-15 00:01:25 +01:00
|
|
|
settings->setDefault("fallback_font_path", porting::getDataPath("fonts" DIR_DELIM "DroidSansFallbackFull.ttf"));
|
2014-06-14 11:22:09 +02:00
|
|
|
|
2013-12-12 18:47:54 +01:00
|
|
|
settings->setDefault("fallback_font_shadow", "1");
|
2013-12-12 21:02:09 +01:00
|
|
|
settings->setDefault("fallback_font_shadow_alpha", "128");
|
2014-11-23 13:40:43 +01:00
|
|
|
|
2015-10-15 19:16:26 +02:00
|
|
|
std::string font_size_str = std::to_string(TTF_DEFAULT_FONT_SIZE);
|
2014-11-23 13:40:43 +01:00
|
|
|
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("fallback_font_size", font_size_str);
|
2013-08-04 20:18:56 +02:00
|
|
|
#else
|
2014-11-28 20:06:34 +01:00
|
|
|
settings->setDefault("freetype", "false");
|
2017-02-14 10:08:17 +01:00
|
|
|
settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "mono_dejavu_sans"));
|
2014-11-23 13:40:43 +01:00
|
|
|
settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "mono_dejavu_sans"));
|
|
|
|
|
2017-01-14 12:28:43 +01:00
|
|
|
std::string font_size_str = std::to_string(DEFAULT_FONT_SIZE);
|
2013-08-04 20:18:56 +02:00
|
|
|
#endif
|
2020-05-24 14:24:13 +02:00
|
|
|
// General font settings
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("font_size", font_size_str);
|
|
|
|
settings->setDefault("mono_font_size", font_size_str);
|
2020-05-24 14:24:13 +02:00
|
|
|
settings->setDefault("chat_font_size", "0"); // Default "font_size"
|
|
|
|
|
|
|
|
// ContentDB
|
2018-05-13 22:41:02 +02:00
|
|
|
settings->setDefault("contentdb_url", "https://content.minetest.net");
|
2020-08-17 20:09:33 +02:00
|
|
|
settings->setDefault("contentdb_max_concurrent_downloads", "3");
|
|
|
|
|
2019-02-03 18:54:56 +01:00
|
|
|
#ifdef __ANDROID__
|
|
|
|
settings->setDefault("contentdb_flag_blacklist", "nonfree, android_default");
|
|
|
|
#else
|
|
|
|
settings->setDefault("contentdb_flag_blacklist", "nonfree, desktop_default");
|
|
|
|
#endif
|
2015-10-15 19:16:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
// Server
|
|
|
|
settings->setDefault("disable_escape_sequences", "false");
|
2017-06-10 13:49:44 +02:00
|
|
|
settings->setDefault("strip_color_codes", "false");
|
2020-04-27 08:31:37 +02:00
|
|
|
#if USE_PROMETHEUS
|
|
|
|
settings->setDefault("prometheus_listener_address", "127.0.0.1:30000");
|
|
|
|
#endif
|
2013-02-03 13:19:09 +01:00
|
|
|
|
2015-10-15 19:16:26 +02:00
|
|
|
// Network
|
|
|
|
settings->setDefault("enable_ipv6", "true");
|
|
|
|
settings->setDefault("ipv6_server", "false");
|
2014-01-06 20:05:28 +01:00
|
|
|
settings->setDefault("max_packets_per_iteration","1024");
|
2013-11-28 21:43:06 +01:00
|
|
|
settings->setDefault("port", "30000");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("strict_protocol_version_checking", "false");
|
|
|
|
settings->setDefault("player_transfer_distance", "0");
|
2018-07-13 22:11:49 +02:00
|
|
|
settings->setDefault("max_simultaneous_block_sends_per_client", "40");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("time_send_interval", "5");
|
|
|
|
|
2012-03-25 19:29:56 +02:00
|
|
|
settings->setDefault("default_game", "minetest");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("motd", "");
|
2013-09-17 21:28:21 +02:00
|
|
|
settings->setDefault("max_users", "15");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("creative_mode", "false");
|
|
|
|
settings->setDefault("enable_damage", "true");
|
|
|
|
settings->setDefault("default_password", "");
|
2012-03-31 16:48:46 +02:00
|
|
|
settings->setDefault("default_privs", "interact, shout");
|
2011-12-02 10:25:47 +01:00
|
|
|
settings->setDefault("enable_pvp", "true");
|
2017-09-26 00:11:20 +02:00
|
|
|
settings->setDefault("enable_mod_channels", "false");
|
2012-06-07 01:11:28 +02:00
|
|
|
settings->setDefault("disallow_empty_password", "false");
|
2012-07-21 13:38:49 +02:00
|
|
|
settings->setDefault("disable_anticheat", "false");
|
2012-07-28 02:08:09 +02:00
|
|
|
settings->setDefault("enable_rollback_recording", "false");
|
2014-04-29 17:47:34 +02:00
|
|
|
settings->setDefault("deprecated_lua_api_handling", "log");
|
2011-10-15 14:02:28 +02:00
|
|
|
|
2015-07-17 06:30:21 +02:00
|
|
|
settings->setDefault("kick_msg_shutdown", "Server shutting down.");
|
|
|
|
settings->setDefault("kick_msg_crash", "This server has experienced an internal error. You will now be disconnected.");
|
2015-07-17 16:40:41 +02:00
|
|
|
settings->setDefault("ask_reconnect_on_crash", "false");
|
2015-07-17 06:30:21 +02:00
|
|
|
|
2019-08-08 18:04:46 +02:00
|
|
|
settings->setDefault("chat_message_format", "<@name> @message");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("profiler_print_interval", "0");
|
2020-11-04 00:39:03 +01:00
|
|
|
settings->setDefault("active_object_send_range_blocks", "8");
|
|
|
|
settings->setDefault("active_block_range", "4");
|
2011-10-12 12:53:38 +02:00
|
|
|
//settings->setDefault("max_simultaneous_block_sends_per_client", "1");
|
2011-06-26 02:14:52 +02:00
|
|
|
// This causes frametime jitter on client side, or does it?
|
2020-11-04 00:39:03 +01:00
|
|
|
settings->setDefault("max_block_send_distance", "12");
|
2016-10-31 04:35:55 +01:00
|
|
|
settings->setDefault("block_send_optimize_distance", "4");
|
2017-03-03 21:40:50 +01:00
|
|
|
settings->setDefault("server_side_occlusion_culling", "true");
|
2018-12-24 10:51:10 +01:00
|
|
|
settings->setDefault("csm_restriction_flags", "62");
|
2018-07-19 04:58:48 +02:00
|
|
|
settings->setDefault("csm_restriction_noderange", "0");
|
2013-06-02 15:35:29 +02:00
|
|
|
settings->setDefault("max_clearobjects_extra_loaded_blocks", "4096");
|
2012-03-29 10:41:41 +02:00
|
|
|
settings->setDefault("time_speed", "72");
|
2019-04-13 02:46:38 +02:00
|
|
|
settings->setDefault("world_start_time", "6125");
|
2011-12-02 00:20:54 +01:00
|
|
|
settings->setDefault("server_unload_unused_data_timeout", "29");
|
2016-10-19 02:37:12 +02:00
|
|
|
settings->setDefault("max_objects_per_block", "64");
|
2011-12-02 00:20:54 +01:00
|
|
|
settings->setDefault("server_map_save_interval", "5.3");
|
2016-10-04 18:17:12 +02:00
|
|
|
settings->setDefault("chat_message_max_size", "500");
|
|
|
|
settings->setDefault("chat_message_limit_per_10sec", "8.0");
|
|
|
|
settings->setDefault("chat_message_limit_trigger_kick", "50");
|
2013-09-17 00:09:28 +02:00
|
|
|
settings->setDefault("sqlite_synchronous", "2");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("full_block_send_enable_min_time_from_building", "2.0");
|
2017-08-17 19:16:02 +02:00
|
|
|
settings->setDefault("dedicated_server_step", "0.09");
|
Allow NodeTimer, ABM and block mgmt interval changes.
ABM's are hardcoded to run every 1.0s, NodeTimers are hard coded to
run at every 1.0s. Block mgmt is running every 2.0sec.
However, these timers can be better tuned for both higher and lower
values by server owners. Some server owners want to, and have the
resources to send more packets per second to clients, and so they
may wish to send smaller updates sooner. Right now all ABM's are
coalesced into 1.0 second intervals, resulting in large send queues
to all clients. By reducing the amount of possible timers, one can
get a far better response rate and lower the perception of lag.
On the other side of the camp, some servers may want to increase
these values, which again isn't easily doable.
The global settings abm_interval and nodetimer_interval are set to
current values by default. I've tested with 0.2/0.5 type values
and noticed a greatly improved response and better scattering of
nodetimers, as well as enjoying not faceplanting into doors with
pressure plates anymore.
2016-03-02 08:14:26 +01:00
|
|
|
settings->setDefault("active_block_mgmt_interval", "2.0");
|
|
|
|
settings->setDefault("abm_interval", "1.0");
|
2020-08-13 01:02:07 +02:00
|
|
|
settings->setDefault("abm_time_budget", "0.2");
|
2017-02-09 08:00:37 +01:00
|
|
|
settings->setDefault("nodetimer_interval", "0.2");
|
2012-06-04 21:34:22 +02:00
|
|
|
settings->setDefault("ignore_world_load_errors", "false");
|
2012-12-14 12:30:17 +01:00
|
|
|
settings->setDefault("remote_media", "");
|
2015-10-13 09:57:44 +02:00
|
|
|
settings->setDefault("debug_log_level", "action");
|
2019-09-07 19:38:54 +02:00
|
|
|
settings->setDefault("debug_log_size_max", "50");
|
2020-05-14 19:26:15 +02:00
|
|
|
settings->setDefault("chat_log_level", "error");
|
2018-07-13 22:11:49 +02:00
|
|
|
settings->setDefault("emergequeue_limit_total", "512");
|
|
|
|
settings->setDefault("emergequeue_limit_diskonly", "64");
|
|
|
|
settings->setDefault("emergequeue_limit_generate", "64");
|
2019-03-05 23:58:38 +01:00
|
|
|
settings->setDefault("num_emerge_threads", "1");
|
2016-10-09 20:36:22 +02:00
|
|
|
settings->setDefault("secure.enable_security", "true");
|
2014-09-10 03:52:07 +02:00
|
|
|
settings->setDefault("secure.trusted_mods", "");
|
2016-02-18 11:38:47 +01:00
|
|
|
settings->setDefault("secure.http_mods", "");
|
2014-06-14 11:22:09 +02:00
|
|
|
|
2015-10-15 19:16:26 +02:00
|
|
|
// Physics
|
2013-02-15 22:18:19 +01:00
|
|
|
settings->setDefault("movement_acceleration_default", "3");
|
|
|
|
settings->setDefault("movement_acceleration_air", "2");
|
|
|
|
settings->setDefault("movement_acceleration_fast", "10");
|
2013-02-08 21:54:01 +01:00
|
|
|
settings->setDefault("movement_speed_walk", "4");
|
|
|
|
settings->setDefault("movement_speed_crouch", "1.35");
|
|
|
|
settings->setDefault("movement_speed_fast", "20");
|
2017-03-06 09:35:13 +01:00
|
|
|
settings->setDefault("movement_speed_climb", "3");
|
2013-02-08 21:54:01 +01:00
|
|
|
settings->setDefault("movement_speed_jump", "6.5");
|
|
|
|
settings->setDefault("movement_liquid_fluidity", "1");
|
|
|
|
settings->setDefault("movement_liquid_fluidity_smooth", "0.5");
|
|
|
|
settings->setDefault("movement_liquid_sink", "10");
|
|
|
|
settings->setDefault("movement_gravity", "9.81");
|
2013-03-12 22:18:45 +01:00
|
|
|
|
2015-10-15 19:16:26 +02:00
|
|
|
// Liquids
|
2014-12-23 00:25:18 +01:00
|
|
|
settings->setDefault("liquid_loop_max", "100000");
|
|
|
|
settings->setDefault("liquid_queue_purge_time", "0");
|
2013-02-24 15:39:07 +01:00
|
|
|
settings->setDefault("liquid_update", "1.0");
|
2013-02-28 01:59:05 +01:00
|
|
|
|
2015-10-15 19:16:26 +02:00
|
|
|
// Mapgen
|
2016-12-16 05:55:41 +01:00
|
|
|
settings->setDefault("mg_name", "v7");
|
2013-03-12 22:18:45 +01:00
|
|
|
settings->setDefault("water_level", "1");
|
2017-03-23 01:18:59 +01:00
|
|
|
settings->setDefault("mapgen_limit", "31000");
|
2013-01-06 20:40:24 +01:00
|
|
|
settings->setDefault("chunksize", "5");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("fixed_map_seed", "");
|
2020-11-04 00:39:03 +01:00
|
|
|
settings->setDefault("max_block_generate_distance", "10");
|
2015-10-15 19:16:26 +02:00
|
|
|
settings->setDefault("enable_mapgen_debug_info", "false");
|
2020-01-25 16:56:54 +01:00
|
|
|
Mapgen::setDefaultSettings(settings);
|
2013-06-23 16:07:10 +02:00
|
|
|
|
2015-10-15 19:16:26 +02:00
|
|
|
// Server list announcing
|
|
|
|
settings->setDefault("server_announce", "false");
|
|
|
|
settings->setDefault("server_url", "");
|
|
|
|
settings->setDefault("server_address", "");
|
|
|
|
settings->setDefault("server_name", "");
|
|
|
|
settings->setDefault("server_description", "");
|
2013-06-23 18:30:21 +02:00
|
|
|
|
2013-08-25 16:25:01 +02:00
|
|
|
settings->setDefault("high_precision_fpu", "true");
|
2017-04-07 07:14:39 +02:00
|
|
|
settings->setDefault("enable_console", "false");
|
2020-06-20 12:06:30 +02:00
|
|
|
settings->setDefault("screen_dpi", "72");
|
2013-09-07 18:06:00 +02:00
|
|
|
|
2018-11-24 06:21:29 +01:00
|
|
|
// Altered settings for macOS
|
2018-11-25 13:54:19 +01:00
|
|
|
#if defined(__MACH__) && defined(__APPLE__)
|
2018-11-24 06:21:29 +01:00
|
|
|
settings->setDefault("keymap_sneak", "KEY_SHIFT");
|
|
|
|
settings->setDefault("fps_max", "0");
|
|
|
|
#endif
|
|
|
|
|
2018-11-18 23:29:45 +01:00
|
|
|
// Altered settings for Android
|
2014-04-21 14:10:59 +02:00
|
|
|
#ifdef __ANDROID__
|
2017-06-03 22:02:07 +02:00
|
|
|
settings->setDefault("screen_w", "0");
|
|
|
|
settings->setDefault("screen_h", "0");
|
2014-04-21 14:10:59 +02:00
|
|
|
settings->setDefault("fullscreen", "true");
|
|
|
|
settings->setDefault("touchtarget", "true");
|
2020-06-20 12:06:30 +02:00
|
|
|
settings->setDefault("TMPFolder", porting::path_cache);
|
2014-04-21 14:10:59 +02:00
|
|
|
settings->setDefault("touchscreen_threshold","20");
|
2018-04-10 22:55:17 +02:00
|
|
|
settings->setDefault("fixed_virtual_joystick", "false");
|
2018-07-11 00:33:40 +02:00
|
|
|
settings->setDefault("virtual_joystick_triggers_aux", "false");
|
2014-04-21 14:10:59 +02:00
|
|
|
settings->setDefault("smooth_lighting", "false");
|
2018-07-22 11:16:32 +02:00
|
|
|
settings->setDefault("max_simultaneous_block_sends_per_client", "10");
|
|
|
|
settings->setDefault("emergequeue_limit_diskonly", "16");
|
|
|
|
settings->setDefault("emergequeue_limit_generate", "16");
|
|
|
|
settings->setDefault("max_block_generate_distance", "5");
|
2016-04-10 02:12:10 +02:00
|
|
|
settings->setDefault("enable_3d_clouds", "false");
|
|
|
|
settings->setDefault("fps_max", "30");
|
2020-10-03 18:33:51 +02:00
|
|
|
settings->setDefault("fps_max_unfocused", "10");
|
2016-04-10 02:12:10 +02:00
|
|
|
settings->setDefault("max_objects_per_block", "20");
|
|
|
|
settings->setDefault("sqlite_synchronous", "1");
|
|
|
|
settings->setDefault("server_map_save_interval", "15");
|
2018-07-22 11:16:32 +02:00
|
|
|
settings->setDefault("client_mapblock_limit", "1000");
|
|
|
|
settings->setDefault("active_block_range", "2");
|
|
|
|
settings->setDefault("viewing_range", "50");
|
2019-04-07 20:20:00 +02:00
|
|
|
settings->setDefault("leaves_style", "simple");
|
2018-11-18 23:29:45 +01:00
|
|
|
settings->setDefault("curl_verify_cert","false");
|
2014-04-21 14:10:59 +02:00
|
|
|
|
2018-11-18 23:29:45 +01:00
|
|
|
// Apply settings according to screen size
|
2020-06-20 12:06:30 +02:00
|
|
|
float x_inches = (float) porting::getDisplaySize().X /
|
|
|
|
(160.f * porting::getDisplayDensity());
|
2018-11-18 23:29:45 +01:00
|
|
|
|
|
|
|
if (x_inches < 3.7f) {
|
2015-01-07 00:10:46 +01:00
|
|
|
settings->setDefault("hud_scaling", "0.6");
|
2018-11-18 23:29:45 +01:00
|
|
|
settings->setDefault("font_size", "14");
|
|
|
|
settings->setDefault("mono_font_size", "14");
|
|
|
|
} else if (x_inches < 4.5f) {
|
2015-01-07 00:10:46 +01:00
|
|
|
settings->setDefault("hud_scaling", "0.7");
|
2018-11-18 23:29:45 +01:00
|
|
|
settings->setDefault("font_size", "14");
|
|
|
|
settings->setDefault("mono_font_size", "14");
|
|
|
|
} else if (x_inches < 6.0f) {
|
|
|
|
settings->setDefault("hud_scaling", "0.85");
|
|
|
|
settings->setDefault("font_size", "14");
|
|
|
|
settings->setDefault("mono_font_size", "14");
|
2014-04-21 14:10:59 +02:00
|
|
|
}
|
2018-11-18 23:29:45 +01:00
|
|
|
// Tablets >= 6.0 use non-Android defaults for these settings
|
2014-06-14 11:22:09 +02:00
|
|
|
#endif
|
|
|
|
}
|