]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Get rid of `basic_debug` last minute
authorsfan5 <sfan5@live.de>
Sun, 30 Jan 2022 20:32:49 +0000 (21:32 +0100)
committerGitHub <noreply@github.com>
Sun, 30 Jan 2022 20:32:49 +0000 (21:32 +0100)
This isn't a revert but rather just disables the codepaths. also see #12011

builtin/game/privileges.lua
src/client/game.cpp
src/client/gameui.cpp
src/network/clientpackethandler.cpp
src/network/networkprotocol.h

index 97681655ef48d0728c6120327bdb7210c65070cc..2ff4c093cdcc032badd121b0dfe747f25d8da1e7 100644 (file)
@@ -97,10 +97,6 @@ core.register_privilege("rollback", {
        description = S("Can use the rollback functionality"),
        give_to_singleplayer = false,
 })
-core.register_privilege("basic_debug", {
-       description = S("Can view more debug info that might give a gameplay advantage"),
-       give_to_singleplayer = false,
-})
 core.register_privilege("debug", {
        description = S("Can enable wireframe"),
        give_to_singleplayer = false,
index 8959b5f15ed9f0e71d6cfb1aa87cf07cb20b4d6e..4337d308e457bd600c891ae241959d5358a90607 100644 (file)
@@ -1740,7 +1740,7 @@ void Game::processQueues()
 
 void Game::updateDebugState()
 {
-       bool has_basic_debug = client->checkPrivilege("basic_debug");
+       const bool has_basic_debug = true;
        bool has_debug = client->checkPrivilege("debug");
 
        if (m_game_ui->m_flags.show_basic_debug) {
@@ -2211,7 +2211,7 @@ void Game::toggleCinematic()
 
 void Game::toggleBlockBounds()
 {
-       if (client->checkPrivilege("basic_debug")) {
+       if (true /* basic_debug */) {
                enum Hud::BlockBoundsMode newmode = hud->toggleBlockBounds();
                switch (newmode) {
                        case Hud::BLOCK_BOUNDS_OFF:
@@ -2307,26 +2307,24 @@ void Game::toggleDebug()
        // The debug text can be in 2 modes: minimal and basic.
        // * Minimal: Only technical client info that not gameplay-relevant
        // * Basic: Info that might give gameplay advantage, e.g. pos, angle
-       // Basic mode is used when player has "basic_debug" priv,
-       // otherwise the Minimal mode is used.
+       // Basic mode is always used.
+
+       const bool has_basic_debug = true;
        if (!m_game_ui->m_flags.show_minimal_debug) {
                m_game_ui->m_flags.show_minimal_debug = true;
-               if (client->checkPrivilege("basic_debug")) {
+               if (has_basic_debug)
                        m_game_ui->m_flags.show_basic_debug = true;
-               }
                m_game_ui->m_flags.show_profiler_graph = false;
                draw_control->show_wireframe = false;
                m_game_ui->showTranslatedStatusText("Debug info shown");
        } else if (!m_game_ui->m_flags.show_profiler_graph && !draw_control->show_wireframe) {
-               if (client->checkPrivilege("basic_debug")) {
+               if (has_basic_debug)
                        m_game_ui->m_flags.show_basic_debug = true;
-               }
                m_game_ui->m_flags.show_profiler_graph = true;
                m_game_ui->showTranslatedStatusText("Profiler graph shown");
        } else if (!draw_control->show_wireframe && client->checkPrivilege("debug")) {
-               if (client->checkPrivilege("basic_debug")) {
+               if (has_basic_debug)
                        m_game_ui->m_flags.show_basic_debug = true;
-               }
                m_game_ui->m_flags.show_profiler_graph = false;
                draw_control->show_wireframe = true;
                m_game_ui->showTranslatedStatusText("Wireframe shown");
index bae5241b11e80bf5f6958ef0ebe025d09d17a0bb..8505ea3aef11df07d0f02f4f7c3eed9b3bd70ad9 100644 (file)
@@ -210,7 +210,6 @@ void GameUI::initFlags()
 {
        m_flags = GameUI::Flags();
        m_flags.show_minimal_debug = g_settings->getBool("show_debug");
-       m_flags.show_basic_debug = false;
 }
 
 void GameUI::showMinimap(bool show)
index 47f259b9211fae65cbb4cab9dbb164975916917d..48ad60ac6d1fec1dabf6a7deb2be7b1e8f213c0a 100644 (file)
@@ -900,11 +900,6 @@ void Client::handleCommand_Privileges(NetworkPacket* pkt)
                m_privileges.insert(priv);
                infostream << priv << " ";
        }
-
-       // Enable basic_debug on server versions before it was added
-       if (m_proto_ver < 40)
-               m_privileges.insert("basic_debug");
-
        infostream << std::endl;
 }
 
index 7bf5801f5d1e7a123a61d1632d5a3c7d1f4583f3..a5ff532166edd2aaa46149c36a5b0f1dab75e9a1 100644 (file)
@@ -206,7 +206,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
                Adds new sun, moon and stars packets
                Minimap modes
        PROTOCOL VERSION 40:
-               Added 'basic_debug' privilege
                TOCLIENT_MEDIA_PUSH changed, TOSERVER_HAVE_MEDIA added
 */