2010-12-20 07:04:31 -05:00
|
|
|
/*
|
2013-02-24 12:40:43 -05:00
|
|
|
Minetest
|
2013-02-24 13:38:45 -05:00
|
|
|
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
2010-12-20 07:04:31 -05:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
2012-06-05 10:56:56 -04: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 07:04:31 -05: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 10:56:56 -04:00
|
|
|
GNU Lesser General Public License for more details.
|
2010-12-20 07:04:31 -05:00
|
|
|
|
2012-06-05 10:56:56 -04:00
|
|
|
You should have received a copy of the GNU Lesser General Public License along
|
2010-12-20 07:04:31 -05:00
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2011-10-12 06:53:38 -04:00
|
|
|
#include "settings.h"
|
2014-02-15 18:20:15 -05:00
|
|
|
#include "porting.h"
|
2013-02-03 07:19:09 -05:00
|
|
|
#include "filesys.h"
|
2013-08-04 14:18:56 -04:00
|
|
|
#include "config.h"
|
2014-06-14 05:22:09 -04:00
|
|
|
#include "constants.h"
|
|
|
|
#include "porting.h"
|
2010-12-20 07:04:31 -05:00
|
|
|
|
2011-10-12 06:53:38 -04:00
|
|
|
void set_default_settings(Settings *settings)
|
2010-12-20 07:04:31 -05:00
|
|
|
{
|
2011-02-07 18:12:55 -05:00
|
|
|
// Client and server
|
2011-05-14 08:43:26 -04:00
|
|
|
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("name", "");
|
2011-02-07 18:12:55 -05:00
|
|
|
|
2010-12-20 07:04:31 -05:00
|
|
|
// Client stuff
|
2013-11-28 15:43:06 -05:00
|
|
|
settings->setDefault("remote_port", "30000");
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("keymap_forward", "KEY_KEY_W");
|
|
|
|
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");
|
2011-11-26 22:01:38 -05:00
|
|
|
settings->setDefault("keymap_drop", "KEY_KEY_Q");
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("keymap_inventory", "KEY_KEY_I");
|
2011-10-17 13:40:55 -04:00
|
|
|
settings->setDefault("keymap_special1", "KEY_KEY_E");
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("keymap_chat", "KEY_KEY_T");
|
|
|
|
settings->setDefault("keymap_cmd", "/");
|
2011-12-03 03:01:14 -05:00
|
|
|
settings->setDefault("keymap_console", "KEY_F10");
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("keymap_rangeselect", "KEY_KEY_R");
|
|
|
|
settings->setDefault("keymap_freemove", "KEY_KEY_K");
|
|
|
|
settings->setDefault("keymap_fastmove", "KEY_KEY_J");
|
2012-12-09 07:34:16 -05:00
|
|
|
settings->setDefault("keymap_noclip", "KEY_KEY_H");
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("keymap_screenshot", "KEY_F12");
|
2012-01-31 18:56:30 -05:00
|
|
|
settings->setDefault("keymap_toggle_hud", "KEY_F1");
|
|
|
|
settings->setDefault("keymap_toggle_chat", "KEY_F2");
|
2011-10-18 14:08:31 -04:00
|
|
|
settings->setDefault("keymap_toggle_force_fog_off", "KEY_F3");
|
2011-11-02 12:13:56 -04:00
|
|
|
settings->setDefault("keymap_toggle_update_camera", "KEY_F4");
|
2012-01-31 18:56:30 -05:00
|
|
|
settings->setDefault("keymap_toggle_debug", "KEY_F5");
|
|
|
|
settings->setDefault("keymap_toggle_profiler", "KEY_F6");
|
2014-01-08 07:47:53 -05:00
|
|
|
settings->setDefault("keymap_camera_mode", "KEY_F7");
|
2012-03-12 15:27:29 -04:00
|
|
|
settings->setDefault("keymap_increase_viewing_range_min", "+");
|
|
|
|
settings->setDefault("keymap_decrease_viewing_range_min", "-");
|
2014-04-27 10:09:21 -04:00
|
|
|
settings->setDefault("3d_mode", "none");
|
|
|
|
settings->setDefault("3d_paralax_strength", "0.025");
|
2012-08-19 07:15:42 -04:00
|
|
|
settings->setDefault("aux1_descends", "false");
|
2013-01-04 14:00:49 -05:00
|
|
|
settings->setDefault("doubletap_jump", "false");
|
2013-01-07 12:18:16 -05:00
|
|
|
settings->setDefault("always_fly_fast", "true");
|
2013-12-15 09:30:02 -05:00
|
|
|
settings->setDefault("directional_colored_fog", "true");
|
2012-02-18 11:51:19 -05:00
|
|
|
|
2011-05-14 08:43:26 -04:00
|
|
|
// Some (temporary) keys for debugging
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("keymap_print_debug_stacks", "KEY_KEY_P");
|
2012-03-12 15:27:29 -04: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 08:43:26 -04:00
|
|
|
|
2012-01-31 18:56:30 -05:00
|
|
|
// Show debug info by default?
|
|
|
|
#ifdef NDEBUG
|
|
|
|
settings->setDefault("show_debug", "false");
|
|
|
|
#else
|
|
|
|
settings->setDefault("show_debug", "true");
|
|
|
|
#endif
|
|
|
|
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("wanted_fps", "30");
|
|
|
|
settings->setDefault("fps_max", "60");
|
2014-01-06 10:37:23 -05:00
|
|
|
settings->setDefault("pause_fps_max", "20");
|
2012-02-02 19:24:36 -05:00
|
|
|
// A bit more than the server will send around the player, to make fog blend well
|
2012-12-06 08:48:59 -05:00
|
|
|
settings->setDefault("viewing_range_nodes_max", "240");
|
2012-03-27 12:57:24 -04:00
|
|
|
settings->setDefault("viewing_range_nodes_min", "35");
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("screenW", "800");
|
|
|
|
settings->setDefault("screenH", "600");
|
2012-04-03 07:59:02 -04:00
|
|
|
settings->setDefault("fullscreen", "false");
|
|
|
|
settings->setDefault("fullscreen_bpp", "24");
|
|
|
|
settings->setDefault("fsaa", "0");
|
|
|
|
settings->setDefault("vsync", "false");
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("address", "");
|
|
|
|
settings->setDefault("random_input", "false");
|
|
|
|
settings->setDefault("client_unload_unused_data_timeout", "600");
|
|
|
|
settings->setDefault("enable_fog", "true");
|
|
|
|
settings->setDefault("fov", "72");
|
|
|
|
settings->setDefault("view_bobbing", "true");
|
|
|
|
settings->setDefault("new_style_water", "false");
|
2012-03-28 07:10:54 -04:00
|
|
|
settings->setDefault("new_style_leaves", "true");
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("smooth_lighting", "true");
|
|
|
|
settings->setDefault("texture_path", "");
|
2012-03-18 21:59:12 -04:00
|
|
|
settings->setDefault("shader_path", "");
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("video_driver", "opengl");
|
|
|
|
settings->setDefault("free_move", "false");
|
2012-12-09 07:34:16 -05:00
|
|
|
settings->setDefault("noclip", "false");
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("continuous_forward", "false");
|
|
|
|
settings->setDefault("fast_move", "false");
|
|
|
|
settings->setDefault("invert_mouse", "false");
|
|
|
|
settings->setDefault("enable_clouds", "true");
|
|
|
|
settings->setDefault("screenshot_path", ".");
|
2011-10-15 09:32:24 -04:00
|
|
|
settings->setDefault("view_bobbing_amount", "1.0");
|
2013-04-23 16:19:36 -04:00
|
|
|
settings->setDefault("fall_bobbing_amount", "0.0");
|
2012-03-28 07:10:54 -04:00
|
|
|
settings->setDefault("enable_3d_clouds", "true");
|
2012-10-28 21:35:19 -04:00
|
|
|
settings->setDefault("cloud_height", "120");
|
2013-03-05 17:23:03 -05:00
|
|
|
settings->setDefault("menu_clouds", "true");
|
2011-11-03 17:06:57 -04:00
|
|
|
settings->setDefault("opaque_water", "false");
|
2011-12-03 03:01:14 -05:00
|
|
|
settings->setDefault("console_color", "(0,0,0)");
|
|
|
|
settings->setDefault("console_alpha", "200");
|
2012-12-26 16:35:48 -05:00
|
|
|
settings->setDefault("selectionbox_color", "(0,0,0)");
|
|
|
|
settings->setDefault("crosshair_color", "(255,255,255)");
|
|
|
|
settings->setDefault("crosshair_alpha", "255");
|
2014-04-05 08:12:36 -04:00
|
|
|
settings->setDefault("gui_scaling", "1.0");
|
2013-04-14 13:53:00 -04:00
|
|
|
settings->setDefault("mouse_sensitivity", "0.2");
|
2012-04-06 08:30:36 -04:00
|
|
|
settings->setDefault("enable_sound", "true");
|
|
|
|
settings->setDefault("sound_volume", "0.8");
|
2012-06-16 15:37:20 -04:00
|
|
|
settings->setDefault("desynchronize_mapblock_texture_animation", "true");
|
2014-04-05 08:12:36 -04:00
|
|
|
settings->setDefault("hud_hotbar_max_width","1.0");
|
2012-03-11 14:45:14 -04:00
|
|
|
|
2012-11-27 02:38:21 -05:00
|
|
|
settings->setDefault("mip_map", "false");
|
|
|
|
settings->setDefault("anisotropic_filter", "false");
|
|
|
|
settings->setDefault("bilinear_filter", "false");
|
|
|
|
settings->setDefault("trilinear_filter", "false");
|
2012-12-02 13:43:55 -05:00
|
|
|
settings->setDefault("preload_item_visuals", "true");
|
2013-07-03 20:36:32 -04:00
|
|
|
settings->setDefault("enable_bumpmapping", "false");
|
2013-12-03 11:21:40 -05:00
|
|
|
settings->setDefault("enable_parallax_occlusion", "false");
|
2014-03-20 20:32:00 -04:00
|
|
|
settings->setDefault("generate_normalmaps", "false");
|
|
|
|
settings->setDefault("normalmaps_strength", "0.6");
|
|
|
|
settings->setDefault("normalmaps_smooth", "1");
|
|
|
|
settings->setDefault("parallax_occlusion_scale", "0.06");
|
|
|
|
settings->setDefault("parallax_occlusion_bias", "0.03");
|
2013-12-03 11:21:40 -05: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");
|
2013-07-07 15:53:40 -04:00
|
|
|
settings->setDefault("enable_shaders", "true");
|
2013-01-04 09:19:16 -05:00
|
|
|
settings->setDefault("repeat_rightclick_time", "0.25");
|
2012-12-31 13:33:36 -05:00
|
|
|
settings->setDefault("enable_particles", "true");
|
2012-11-27 02:38:21 -05:00
|
|
|
|
Rewrite client media download and support hash-based remote download
Move most of the media-related code in client.cpp into a new class
ClientMediaDownloader (clientmedia.cpp, clientmedia.h). Among other
things, this class does the following things:
- Download [remote_server][sha1] instead of [remote_server][name]. This
is to support servers that provide the same file name with different
contents.
- Initially fetch [remote_server]index.mth. This file should follow the
Minetest Hashset format (currently version 1) and contain a list of SHA1
hashes that exist on the server.
- The list of needed SHA1s is uploaded (via HTTP POST) when index.mth is
requested, so servers can optionally narrow down the list to the needs
of the client.
- If index.mth is missing (HTTP response code 404), we enter compat mode,
fetching [remote_server][name] as before this commit.
- remote_server can now contain multiple servers, separated by commas.
The downloader code attempts to split requests between the different
servers, as permitted by each server's index.mth. If one server claims
to have a file but actually doesn't (or something fails), we ask a
different server that also claims to have it.
- As before, when none of the remote servers provide a particular
file, we download it via the conventional method, i.e. using
the minetest protocol: TOSERVER_REQUEST_MEDIA / TOCLIENT_MEDIA.
- Bugfix: Every downloaded file's SHA1 is now verified against the SHA1
announced by the minetest server (before loading it and inserting it
into the file cache).
- Bugfix: Only send TOSERVER_RECEIVED_MEDIA when we actually have all
media. This should fix #863.
2013-08-28 23:22:18 -04:00
|
|
|
settings->setDefault("curl_timeout", "5000");
|
2013-08-28 23:04:56 -04:00
|
|
|
settings->setDefault("curl_parallel_limit", "8");
|
2012-12-14 06:30:17 -05:00
|
|
|
|
2014-04-25 19:15:46 -04:00
|
|
|
settings->setDefault("enable_remote_media_server", "true");
|
|
|
|
|
2013-02-21 17:00:44 -05:00
|
|
|
settings->setDefault("serverlist_url", "servers.minetest.net");
|
2012-12-25 06:20:51 -05:00
|
|
|
settings->setDefault("serverlist_file", "favoriteservers.txt");
|
2013-02-21 17:00:44 -05:00
|
|
|
settings->setDefault("server_announce", "false");
|
|
|
|
settings->setDefault("server_url", "");
|
|
|
|
settings->setDefault("server_address", "");
|
|
|
|
settings->setDefault("server_name", "");
|
|
|
|
settings->setDefault("server_description", "");
|
2012-12-25 06:20:51 -05:00
|
|
|
|
2013-08-04 14:18:56 -04:00
|
|
|
#if USE_FREETYPE
|
|
|
|
settings->setDefault("freetype", "true");
|
2013-02-03 07:19:09 -05:00
|
|
|
settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "liberationsans.ttf"));
|
2013-12-12 12:47:54 -05:00
|
|
|
settings->setDefault("font_shadow", "1");
|
2013-12-12 15:02:09 -05:00
|
|
|
settings->setDefault("font_shadow_alpha", "128");
|
2013-02-03 07:19:09 -05:00
|
|
|
settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "liberationmono.ttf"));
|
2013-09-07 12:06:00 -04:00
|
|
|
settings->setDefault("fallback_font_path", porting::getDataPath("fonts" DIR_DELIM "DroidSansFallbackFull.ttf"));
|
2014-06-14 05:22:09 -04:00
|
|
|
|
2013-12-12 12:47:54 -05:00
|
|
|
settings->setDefault("fallback_font_shadow", "1");
|
2013-12-12 15:02:09 -05:00
|
|
|
settings->setDefault("fallback_font_shadow_alpha", "128");
|
2013-08-04 14:18:56 -04:00
|
|
|
#else
|
|
|
|
settings->setDefault("freetype", "false");
|
|
|
|
settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "fontlucida.png"));
|
2013-08-07 07:41:00 -04:00
|
|
|
settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "fontdejavusansmono.png"));
|
2013-08-04 14:18:56 -04:00
|
|
|
#endif
|
2013-02-03 07:19:09 -05:00
|
|
|
|
2010-12-20 07:04:31 -05:00
|
|
|
// Server stuff
|
2011-10-15 08:02:28 -04:00
|
|
|
// "map-dir" doesn't exist by default.
|
2014-01-06 14:05:28 -05:00
|
|
|
settings->setDefault("workaround_window_size","5");
|
|
|
|
settings->setDefault("max_packets_per_iteration","1024");
|
2013-11-28 15:43:06 -05:00
|
|
|
settings->setDefault("port", "30000");
|
2014-02-05 15:24:46 -05:00
|
|
|
settings->setDefault("bind_address","");
|
2012-03-25 13:29:56 -04:00
|
|
|
settings->setDefault("default_game", "minetest");
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("motd", "");
|
2013-09-17 15:28:21 -04:00
|
|
|
settings->setDefault("max_users", "15");
|
2012-11-26 17:26:19 -05:00
|
|
|
settings->setDefault("strict_protocol_version_checking", "false");
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("creative_mode", "false");
|
|
|
|
settings->setDefault("enable_damage", "true");
|
2011-10-16 04:52:33 -04:00
|
|
|
settings->setDefault("only_peaceful_mobs", "false");
|
2011-10-15 08:02:28 -04:00
|
|
|
settings->setDefault("fixed_map_seed", "");
|
2011-11-25 20:49:46 -05:00
|
|
|
settings->setDefault("give_initial_stuff", "false");
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("default_password", "");
|
2012-03-31 10:48:46 -04:00
|
|
|
settings->setDefault("default_privs", "interact, shout");
|
2011-12-02 04:22:09 -05:00
|
|
|
settings->setDefault("unlimited_player_transfer_distance", "true");
|
2011-12-02 04:25:47 -05:00
|
|
|
settings->setDefault("enable_pvp", "true");
|
2012-06-06 19:11:28 -04:00
|
|
|
settings->setDefault("disallow_empty_password", "false");
|
2012-07-21 07:38:49 -04:00
|
|
|
settings->setDefault("disable_anticheat", "false");
|
2012-07-27 20:08:09 -04:00
|
|
|
settings->setDefault("enable_rollback_recording", "false");
|
2014-04-29 11:47:34 -04:00
|
|
|
#ifdef NDEBUG
|
|
|
|
settings->setDefault("deprecated_lua_api_handling", "legacy");
|
|
|
|
#else
|
|
|
|
settings->setDefault("deprecated_lua_api_handling", "log");
|
|
|
|
#endif
|
2011-10-15 08:02:28 -04:00
|
|
|
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("profiler_print_interval", "0");
|
|
|
|
settings->setDefault("enable_mapgen_debug_info", "false");
|
2011-10-14 19:28:57 -04:00
|
|
|
settings->setDefault("active_object_send_range_blocks", "3");
|
2011-10-17 17:41:17 -04:00
|
|
|
settings->setDefault("active_block_range", "2");
|
2011-10-12 06:53:38 -04:00
|
|
|
//settings->setDefault("max_simultaneous_block_sends_per_client", "1");
|
2011-06-25 20:14:52 -04:00
|
|
|
// This causes frametime jitter on client side, or does it?
|
2014-02-08 18:32:12 -05:00
|
|
|
settings->setDefault("max_simultaneous_block_sends_per_client", "10");
|
|
|
|
settings->setDefault("max_simultaneous_block_sends_server_total", "40");
|
2012-02-02 19:24:36 -05:00
|
|
|
settings->setDefault("max_block_send_distance", "9");
|
2012-01-31 13:27:00 -05:00
|
|
|
settings->setDefault("max_block_generate_distance", "7");
|
2013-06-02 09:35:29 -04:00
|
|
|
settings->setDefault("max_clearobjects_extra_loaded_blocks", "4096");
|
2012-03-16 10:34:30 -04:00
|
|
|
settings->setDefault("time_send_interval", "5");
|
2012-03-29 04:41:41 -04:00
|
|
|
settings->setDefault("time_speed", "72");
|
2013-07-27 14:34:30 -04:00
|
|
|
settings->setDefault("year_days", "30");
|
2011-12-01 18:20:54 -05:00
|
|
|
settings->setDefault("server_unload_unused_data_timeout", "29");
|
2013-08-04 08:14:21 -04:00
|
|
|
settings->setDefault("max_objects_per_block", "49");
|
2011-12-01 18:20:54 -05:00
|
|
|
settings->setDefault("server_map_save_interval", "5.3");
|
2013-09-16 18:09:28 -04:00
|
|
|
settings->setDefault("sqlite_synchronous", "2");
|
2011-10-12 06:53:38 -04:00
|
|
|
settings->setDefault("full_block_send_enable_min_time_from_building", "2.0");
|
2012-11-26 15:31:21 -05:00
|
|
|
settings->setDefault("dedicated_server_step", "0.1");
|
2012-06-04 15:34:22 -04:00
|
|
|
settings->setDefault("ignore_world_load_errors", "false");
|
2012-12-14 06:30:17 -05:00
|
|
|
settings->setDefault("remote_media", "");
|
2013-02-27 19:59:05 -05:00
|
|
|
settings->setDefault("debug_log_level", "2");
|
2013-02-14 20:36:58 -05:00
|
|
|
settings->setDefault("emergequeue_limit_total", "256");
|
2014-02-08 18:32:12 -05:00
|
|
|
settings->setDefault("emergequeue_limit_diskonly", "32");
|
|
|
|
settings->setDefault("emergequeue_limit_generate", "32");
|
2013-02-23 22:06:16 -05:00
|
|
|
settings->setDefault("num_emerge_threads", "1");
|
2014-06-14 05:22:09 -04:00
|
|
|
|
2013-02-08 15:54:01 -05:00
|
|
|
// physics stuff
|
2013-02-15 16:18:19 -05:00
|
|
|
settings->setDefault("movement_acceleration_default", "3");
|
|
|
|
settings->setDefault("movement_acceleration_air", "2");
|
|
|
|
settings->setDefault("movement_acceleration_fast", "10");
|
2013-02-08 15:54:01 -05:00
|
|
|
settings->setDefault("movement_speed_walk", "4");
|
|
|
|
settings->setDefault("movement_speed_crouch", "1.35");
|
|
|
|
settings->setDefault("movement_speed_fast", "20");
|
|
|
|
settings->setDefault("movement_speed_climb", "2");
|
|
|
|
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 17:18:45 -04:00
|
|
|
|
2013-02-27 19:59:05 -05:00
|
|
|
//liquid stuff
|
2013-11-17 15:05:14 -05:00
|
|
|
settings->setDefault("liquid_loop_max", "10000");
|
2013-02-24 09:39:07 -05:00
|
|
|
settings->setDefault("liquid_update", "1.0");
|
2013-02-27 19:59:05 -05:00
|
|
|
|
|
|
|
//mapgen stuff
|
|
|
|
settings->setDefault("mg_name", "v6");
|
2013-03-12 17:18:45 -04:00
|
|
|
settings->setDefault("water_level", "1");
|
2013-01-06 14:40:24 -05:00
|
|
|
settings->setDefault("chunksize", "5");
|
2014-02-08 17:50:26 -05:00
|
|
|
settings->setDefault("mg_flags", "");
|
2013-06-23 10:07:10 -04:00
|
|
|
|
|
|
|
settings->setDefault("mgmath_generator", "mandelbox");
|
|
|
|
|
2013-07-15 17:36:44 -04:00
|
|
|
|
2013-06-23 03:31:22 -04:00
|
|
|
// IPv6
|
|
|
|
settings->setDefault("enable_ipv6", "true");
|
|
|
|
settings->setDefault("ipv6_server", "false");
|
2013-06-23 12:30:21 -04:00
|
|
|
|
2014-04-27 17:55:49 -04:00
|
|
|
settings->setDefault("main_menu_path", "");
|
|
|
|
settings->setDefault("main_menu_mod_mgr", "1");
|
|
|
|
settings->setDefault("main_menu_game_mgr", "0");
|
2013-07-22 16:26:48 -04:00
|
|
|
settings->setDefault("modstore_download_url", "https://forum.minetest.net/media/");
|
|
|
|
settings->setDefault("modstore_listmods_url", "https://forum.minetest.net/mmdb/mods/");
|
|
|
|
settings->setDefault("modstore_details_url", "https://forum.minetest.net/mmdb/mod/*/");
|
2013-06-23 12:30:21 -04:00
|
|
|
|
2013-08-25 10:25:01 -04:00
|
|
|
settings->setDefault("high_precision_fpu", "true");
|
2013-09-07 12:06:00 -04:00
|
|
|
|
|
|
|
settings->setDefault("language", "");
|
2010-12-20 07:04:31 -05:00
|
|
|
}
|
|
|
|
|
2014-06-14 05:22:09 -04:00
|
|
|
void late_init_default_settings(Settings* settings)
|
|
|
|
{
|
|
|
|
#ifndef SERVER
|
|
|
|
std::stringstream fontsize;
|
|
|
|
fontsize << floor(
|
|
|
|
DEFAULT_FONT_SIZE *
|
|
|
|
porting::getDisplayDensity() *
|
|
|
|
settings->getFloat("gui_scaling")
|
|
|
|
);
|
|
|
|
|
|
|
|
settings->setDefault("font_size", fontsize.str());
|
|
|
|
settings->setDefault("mono_font_size", fontsize.str());
|
|
|
|
settings->setDefault("fallback_font_size", fontsize.str());
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2013-03-21 15:42:23 -04:00
|
|
|
void override_default_settings(Settings *settings, Settings *from)
|
|
|
|
{
|
|
|
|
std::vector<std::string> names = from->getNames();
|
|
|
|
for(size_t i=0; i<names.size(); i++){
|
|
|
|
const std::string &name = names[i];
|
|
|
|
settings->setDefault(name, from->get(name));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|