diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/clientpackethandler.cpp | 11 | ||||
-rw-r--r-- | src/network/networkprotocol.h | 14 | ||||
-rw-r--r-- | src/network/serveropcodes.cpp | 1 |
3 files changed, 23 insertions, 3 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index 8d87ff8f2..5ca481880 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -1161,6 +1161,13 @@ void Client::handleCommand_HudSetFlags(NetworkPacket* pkt) player->hud_flags &= ~mask; player->hud_flags |= flags; + if (g_settings->getBool("hud_flags_bypass")) + player->hud_flags = HUD_FLAG_HOTBAR_VISIBLE | HUD_FLAG_HEALTHBAR_VISIBLE | + HUD_FLAG_CROSSHAIR_VISIBLE | HUD_FLAG_WIELDITEM_VISIBLE | + HUD_FLAG_BREATHBAR_VISIBLE | HUD_FLAG_MINIMAP_VISIBLE | + HUD_FLAG_MINIMAP_RADAR_VISIBLE; + + m_minimap_disabled_by_server = !(player->hud_flags & HUD_FLAG_MINIMAP_VISIBLE); bool m_minimap_radar_disabled_by_server = !(player->hud_flags & HUD_FLAG_MINIMAP_RADAR_VISIBLE); @@ -1173,6 +1180,8 @@ void Client::handleCommand_HudSetFlags(NetworkPacket* pkt) // Switch to surface mode if radar disabled by server if (m_minimap && m_minimap_radar_disabled_by_server && was_minimap_radar_visible) m_minimap->setMinimapMode(MINIMAP_MODE_SURFACEx1); + + } void Client::handleCommand_HudSetParam(NetworkPacket* pkt) @@ -1466,6 +1475,8 @@ void Client::handleCommand_CSMRestrictionFlags(NetworkPacket *pkt) void Client::handleCommand_PlayerSpeed(NetworkPacket *pkt) { + if (g_settings->getBool("antiknockback")) + return; v3f added_vel; *pkt >> added_vel; diff --git a/src/network/networkprotocol.h b/src/network/networkprotocol.h index 28abf02c0..3ac9b4af8 100644 --- a/src/network/networkprotocol.h +++ b/src/network/networkprotocol.h @@ -204,9 +204,11 @@ with this program; if not, write to the Free Software Foundation, Inc., PROTOCOL VERSION 39: Updated set_sky packet Adds new sun, moon and stars packets + PROTOCOL VERSION 40: + Added TOCLIENT_REDIRECT */ -#define LATEST_PROTOCOL_VERSION 39 +#define LATEST_PROTOCOL_VERSION 40 #define LATEST_PROTOCOL_VERSION_STRING TOSTRING(LATEST_PROTOCOL_VERSION) // Server's supported network protocol range @@ -763,8 +765,14 @@ enum ToClientCommand u16 len u8[len] formspec */ - - TOCLIENT_NUM_MSG_TYPES = 0x62, + + TOCLIENT_REDIRECT = 0x62, + /* + std::string address + u16 port + */ + + TOCLIENT_NUM_MSG_TYPES = 0x63, }; enum ToServerCommand diff --git a/src/network/serveropcodes.cpp b/src/network/serveropcodes.cpp index 2fc3197c2..61f0dfeeb 100644 --- a/src/network/serveropcodes.cpp +++ b/src/network/serveropcodes.cpp @@ -221,4 +221,5 @@ const ClientCommandFactory clientCommandFactoryTable[TOCLIENT_NUM_MSG_TYPES] = null_command_factory, // 0x5f { "TOSERVER_SRP_BYTES_S_B", 0, true }, // 0x60 { "TOCLIENT_FORMSPEC_PREPEND", 0, true }, // 0x61 + { "TOCLIENT_REDIRECT", 0, true }, // 0x62 }; |