From ce35eb41225652ea27970edccd7fb2f55b53d616 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Mon, 3 Jun 2024 09:26:57 -0400 Subject: [PATCH 1/3] dont show the register confirmation, try to connect as fast as possible * this is a security risk, but also a easy step.. the easy of use is a key to create a anarchy environment where people must learn to take care by itselft --- builtin/settingtypes.txt | 2 +- src/defaultsettings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index 18c259542..4aeb390c0 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -994,7 +994,7 @@ max_out_chat_queue_size (Maximum size of the out chat queue) int 20 # Enable register confirmation when connecting to server. # If disabled, new account will be registered automatically. -enable_register_confirmation (Enable register confirmation) bool true +enable_register_confirmation (Enable register confirmation) bool false [*Advanced] diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 4ea765288..b84c69a9d 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -73,7 +73,7 @@ void set_default_settings() settings->setDefault("enable_client_modding", "true"); settings->setDefault("max_out_chat_queue_size", "20"); settings->setDefault("pause_on_lost_focus", "true"); - settings->setDefault("enable_register_confirmation", "true"); + settings->setDefault("enable_register_confirmation", "false"); // Keymap settings->setDefault("remote_port", "30000"); From 17cb07a366654ffe9b0f17bf6a685e54b76018ed Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Mon, 3 Jun 2024 09:41:55 -0400 Subject: [PATCH 2/3] formspec_escape stability improvement * formspec_escape causes server crash, when text argument is a number. the `tostring(text)` prevents this * backported https://github.com/MultiCraft/MultiCraft/pull/87 --- builtin/common/misc_helpers.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/common/misc_helpers.lua b/builtin/common/misc_helpers.lua index b7bd4d6a7..be19e5b51 100644 --- a/builtin/common/misc_helpers.lua +++ b/builtin/common/misc_helpers.lua @@ -254,6 +254,7 @@ end function core.formspec_escape(text) + text = tostring(text) if text ~= nil then text = text:gsub("\\", "\\\\") text = text:gsub("%]", "\\]") From 532c187d83153bb21540dc505f5478b80ce350f7 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Mon, 3 Jun 2024 11:23:48 -0400 Subject: [PATCH 3/3] Set event receiver to null before the receiver object is deleted * backported https://github.com/MultiCraft/MultiCraft/commit/bbcee42264d52bbd1662c88a9a3c31efd434a1d1 --- src/client/clientlauncher.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp index d40fc3c34..2b76d2fe5 100644 --- a/src/client/clientlauncher.cpp +++ b/src/client/clientlauncher.cpp @@ -70,6 +70,11 @@ static void dump_start_data(const GameStartData &data) ClientLauncher::~ClientLauncher() { + RenderingEngine *rendering_engine = RenderingEngine::get_instance(); + + if (rendering_engine && rendering_engine->get_raw_device()) + rendering_engine->get_raw_device()->setEventReceiver(nullptr); + delete receiver; delete input; @@ -77,7 +82,7 @@ ClientLauncher::~ClientLauncher() delete g_fontengine; delete g_gamecallback; - delete RenderingEngine::get_instance(); + delete rendering_engine; #if USE_SOUND deleteSoundManagerSingleton(g_sound_manager_singleton);