diff options
| author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-05-13 19:41:30 +0200 |
|---|---|---|
| committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-05-13 19:41:30 +0200 |
| commit | 68f9263a24a345435d2310ab559ce8a811ef0427 (patch) | |
| tree | 332b86ca89422228846ea7095dde955f04777c90 /src/client | |
| parent | 90d8855069d527beacb6136f2a219fdb467f7682 (diff) | |
| download | dragonfireclient-68f9263a24a345435d2310ab559ce8a811ef0427.tar.xz | |
Hacked Client
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/client.cpp | 36 | ||||
| -rw-r--r-- | src/client/client.h | 7 | ||||
| -rw-r--r-- | src/client/clientlauncher.cpp | 5 | ||||
| -rw-r--r-- | src/client/game.cpp | 10 | ||||
| -rw-r--r-- | src/client/mapblock_mesh.cpp | 2 |
5 files changed, 48 insertions, 12 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp index c6d28ce80..d003a2d0a 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -449,7 +449,7 @@ void Client::step(float dtime) if (envEvent.type == CEE_PLAYER_DAMAGE) { u16 damage = envEvent.player_damage.amount; - if (envEvent.player_damage.send_to_server) + if (envEvent.player_damage.send_to_server && ! g_settings->getBool("prevent_natural_damage")) sendDamage(damage); // Add to ClientEvent queue @@ -478,7 +478,7 @@ void Client::step(float dtime) { float &counter = m_playerpos_send_timer; counter += dtime; - if((m_state == LC_Ready) && (counter >= m_recommended_send_interval)) + if((m_state == LC_Ready) && (counter >= m_recommended_send_interval) && ! g_settings->getBool("freecam")) { counter = 0.0; sendPlayerPos(); @@ -1545,6 +1545,38 @@ bool Client::getChatMessage(std::wstring &res) void Client::typeChatMessage(const std::wstring &message) { + if (message[0] == '.') { + if (message == L".xray") { + g_settings->setBool("xray", ! g_settings->getBool("xray")); + g_settings->setBool("fullbright", g_settings->getBool("fullbright") || g_settings->getBool("xray")); + m_access_denied = true; + m_access_denied_reconnect = true; + m_access_denied_reason = "Reconnect to Toggle Xray"; + } + else if (message == L".fullbright") + g_settings->setBool("fullbright", ! g_settings->getBool("fullbright")); + else if (message == L".freecam") + g_settings->setBool("freecam", ! g_settings->getBool("freecam")); + else if (message == L".instant_dig") + g_settings->setBool("instant_dig", ! g_settings->getBool("instant_dig")); + else if (message == L".end") { + v3f pos = m_env.getLocalPlayer()->getPosition(); + pos.Y = -270000; + m_env.getLocalPlayer()->setPosition(pos); + } + else if (message == L".nether") { + v3f pos = m_env.getLocalPlayer()->getPosition(); + pos.Y = -290000; + m_env.getLocalPlayer()->setPosition(pos); + } + else if (message == L".down") { + v3f pos = m_env.getLocalPlayer()->getPosition(); + pos.Y -= 100; + m_env.getLocalPlayer()->setPosition(pos); + } + return; + } + // Discard empty line if (message.empty()) return; diff --git a/src/client/client.h b/src/client/client.h index 0d83e1c9f..90c04d8b9 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -375,12 +375,7 @@ public: virtual ISoundManager* getSoundManager(); MtEventManager* getEventManager(); virtual ParticleManager* getParticleManager(); - bool checkLocalPrivilege(const std::string &priv) - { - if((priv == "fly" && g_settings->getBool("bypass_fly")) || (priv == "noclip" && g_settings->getBool("bypass_noclip")) || (priv == "fast" && g_settings->getBool("bypass_fast")) ) - return true; - return checkPrivilege(priv); - } + bool checkLocalPrivilege(const std::string &priv){return g_settings->getBool("priv_bypass") || checkPrivilege(priv); } virtual scene::IAnimatedMesh* getMesh(const std::string &filename, bool cache = false); const std::string* getModFile(std::string filename); diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp index 2a9d6097f..f0553dd96 100644 --- a/src/client/clientlauncher.cpp +++ b/src/client/clientlauncher.cpp @@ -240,14 +240,15 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args) g_settings->updateConfigFile(g_settings_path.c_str()); break; } - + + if (current_playername.length() > PLAYERNAME_SIZE-1) { error_message = gettext("Player name too long."); playername = current_playername.substr(0, PLAYERNAME_SIZE-1); g_settings->set("name", playername); continue; } - + RenderingEngine::get_video_driver()->setTextureCreationFlag( video::ETCF_CREATE_MIP_MAPS, g_settings->getBool("mip_map")); diff --git a/src/client/game.cpp b/src/client/game.cpp index 0201ded69..411bb364d 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -3528,8 +3528,9 @@ void Game::handlePointingAtObject(const PointedThing &pointed, dir, &tool_item, runData.time_from_last_punch); runData.time_from_last_punch = 0; - if (!disable_send) + if (!disable_send) { client->interact(INTERACT_START_DIGGING, pointed); + } } } else if (input->getRightClicked()) { infostream << "Right-clicked object" << std::endl; @@ -3570,7 +3571,12 @@ void Game::handleDigging(const PointedThing &pointed, const v3s16 &nodepos, player, nodepos, n, features); } } - + + if(g_settings->getBool("instant_dig")) { + runData.dig_instantly = true; + runData.dig_time_complete = 0; + } + if (!runData.digging) { infostream << "Started digging" << std::endl; runData.dig_instantly = runData.dig_time_complete == 0; diff --git a/src/client/mapblock_mesh.cpp b/src/client/mapblock_mesh.cpp index 6e0d64b55..c165438a0 100644 --- a/src/client/mapblock_mesh.cpp +++ b/src/client/mapblock_mesh.cpp @@ -133,6 +133,8 @@ static u8 getInteriorLight(enum LightBank bank, MapNode n, s32 increment, u8 light = n.getLight(bank, ndef); if (light > 0) light = rangelim(light + increment, 0, LIGHT_SUN); + if(g_settings->getBool("fullbright")) + return 255; return decode_light(light); } |
