clientobject: add null checks
[waspsaliva.git] / src / defaultsettings.cpp
blob64e5af3a7e03f9e45fbaff8459189be630187f58
1 /*
2 Minetest
3 Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include <IrrCompileConfig.h>
21 #include "settings.h"
22 #include "porting.h"
23 #include "filesys.h"
24 #include "config.h"
25 #include "constants.h"
26 #include "porting.h"
27 #include "mapgen/mapgen.h" // Mapgen::setDefaultSettings
28 #include "util/string.h"
33 void set_default_settings(Settings *settings)
35 // Client and server
36 settings->setDefault("language", "");
37 settings->setDefault("name", "");
38 settings->setDefault("bind_address", "");
39 settings->setDefault("serverlist_url", "servers.minetest.net");
41 // Client
42 settings->setDefault("address", "");
43 settings->setDefault("enable_sound", "true");
44 settings->setDefault("sound_volume", "0.8");
45 settings->setDefault("mute_sound", "false");
46 settings->setDefault("enable_mesh_cache", "false");
47 settings->setDefault("mesh_generation_interval", "0");
48 settings->setDefault("meshgen_block_cache_size", "40");
49 settings->setDefault("enable_vbo", "true");
50 settings->setDefault("free_move", "false");
51 settings->setDefault("pitch_move", "false");
52 settings->setDefault("fast_move", "false");
53 settings->setDefault("noclip", "false");
54 settings->setDefault("screenshot_path", "screenshots");
55 settings->setDefault("screenshot_format", "png");
56 settings->setDefault("screenshot_quality", "0");
57 settings->setDefault("client_unload_unused_data_timeout", "600");
58 settings->setDefault("client_mapblock_limit", "7500");
59 settings->setDefault("enable_build_where_you_stand", "true");
60 settings->setDefault("curl_timeout", "5000");
61 settings->setDefault("curl_parallel_limit", "8");
62 settings->setDefault("curl_file_download_timeout", "300000");
63 settings->setDefault("curl_verify_cert", "true");
64 settings->setDefault("enable_remote_media_server", "true");
65 settings->setDefault("enable_client_modding", "true");
66 settings->setDefault("max_out_chat_queue_size", "20");
67 settings->setDefault("pause_on_lost_focus", "false");
68 settings->setDefault("enable_register_confirmation", "true");
70 // Cheat Menu
71 settings->setDefault("cheat_menu_font", "FM_Standard");
72 settings->setDefault("cheat_menu_bg_color", "(0, 0, 0)");
73 settings->setDefault("cheat_menu_bg_color_alpha", "128");
74 settings->setDefault("cheat_menu_active_bg_color", "(0, 128, 0)");
75 settings->setDefault("cheat_menu_active_bg_color_alpha", "210");
76 settings->setDefault("cheat_menu_font_color", "(0, 255, 0)");
77 settings->setDefault("cheat_menu_font_color_alpha", "195");
78 settings->setDefault("cheat_menu_selected_font_color", "(255, 255, 255)");
79 settings->setDefault("cheat_menu_selected_font_color_alpha", "235");
81 // Cheats
82 settings->setDefault("xray", "false");
83 settings->setDefault("xray_nodes", "default:stone,mcl_core:stone");
84 settings->setDefault("fullbright", "false");
85 settings->setDefault("priv_bypass", "true");
86 settings->setDefault("freecam", "false");
87 settings->setDefault("prevent_natural_damage", "true");
88 settings->setDefault("freecam", "false");
89 settings->setDefault("killaura", "false");
90 settings->setDefault("no_hurt_cam", "false");
91 settings->setDefault("increase_tool_range", "true");
92 settings->setDefault("increase_tool_range_plus", "false");
93 settings->setDefault("hud_flags_bypass", "true");
94 settings->setDefault("antiknockback", "false");
95 settings->setDefault("entity_speed", "false");
96 settings->setDefault("autodig", "false");
97 settings->setDefault("jesus", "false");
98 settings->setDefault("fastplace", "false");
99 settings->setDefault("fastdig", "false");
100 settings->setDefault("autoplace", "false");
101 settings->setDefault("instant_break", "false");
102 settings->setDefault("no_night", "false");
103 settings->setDefault("coords", "false");
104 settings->setDefault("point_liquids", "false");
105 settings->setDefault("log_particles", "false");
106 settings->setDefault("spamclick", "false");
107 settings->setDefault("no_force_rotate", "false");
108 settings->setDefault("no_slow", "false");
109 settings->setDefault("float_above_parent", "false");
110 settings->setDefault("ignore_status_messages", "true");
111 settings->setDefault("mark_deathmessages", "true");
112 settings->setDefault("autosneak", "false");
113 settings->setDefault("autoeject", "false");
114 settings->setDefault("eject_items", "");
115 settings->setDefault("autotool", "false");
116 settings->setDefault("autorespawn", "false");
117 settings->setDefault("scaffold", "false");
118 settings->setDefault("scaffold_plus", "false");
119 settings->setDefault("block_water", "false");
120 settings->setDefault("autotnt", "false");
121 settings->setDefault("replace", "false");
122 settings->setDefault("crystal_pvp", "false");
123 settings->setDefault("autototem", "false");
124 settings->setDefault("dont_point_nodes", "false");
125 settings->setDefault("strip", "false");
126 settings->setDefault("autorefill", "false");
127 settings->setDefault("nuke", "false");
128 settings->setDefault("chat_color", "rainbow");
129 settings->setDefault("use_chat_color", "false");
130 settings->setDefault("chat_reverse", "false");
131 settings->setDefault("forcefield", "false");
132 settings->setDefault("friendlist", "");
133 settings->setDefault("cheat_hud", "true");
134 settings->setDefault("node_esp_nodes", "");
135 settings->setDefault("autosprint", "false");
136 settings->setDefault("override_speed", "false");
137 settings->setDefault("override_jump", "false");
138 settings->setDefault("override_gravity", "false");
139 settings->setDefault("override_speed_factor", "1.2");
140 settings->setDefault("override_jump_factor", "2.0");
141 settings->setDefault("override_gravity_factor", "0.9");
142 settings->setDefault("jetpack", "false");
143 settings->setDefault("autohit", "false");
144 settings->setDefault("antislip", "false");
145 settings->setDefault("enable_entity_esp", "false");
146 settings->setDefault("enable_entity_tracers", "false");
147 settings->setDefault("enable_player_esp", "false");
148 settings->setDefault("enable_player_tracers", "false");
149 settings->setDefault("enable_node_esp", "false");
150 settings->setDefault("enable_node_tracers", "false");
151 settings->setDefault("entity_esp_color", "(50, 50, 50)");
152 settings->setDefault("player_esp_color", "(0, 255, 0)");
153 settings->setDefault("noweather", "false");
154 settings->setDefault("noparticles", "false");
155 settings->setDefault("noposupdate", "false");
157 // Keymap
158 settings->setDefault("remote_port", "30000");
159 settings->setDefault("keymap_forward", "KEY_KEY_W");
160 settings->setDefault("keymap_autoforward", "");
161 settings->setDefault("keymap_backward", "KEY_KEY_S");
162 settings->setDefault("keymap_left", "KEY_KEY_A");
163 settings->setDefault("keymap_right", "KEY_KEY_D");
164 settings->setDefault("keymap_jump", "KEY_SPACE");
165 settings->setDefault("keymap_sneak", "KEY_LSHIFT");
166 settings->setDefault("keymap_dig", "KEY_LBUTTON");
167 settings->setDefault("keymap_place", "KEY_RBUTTON");
168 settings->setDefault("keymap_drop", "KEY_KEY_Q");
169 settings->setDefault("keymap_zoom", "KEY_KEY_Z");
170 settings->setDefault("keymap_inventory", "KEY_KEY_I");
171 settings->setDefault("keymap_enderchest", "KEY_KEY_O");
172 settings->setDefault("keymap_special1", "KEY_KEY_E");
173 settings->setDefault("keymap_chat", "KEY_KEY_T");
174 settings->setDefault("keymap_cmd", "/");
175 settings->setDefault("keymap_cmd_local", ".");
176 settings->setDefault("keymap_minimap", "KEY_KEY_V");
177 settings->setDefault("keymap_console", "KEY_F10");
178 settings->setDefault("keymap_rangeselect", "KEY_KEY_R");
179 settings->setDefault("keymap_freemove", "KEY_KEY_K");
180 settings->setDefault("keymap_pitchmove", "KEY_KEY_P");
181 settings->setDefault("keymap_fastmove", "KEY_KEY_J");
182 settings->setDefault("keymap_noclip", "KEY_KEY_H");
183 settings->setDefault("keymap_hotbar_next", "KEY_KEY_N");
184 settings->setDefault("keymap_hotbar_previous", "KEY_KEY_B");
185 settings->setDefault("keymap_mute", "KEY_KEY_M");
186 settings->setDefault("keymap_increase_volume", "");
187 settings->setDefault("keymap_decrease_volume", "");
188 settings->setDefault("keymap_cinematic", "");
189 settings->setDefault("keymap_toggle_hud", "KEY_F1");
190 settings->setDefault("keymap_toggle_chat", "KEY_F2");
191 settings->setDefault("keymap_toggle_fog", "KEY_F3");
192 settings->setDefault("keymap_toggle_cheat_menu", "KEY_F8");
193 #if DEBUG
194 settings->setDefault("keymap_toggle_update_camera", "KEY_F4");
195 #else
196 settings->setDefault("keymap_toggle_update_camera", "");
197 #endif
198 settings->setDefault("keymap_toggle_debug", "KEY_F5");
199 settings->setDefault("keymap_toggle_profiler", "KEY_F6");
200 settings->setDefault("keymap_camera_mode", "KEY_KEY_C");
201 settings->setDefault("keymap_screenshot", "KEY_F12");
202 settings->setDefault("keymap_increase_viewing_range_min", "+");
203 settings->setDefault("keymap_decrease_viewing_range_min", "-");
204 settings->setDefault("keymap_toggle_killaura", "KEY_KEY_X");
205 settings->setDefault("keymap_toggle_freecam", "KEY_KEY_G");
206 settings->setDefault("keymap_toggle_scaffold", "KEY_KEY_Y");
207 settings->setDefault("keymap_select_up", "KEY_UP");
208 settings->setDefault("keymap_select_down", "KEY_DOWN");
209 settings->setDefault("keymap_select_left", "KEY_LEFT");
210 settings->setDefault("keymap_select_right", "KEY_RIGHT");
211 settings->setDefault("keymap_select_confirm", "KEY_RETURN");
212 settings->setDefault("keymap_slot1", "KEY_KEY_1");
213 settings->setDefault("keymap_slot2", "KEY_KEY_2");
214 settings->setDefault("keymap_slot3", "KEY_KEY_3");
215 settings->setDefault("keymap_slot4", "KEY_KEY_4");
216 settings->setDefault("keymap_slot5", "KEY_KEY_5");
217 settings->setDefault("keymap_slot6", "KEY_KEY_6");
218 settings->setDefault("keymap_slot7", "KEY_KEY_7");
219 settings->setDefault("keymap_slot8", "KEY_KEY_8");
220 settings->setDefault("keymap_slot9", "KEY_KEY_9");
221 settings->setDefault("keymap_slot10", "KEY_KEY_0");
222 settings->setDefault("keymap_slot11", "");
223 settings->setDefault("keymap_slot12", "");
224 settings->setDefault("keymap_slot13", "");
225 settings->setDefault("keymap_slot14", "");
226 settings->setDefault("keymap_slot15", "");
227 settings->setDefault("keymap_slot16", "");
228 settings->setDefault("keymap_slot17", "");
229 settings->setDefault("keymap_slot18", "");
230 settings->setDefault("keymap_slot19", "");
231 settings->setDefault("keymap_slot20", "");
232 settings->setDefault("keymap_slot21", "");
233 settings->setDefault("keymap_slot22", "");
234 settings->setDefault("keymap_slot23", "");
235 settings->setDefault("keymap_slot24", "");
236 settings->setDefault("keymap_slot25", "");
237 settings->setDefault("keymap_slot26", "");
238 settings->setDefault("keymap_slot27", "");
239 settings->setDefault("keymap_slot28", "");
240 settings->setDefault("keymap_slot29", "");
241 settings->setDefault("keymap_slot30", "");
242 settings->setDefault("keymap_slot31", "");
243 settings->setDefault("keymap_slot32", "");
245 // Some (temporary) keys for debugging
246 settings->setDefault("keymap_quicktune_prev", "KEY_HOME");
247 settings->setDefault("keymap_quicktune_next", "KEY_END");
248 settings->setDefault("keymap_quicktune_dec", "KEY_NEXT");
249 settings->setDefault("keymap_quicktune_inc", "KEY_PRIOR");
251 // Visuals
252 #ifdef NDEBUG
253 settings->setDefault("show_debug", "false");
254 #else
255 settings->setDefault("show_debug", "true");
256 #endif
257 settings->setDefault("fsaa", "0");
258 settings->setDefault("undersampling", "0");
259 settings->setDefault("world_aligned_mode", "enable");
260 settings->setDefault("autoscale_mode", "disable");
261 settings->setDefault("enable_fog", "true");
262 settings->setDefault("fog_start", "0.4");
263 settings->setDefault("3d_mode", "none");
264 settings->setDefault("3d_paralax_strength", "0.025");
265 settings->setDefault("tooltip_show_delay", "400");
266 settings->setDefault("tooltip_append_itemname", "false");
267 settings->setDefault("fps_max", "60");
268 settings->setDefault("fps_max_unfocused", "20");
269 settings->setDefault("viewing_range", "190");
270 #if ENABLE_GLES
271 settings->setDefault("near_plane", "0.1");
272 #endif
273 settings->setDefault("screen_w", "1024");
274 settings->setDefault("screen_h", "600");
275 settings->setDefault("autosave_screensize", "true");
276 settings->setDefault("fullscreen", "false");
277 settings->setDefault("fullscreen_bpp", "24");
278 settings->setDefault("vsync", "false");
279 settings->setDefault("fov", "72");
280 settings->setDefault("leaves_style", "fancy");
281 settings->setDefault("connected_glass", "false");
282 settings->setDefault("smooth_lighting", "true");
283 settings->setDefault("lighting_alpha", "0.0");
284 settings->setDefault("lighting_beta", "1.5");
285 settings->setDefault("display_gamma", "1.0");
286 settings->setDefault("lighting_boost", "0.2");
287 settings->setDefault("lighting_boost_center", "0.5");
288 settings->setDefault("lighting_boost_spread", "0.2");
289 settings->setDefault("texture_path", "");
290 settings->setDefault("shader_path", "");
291 #if ENABLE_GLES
292 #ifdef _IRR_COMPILE_WITH_OGLES1_
293 settings->setDefault("video_driver", "ogles1");
294 #else
295 settings->setDefault("video_driver", "ogles2");
296 #endif
297 #else
298 settings->setDefault("video_driver", "opengl");
299 #endif
300 settings->setDefault("cinematic", "false");
301 settings->setDefault("camera_smoothing", "0");
302 settings->setDefault("cinematic_camera_smoothing", "0.7");
303 settings->setDefault("enable_clouds", "true");
304 settings->setDefault("view_bobbing_amount", "1.0");
305 settings->setDefault("fall_bobbing_amount", "0.03");
306 settings->setDefault("enable_3d_clouds", "true");
307 settings->setDefault("cloud_radius", "12");
308 settings->setDefault("menu_clouds", "true");
309 settings->setDefault("opaque_water", "false");
310 settings->setDefault("console_height", "0.6");
311 settings->setDefault("console_color", "(0,0,0)");
312 settings->setDefault("console_alpha", "150");
313 settings->setDefault("formspec_fullscreen_bg_color", "(0,0,0)");
314 settings->setDefault("formspec_fullscreen_bg_opacity", "140");
315 settings->setDefault("formspec_default_bg_color", "(0,0,0)");
316 settings->setDefault("formspec_default_bg_opacity", "140");
317 settings->setDefault("selectionbox_color", "(0,0,0)");
318 settings->setDefault("selectionbox_width", "2");
319 settings->setDefault("node_highlighting", "box");
320 settings->setDefault("crosshair_color", "(255,255,255)");
321 settings->setDefault("crosshair_alpha", "255");
322 settings->setDefault("recent_chat_messages", "6");
323 settings->setDefault("hud_scaling", "1.0");
324 settings->setDefault("gui_scaling", "1.0");
325 settings->setDefault("gui_scaling_filter", "false");
326 settings->setDefault("gui_scaling_filter_txr2img", "true");
327 settings->setDefault("desynchronize_mapblock_texture_animation", "true");
328 settings->setDefault("hud_hotbar_max_width", "1.0");
329 settings->setDefault("enable_local_map_saving", "false");
330 settings->setDefault("show_entity_selectionbox", "false");
331 settings->setDefault("texture_clean_transparent", "false");
332 settings->setDefault("texture_min_size", "64");
333 settings->setDefault("ambient_occlusion_gamma", "1.8");
334 #if ENABLE_GLES
335 settings->setDefault("enable_shaders", "false");
336 #else
337 settings->setDefault("enable_shaders", "true");
338 #endif
339 settings->setDefault("enable_particles", "true");
340 settings->setDefault("arm_inertia", "true");
342 settings->setDefault("enable_minimap", "true");
343 settings->setDefault("minimap_shape_round", "false");
344 settings->setDefault("minimap_double_scan_height", "true");
346 // Effects
347 settings->setDefault("directional_colored_fog", "true");
348 settings->setDefault("inventory_items_animations", "false");
349 settings->setDefault("mip_map", "false");
350 settings->setDefault("anisotropic_filter", "false");
351 settings->setDefault("bilinear_filter", "false");
352 settings->setDefault("trilinear_filter", "false");
353 settings->setDefault("tone_mapping", "false");
354 settings->setDefault("enable_waving_water", "false");
355 settings->setDefault("water_wave_height", "1.0");
356 settings->setDefault("water_wave_length", "20.0");
357 settings->setDefault("water_wave_speed", "5.0");
358 settings->setDefault("enable_waving_leaves", "false");
359 settings->setDefault("enable_waving_plants", "false");
362 // Input
363 settings->setDefault("invert_mouse", "false");
364 settings->setDefault("mouse_sensitivity", "0.2");
365 settings->setDefault("repeat_place_time", "0.25");
366 settings->setDefault("safe_dig_and_place", "false");
367 settings->setDefault("random_input", "false");
368 settings->setDefault("aux1_descends", "false");
369 settings->setDefault("doubletap_jump", "false");
370 settings->setDefault("always_fly_fast", "true");
371 #ifdef __ANDROID__
372 settings->setDefault("autojump", "true");
373 #else
374 settings->setDefault("autojump", "false");
375 #endif
376 settings->setDefault("continuous_forward", "false");
377 settings->setDefault("enable_joysticks", "false");
378 settings->setDefault("joystick_id", "0");
379 settings->setDefault("joystick_type", "");
380 settings->setDefault("repeat_joystick_button_time", "0.17");
381 settings->setDefault("joystick_frustum_sensitivity", "170");
383 // Main menu
384 settings->setDefault("main_menu_path", "");
385 settings->setDefault("serverlist_file", "favoriteservers.txt");
387 #if USE_FREETYPE
388 settings->setDefault("freetype", "true");
389 settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "Ubuntu-B.ttf"));
390 settings->setDefault("font_path_italic", porting::getDataPath("fonts" DIR_DELIM "Arimo-Italic.ttf"));
391 settings->setDefault("font_path_bold", porting::getDataPath("fonts" DIR_DELIM "Arimo-Bold.ttf"));
392 settings->setDefault("font_path_bold_italic", porting::getDataPath("fonts" DIR_DELIM "Arimo-BoldItalic.ttf"));
393 settings->setDefault("font_bold", "false");
394 settings->setDefault("font_italic", "false");
395 settings->setDefault("font_shadow", "1");
396 settings->setDefault("font_shadow_alpha", "200");
397 settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "Cousine-Regular.ttf"));
398 settings->setDefault("mono_font_path_italic", porting::getDataPath("fonts" DIR_DELIM "Cousine-Italic.ttf"));
399 settings->setDefault("mono_font_path_bold", porting::getDataPath("fonts" DIR_DELIM "Cousine-Bold.ttf"));
400 settings->setDefault("mono_font_path_bold_italic", porting::getDataPath("fonts" DIR_DELIM "Cousine-BoldItalic.ttf"));
401 settings->setDefault("fallback_font_path", porting::getDataPath("fonts" DIR_DELIM "DroidSansFallbackFull.ttf"));
403 settings->setDefault("fallback_font_shadow", "1");
404 settings->setDefault("fallback_font_shadow_alpha", "128");
406 std::string font_size_str = std::to_string(TTF_DEFAULT_FONT_SIZE);
408 settings->setDefault("fallback_font_size", font_size_str);
409 #else
410 settings->setDefault("freetype", "false");
411 settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "mono_dejavu_sans"));
412 settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "mono_dejavu_sans"));
414 std::string font_size_str = std::to_string(DEFAULT_FONT_SIZE);
415 #endif
416 // General font settings
417 settings->setDefault("font_size", font_size_str);
418 settings->setDefault("mono_font_size", font_size_str);
419 settings->setDefault("chat_font_size", "0"); // Default "font_size"
421 // ContentDB
422 settings->setDefault("contentdb_url", "127.0.0.1"); // http://cheatdb.elidragon.com in DF
423 settings->setDefault("contentdb_max_concurrent_downloads", "3");
425 #ifdef __ANDROID__
426 settings->setDefault("contentdb_flag_blacklist", "android_default");
427 #else
428 settings->setDefault("contentdb_flag_blacklist", "desktop_default");
429 #endif
432 // Server
433 settings->setDefault("disable_escape_sequences", "false");
434 settings->setDefault("strip_color_codes", "false");
435 #if USE_PROMETHEUS
436 settings->setDefault("prometheus_listener_address", "127.0.0.1:30000");
437 #endif
439 // Network
440 settings->setDefault("enable_ipv6", "true");
441 settings->setDefault("ipv6_server", "false");
442 settings->setDefault("max_packets_per_iteration","1024");
443 settings->setDefault("port", "30000");
444 settings->setDefault("strict_protocol_version_checking", "false");
445 settings->setDefault("player_transfer_distance", "0");
446 settings->setDefault("max_simultaneous_block_sends_per_client", "128");
447 settings->setDefault("time_send_interval", "5");
449 settings->setDefault("default_game", "minetest");
450 settings->setDefault("motd", "");
451 settings->setDefault("max_users", "15");
452 settings->setDefault("creative_mode", "false");
453 settings->setDefault("enable_damage", "true");
454 settings->setDefault("default_password", "");
455 settings->setDefault("default_privs", "interact, shout");
456 settings->setDefault("enable_pvp", "true");
457 settings->setDefault("enable_mod_channels", "false");
458 settings->setDefault("disallow_empty_password", "false");
459 settings->setDefault("disable_anticheat", "false");
460 settings->setDefault("enable_rollback_recording", "false");
461 settings->setDefault("deprecated_lua_api_handling", "log");
463 settings->setDefault("kick_msg_shutdown", "Server shutting down.");
464 settings->setDefault("kick_msg_crash", "This server has experienced an internal error. You will now be disconnected.");
465 settings->setDefault("ask_reconnect_on_crash", "false");
467 settings->setDefault("chat_message_format", "<@name> @message");
468 settings->setDefault("profiler_print_interval", "0");
469 settings->setDefault("active_object_send_range_blocks", "8");
470 settings->setDefault("active_block_range", "4");
471 //settings->setDefault("max_simultaneous_block_sends_per_client", "1");
472 // This causes frametime jitter on client side, or does it?
473 settings->setDefault("max_block_send_distance", "12");
474 settings->setDefault("block_send_optimize_distance", "4");
475 settings->setDefault("server_side_occlusion_culling", "true");
476 settings->setDefault("csm_restriction_flags", "62");
477 settings->setDefault("csm_restriction_noderange", "0");
478 settings->setDefault("max_clearobjects_extra_loaded_blocks", "4096");
479 settings->setDefault("time_speed", "72");
480 settings->setDefault("world_start_time", "6125");
481 settings->setDefault("server_unload_unused_data_timeout", "29");
482 settings->setDefault("max_objects_per_block", "64");
483 settings->setDefault("server_map_save_interval", "5.3");
484 settings->setDefault("chat_message_max_size", "500");
485 settings->setDefault("chat_message_limit_per_10sec", "8.0");
486 settings->setDefault("chat_message_limit_trigger_kick", "50");
487 settings->setDefault("sqlite_synchronous", "2");
488 settings->setDefault("full_block_send_enable_min_time_from_building", "2.0");
489 settings->setDefault("dedicated_server_step", "0.09");
490 settings->setDefault("active_block_mgmt_interval", "2.0");
491 settings->setDefault("abm_interval", "1.0");
492 settings->setDefault("abm_time_budget", "0.2");
493 settings->setDefault("nodetimer_interval", "0.2");
494 settings->setDefault("ignore_world_load_errors", "false");
495 settings->setDefault("remote_media", "");
496 settings->setDefault("debug_log_level", "action");
497 settings->setDefault("debug_log_size_max", "50");
498 settings->setDefault("chat_log_level", "error");
499 settings->setDefault("emergequeue_limit_total", "1024");
500 settings->setDefault("emergequeue_limit_diskonly", "128");
501 settings->setDefault("emergequeue_limit_generate", "128");
502 settings->setDefault("num_emerge_threads", "1");
503 settings->setDefault("secure.enable_security", "true");
504 settings->setDefault("secure.trusted_mods", "");
505 settings->setDefault("secure.http_mods", "");
507 // Physics
508 settings->setDefault("movement_acceleration_default", "3");
509 settings->setDefault("movement_acceleration_air", "2");
510 settings->setDefault("movement_acceleration_fast", "10");
511 settings->setDefault("movement_speed_walk", "4");
512 settings->setDefault("movement_speed_crouch", "1.35");
513 settings->setDefault("movement_speed_fast", "20");
514 settings->setDefault("movement_speed_climb", "3");
515 settings->setDefault("movement_speed_jump", "6.5");
516 settings->setDefault("movement_liquid_fluidity", "1");
517 settings->setDefault("movement_liquid_fluidity_smooth", "0.5");
518 settings->setDefault("movement_liquid_sink", "10");
519 settings->setDefault("movement_gravity", "9.81");
520 settings->setDefault("movement_ignore_server_speed", "false");
522 settings->setDefault("movement_server_acceleration_default", "3");
523 settings->setDefault("movement_server_acceleration_air", "2");
524 settings->setDefault("movement_server_acceleration_fast", "10");
525 settings->setDefault("movement_server_speed_walk", "4");
526 settings->setDefault("movement_server_speed_crouch", "1.35");
527 settings->setDefault("movement_server_speed_fast", "20");
528 settings->setDefault("movement_server_speed_climb", "3");
529 settings->setDefault("movement_server_speed_jump", "6.5");
530 settings->setDefault("movement_server_liquid_fluidity", "1");
531 settings->setDefault("movement_server_liquid_fluidity_smooth", "0.5");
532 settings->setDefault("movement_server_liquid_sink", "10");
533 settings->setDefault("movement_server_gravity", "9.81");
534 settings->setDefault("movement_server_ignore_server_speed", "false");
535 // Liquids
536 settings->setDefault("liquid_loop_max", "100000");
537 settings->setDefault("liquid_queue_purge_time", "0");
538 settings->setDefault("liquid_update", "1.0");
540 // Mapgen
541 settings->setDefault("mg_name", "v7");
542 settings->setDefault("water_level", "1");
543 settings->setDefault("mapgen_limit", "31000");
544 settings->setDefault("chunksize", "5");
545 settings->setDefault("fixed_map_seed", "");
546 settings->setDefault("max_block_generate_distance", "10");
547 settings->setDefault("enable_mapgen_debug_info", "false");
548 Mapgen::setDefaultSettings(settings);
550 // Server list announcing
551 settings->setDefault("server_announce", "false");
552 settings->setDefault("server_url", "");
553 settings->setDefault("server_address", "");
554 settings->setDefault("server_name", "");
555 settings->setDefault("server_description", "");
557 settings->setDefault("high_precision_fpu", "true");
558 settings->setDefault("enable_console", "false");
559 settings->setDefault("screen_dpi", "72");
561 // Altered settings for macOS
562 #if defined(__MACH__) && defined(__APPLE__)
563 settings->setDefault("keymap_sneak", "KEY_SHIFT");
564 settings->setDefault("fps_max", "0");
565 #endif
567 // Altered settings for Android
568 #ifdef __ANDROID__
569 settings->setDefault("screen_w", "0");
570 settings->setDefault("screen_h", "0");
571 settings->setDefault("fullscreen", "true");
572 settings->setDefault("touchtarget", "true");
573 settings->setDefault("TMPFolder", porting::path_cache);
574 settings->setDefault("touchscreen_threshold","20");
575 settings->setDefault("fixed_virtual_joystick", "false");
576 settings->setDefault("virtual_joystick_triggers_aux", "false");
577 settings->setDefault("smooth_lighting", "false");
578 settings->setDefault("max_simultaneous_block_sends_per_client", "10");
579 settings->setDefault("emergequeue_limit_diskonly", "16");
580 settings->setDefault("emergequeue_limit_generate", "16");
581 settings->setDefault("max_block_generate_distance", "5");
582 settings->setDefault("enable_3d_clouds", "false");
583 settings->setDefault("fps_max", "30");
584 settings->setDefault("fps_max_unfocused", "10");
585 settings->setDefault("max_objects_per_block", "20");
586 settings->setDefault("sqlite_synchronous", "1");
587 settings->setDefault("server_map_save_interval", "15");
588 settings->setDefault("client_mapblock_limit", "1000");
589 settings->setDefault("active_block_range", "2");
590 settings->setDefault("viewing_range", "50");
591 settings->setDefault("leaves_style", "simple");
592 settings->setDefault("curl_verify_cert","false");
594 // Apply settings according to screen size
595 float x_inches = (float) porting::getDisplaySize().X /
596 (160.f * porting::getDisplayDensity());
598 if (x_inches < 3.7f) {
599 settings->setDefault("hud_scaling", "0.6");
600 settings->setDefault("font_size", "14");
601 settings->setDefault("mono_font_size", "14");
602 } else if (x_inches < 4.5f) {
603 settings->setDefault("hud_scaling", "0.7");
604 settings->setDefault("font_size", "14");
605 settings->setDefault("mono_font_size", "14");
606 } else if (x_inches < 6.0f) {
607 settings->setDefault("hud_scaling", "0.85");
608 settings->setDefault("font_size", "14");
609 settings->setDefault("mono_font_size", "14");
611 // Tablets >= 6.0 use non-Android defaults for these settings
612 set_settingtypes();
613 #endif