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.
|
|
|
|
*/
|
|
|
|
|
2011-10-12 12:53:38 +02:00
|
|
|
#include "settings.h"
|
2013-02-03 13:19:09 +01:00
|
|
|
#include "filesys.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
|
2011-05-14 14:43:26 +02:00
|
|
|
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("port", "");
|
|
|
|
settings->setDefault("name", "");
|
2011-02-08 00:12:55 +01:00
|
|
|
|
2010-12-20 13:04:31 +01:00
|
|
|
// Client stuff
|
2011-05-14 14:43:26 +02:00
|
|
|
|
2011-10-12 12:53:38 +02: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-27 04:01:38 +01:00
|
|
|
settings->setDefault("keymap_drop", "KEY_KEY_Q");
|
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", "/");
|
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");
|
|
|
|
settings->setDefault("keymap_fastmove", "KEY_KEY_J");
|
2012-12-09 13:34:16 +01:00
|
|
|
settings->setDefault("keymap_noclip", "KEY_KEY_H");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("keymap_screenshot", "KEY_F12");
|
2012-02-01 00:56:30 +01:00
|
|
|
settings->setDefault("keymap_toggle_hud", "KEY_F1");
|
|
|
|
settings->setDefault("keymap_toggle_chat", "KEY_F2");
|
2011-10-18 20:08:31 +02:00
|
|
|
settings->setDefault("keymap_toggle_force_fog_off", "KEY_F3");
|
2011-11-02 17:13:56 +01:00
|
|
|
settings->setDefault("keymap_toggle_update_camera", "KEY_F4");
|
2012-02-01 00:56:30 +01:00
|
|
|
settings->setDefault("keymap_toggle_debug", "KEY_F5");
|
|
|
|
settings->setDefault("keymap_toggle_profiler", "KEY_F6");
|
2012-03-12 20:27:29 +01:00
|
|
|
settings->setDefault("keymap_increase_viewing_range_min", "+");
|
|
|
|
settings->setDefault("keymap_decrease_viewing_range_min", "-");
|
2012-02-18 17:51:19 +01:00
|
|
|
settings->setDefault("anaglyph", "false");
|
2012-02-18 17:52:04 +01:00
|
|
|
settings->setDefault("anaglyph_strength", "0.1");
|
2012-08-19 13:15:42 +02:00
|
|
|
settings->setDefault("aux1_descends", "false");
|
2013-01-04 20:00:49 +01:00
|
|
|
settings->setDefault("doubletap_jump", "false");
|
2013-01-07 18:18:16 +01:00
|
|
|
settings->setDefault("always_fly_fast", "true");
|
2012-02-18 17:51:19 +01:00
|
|
|
|
2011-05-14 14:43:26 +02:00
|
|
|
// Some (temporary) keys for debugging
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("keymap_print_debug_stacks", "KEY_KEY_P");
|
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
|
|
|
|
2012-02-01 00:56:30 +01:00
|
|
|
// Show debug info by default?
|
|
|
|
#ifdef NDEBUG
|
|
|
|
settings->setDefault("show_debug", "false");
|
|
|
|
#else
|
|
|
|
settings->setDefault("show_debug", "true");
|
|
|
|
#endif
|
|
|
|
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("wanted_fps", "30");
|
|
|
|
settings->setDefault("fps_max", "60");
|
2012-02-03 01:24:36 +01:00
|
|
|
// A bit more than the server will send around the player, to make fog blend well
|
2012-12-06 14:48:59 +01:00
|
|
|
settings->setDefault("viewing_range_nodes_max", "240");
|
2012-03-27 18:57:24 +02:00
|
|
|
settings->setDefault("viewing_range_nodes_min", "35");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("screenW", "800");
|
|
|
|
settings->setDefault("screenH", "600");
|
2012-04-03 13:59:02 +02:00
|
|
|
settings->setDefault("fullscreen", "false");
|
|
|
|
settings->setDefault("fullscreen_bpp", "24");
|
|
|
|
settings->setDefault("fsaa", "0");
|
|
|
|
settings->setDefault("vsync", "false");
|
2011-10-12 12:53:38 +02: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 13:10:54 +02:00
|
|
|
settings->setDefault("new_style_leaves", "true");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("smooth_lighting", "true");
|
2013-02-28 01:59:05 +01:00
|
|
|
settings->setDefault("enable_texture_atlas", "false");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("texture_path", "");
|
2012-03-19 02:59:12 +01:00
|
|
|
settings->setDefault("shader_path", "");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("video_driver", "opengl");
|
|
|
|
settings->setDefault("free_move", "false");
|
2012-12-09 13:34:16 +01:00
|
|
|
settings->setDefault("noclip", "false");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("continuous_forward", "false");
|
|
|
|
settings->setDefault("fast_move", "false");
|
|
|
|
settings->setDefault("invert_mouse", "false");
|
|
|
|
settings->setDefault("enable_farmesh", "false");
|
|
|
|
settings->setDefault("enable_clouds", "true");
|
|
|
|
settings->setDefault("screenshot_path", ".");
|
2011-10-15 15:32:24 +02:00
|
|
|
settings->setDefault("view_bobbing_amount", "1.0");
|
2012-03-28 13:10:54 +02:00
|
|
|
settings->setDefault("enable_3d_clouds", "true");
|
2012-10-29 02:35:19 +01:00
|
|
|
settings->setDefault("cloud_height", "120");
|
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");
|
2011-12-03 09:01:14 +01:00
|
|
|
settings->setDefault("console_color", "(0,0,0)");
|
|
|
|
settings->setDefault("console_alpha", "200");
|
2012-12-26 22:35:48 +01:00
|
|
|
settings->setDefault("selectionbox_color", "(0,0,0)");
|
|
|
|
settings->setDefault("crosshair_color", "(255,255,255)");
|
|
|
|
settings->setDefault("crosshair_alpha", "255");
|
2012-04-06 14:30:36 +02:00
|
|
|
settings->setDefault("enable_sound", "true");
|
|
|
|
settings->setDefault("sound_volume", "0.8");
|
2012-06-16 21:37:20 +02:00
|
|
|
settings->setDefault("desynchronize_mapblock_texture_animation", "true");
|
2012-03-11 19:45:14 +01:00
|
|
|
|
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");
|
2012-12-02 19:43:55 +01:00
|
|
|
settings->setDefault("preload_item_visuals", "true");
|
2012-12-01 23:14:27 +01:00
|
|
|
settings->setDefault("enable_shaders", "2");
|
2013-01-04 15:19:16 +01:00
|
|
|
settings->setDefault("repeat_rightclick_time", "0.25");
|
2012-12-31 19:33:36 +01:00
|
|
|
settings->setDefault("enable_particles", "true");
|
2012-11-27 08:38:21 +01:00
|
|
|
|
2012-12-14 12:30:17 +01:00
|
|
|
settings->setDefault("media_fetch_threads", "8");
|
|
|
|
|
2013-02-21 23:00:44 +01:00
|
|
|
settings->setDefault("serverlist_url", "servers.minetest.net");
|
2012-12-25 12:20:51 +01:00
|
|
|
settings->setDefault("serverlist_file", "favoriteservers.txt");
|
2013-02-21 23:00:44 +01: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 12:20:51 +01:00
|
|
|
|
2013-02-03 13:19:09 +01:00
|
|
|
settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "liberationsans.ttf"));
|
|
|
|
settings->setDefault("font_size", "13");
|
|
|
|
settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "liberationmono.ttf"));
|
|
|
|
settings->setDefault("mono_font_size", "13");
|
|
|
|
|
2010-12-20 13:04:31 +01:00
|
|
|
// Server stuff
|
2011-10-15 14:02:28 +02:00
|
|
|
// "map-dir" doesn't exist by default.
|
2012-03-25 19:29:56 +02:00
|
|
|
settings->setDefault("default_game", "minetest");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("motd", "");
|
2012-01-24 11:02:40 +01:00
|
|
|
settings->setDefault("max_users", "100");
|
2012-11-26 23:26:19 +01:00
|
|
|
settings->setDefault("strict_protocol_version_checking", "false");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("creative_mode", "false");
|
|
|
|
settings->setDefault("enable_damage", "true");
|
2011-10-16 10:52:33 +02:00
|
|
|
settings->setDefault("only_peaceful_mobs", "false");
|
2011-10-15 14:02:28 +02:00
|
|
|
settings->setDefault("fixed_map_seed", "");
|
2011-11-26 02:49:46 +01:00
|
|
|
settings->setDefault("give_initial_stuff", "false");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("default_password", "");
|
2012-03-31 16:48:46 +02:00
|
|
|
settings->setDefault("default_privs", "interact, shout");
|
2011-12-02 10:22:09 +01:00
|
|
|
settings->setDefault("unlimited_player_transfer_distance", "true");
|
2011-12-02 10:25:47 +01:00
|
|
|
settings->setDefault("enable_pvp", "true");
|
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");
|
2011-10-15 14:02:28 +02:00
|
|
|
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("profiler_print_interval", "0");
|
|
|
|
settings->setDefault("enable_mapgen_debug_info", "false");
|
2011-10-15 01:28:57 +02:00
|
|
|
settings->setDefault("active_object_send_range_blocks", "3");
|
2011-10-17 23:41:17 +02:00
|
|
|
settings->setDefault("active_block_range", "2");
|
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?
|
2012-03-16 15:34:30 +01:00
|
|
|
settings->setDefault("max_simultaneous_block_sends_per_client", "4");
|
|
|
|
settings->setDefault("max_simultaneous_block_sends_server_total", "20");
|
2012-02-03 01:24:36 +01:00
|
|
|
settings->setDefault("max_block_send_distance", "9");
|
2012-01-31 19:27:00 +01:00
|
|
|
settings->setDefault("max_block_generate_distance", "7");
|
2012-03-16 15:34:30 +01:00
|
|
|
settings->setDefault("time_send_interval", "5");
|
2012-03-29 10:41:41 +02:00
|
|
|
settings->setDefault("time_speed", "72");
|
2011-12-02 00:20:54 +01:00
|
|
|
settings->setDefault("server_unload_unused_data_timeout", "29");
|
|
|
|
settings->setDefault("server_map_save_interval", "5.3");
|
2011-10-12 12:53:38 +02:00
|
|
|
settings->setDefault("full_block_send_enable_min_time_from_building", "2.0");
|
2012-11-26 21:31:21 +01:00
|
|
|
settings->setDefault("dedicated_server_step", "0.1");
|
2012-06-04 21:34:22 +02:00
|
|
|
settings->setDefault("ignore_world_load_errors", "false");
|
2012-11-27 08:38:21 +01:00
|
|
|
settings->setDefault("congestion_control_aim_rtt", "0.2");
|
|
|
|
settings->setDefault("congestion_control_max_rate", "400");
|
|
|
|
settings->setDefault("congestion_control_min_rate", "10");
|
2012-12-14 12:30:17 +01:00
|
|
|
settings->setDefault("remote_media", "");
|
2013-02-28 01:59:05 +01:00
|
|
|
settings->setDefault("debug_log_level", "2");
|
2013-02-15 02:36:58 +01:00
|
|
|
settings->setDefault("emergequeue_limit_total", "256");
|
2013-02-21 23:44:14 +01:00
|
|
|
settings->setDefault("emergequeue_limit_diskonly", "");
|
|
|
|
settings->setDefault("emergequeue_limit_generate", "");
|
2013-02-24 04:06:16 +01:00
|
|
|
settings->setDefault("num_emerge_threads", "1");
|
2013-02-15 02:36:58 +01:00
|
|
|
|
2013-02-08 21:54:01 +01:00
|
|
|
// physics stuff
|
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");
|
|
|
|
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 22:18:45 +01:00
|
|
|
|
2013-02-28 01:59:05 +01:00
|
|
|
//liquid stuff
|
2013-02-24 15:39:07 +01:00
|
|
|
settings->setDefault("liquid_finite", "false");
|
|
|
|
settings->setDefault("liquid_update", "1.0");
|
2013-03-12 22:18:45 +01:00
|
|
|
settings->setDefault("liquid_relax", "2");
|
2013-02-24 15:39:07 +01:00
|
|
|
settings->setDefault("liquid_fast_flood", "1");
|
2013-03-12 22:18:45 +01:00
|
|
|
settings->setDefault("underground_springs", "1");
|
2013-02-28 01:59:05 +01:00
|
|
|
|
|
|
|
//mapgen stuff
|
|
|
|
settings->setDefault("mg_name", "v6");
|
2013-03-12 22:18:45 +01:00
|
|
|
settings->setDefault("water_level", "1");
|
2013-01-06 20:40:24 +01:00
|
|
|
settings->setDefault("chunksize", "5");
|
2013-02-05 21:01:33 +01:00
|
|
|
settings->setDefault("mg_flags", "trees, caves, v6_biome_blend");
|
2013-01-06 20:40:24 +01:00
|
|
|
settings->setDefault("mgv6_freq_desert", "0.45");
|
|
|
|
settings->setDefault("mgv6_freq_beach", "0.15");
|
|
|
|
|
2013-03-16 22:06:11 +01:00
|
|
|
settings->setDefault("mgv6_np_terrain_base", "-4, 20, (250, 250, 250), 82341, 5, 0.6");
|
2013-01-06 20:40:24 +01:00
|
|
|
settings->setDefault("mgv6_np_terrain_higher", "20, 16, (500, 500, 500), 85039, 5, 0.6");
|
|
|
|
settings->setDefault("mgv6_np_steepness", "0.85, 0.5, (125, 125, 125), -932, 5, 0.7");
|
|
|
|
settings->setDefault("mgv6_np_height_select", "0.5, 1, (250, 250, 250), 4213, 5, 0.69");
|
|
|
|
settings->setDefault("mgv6_np_mud", "4, 2, (200, 200, 200), 91013, 3, 0.55");
|
|
|
|
settings->setDefault("mgv6_np_beach", "0, 1, (250, 250, 250), 59420, 3, 0.50");
|
|
|
|
settings->setDefault("mgv6_np_biome", "0, 1, (250, 250, 250), 9130, 3, 0.50");
|
|
|
|
settings->setDefault("mgv6_np_cave", "6, 6, (250, 250, 250), 34329, 3, 0.50");
|
2013-03-16 22:06:11 +01:00
|
|
|
settings->setDefault("mgv6_np_humidity", "0.5, 0.5, (500, 500, 500), 72384, 4, 0.66");
|
|
|
|
settings->setDefault("mgv6_np_trees", "0, 1, (125, 125, 125), 2, 4, 0.66");
|
|
|
|
settings->setDefault("mgv6_np_apple_trees", "0, 1, (100, 100, 100), 342902, 3, 0.45");
|
2013-01-06 20:40:24 +01:00
|
|
|
|
|
|
|
settings->setDefault("mgv7_np_terrain", "10, 12, (350, 350, 350), 82341, 5, 0.6");
|
|
|
|
settings->setDefault("mgv7_np_bgroup", "0.5, 0.3125, (350, 350, 350), 5923, 2, 0.6");
|
|
|
|
settings->setDefault("mgv7_np_heat", "25, 50, (500, 500, 500), 35293, 1, 0");
|
|
|
|
settings->setDefault("mgv7_np_humidity", "50, 31.25, (750, 750, 750), 12094, 2, 0.6");
|
2013-03-12 21:41:14 +01:00
|
|
|
|
|
|
|
settings->setDefault("mgindev_np_terrain_base", "-4, 20, (250.0, 250, 250), 82341, 5, 0.6, 10");
|
|
|
|
settings->setDefault("mgindev_np_terrain_higher", "20, 16, (500, 500, 500), 85039, 5, 0.6, 10");
|
|
|
|
settings->setDefault("mgindev_np_steepness", "0.85, 0.5, (125, 125, 125), -932, 5, 0.7, 10");
|
|
|
|
settings->setDefault("mgindev_np_mud", "4, 2, (200, 200, 200), 91013, 3, 0.55, 1");
|
|
|
|
|
2010-12-20 13:04:31 +01:00
|
|
|
}
|
|
|
|
|
2013-03-21 20:42:23 +01: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));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|