diff options
author | Lars Müller <34514239+appgurueu@users.noreply.github.com> | 2021-03-30 21:49:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-30 21:49:50 +0200 |
commit | 88d1fcfe237470b6eaed079f95a048e5f39b1861 (patch) | |
tree | 88a7441a4961be1ebdc8ebf4e71a772fbcb418dd /src | |
parent | f4118a4fdebe5c8a4a467afe5b3f49a0bd74c37a (diff) | |
download | minetest-88d1fcfe237470b6eaed079f95a048e5f39b1861.tar.gz minetest-88d1fcfe237470b6eaed079f95a048e5f39b1861.tar.bz2 minetest-88d1fcfe237470b6eaed079f95a048e5f39b1861.zip |
Block & report player self-interaction (#11137)
Diffstat (limited to 'src')
-rw-r--r-- | src/network/serverpackethandler.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index 5b378a083..708ddbf20 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -1051,6 +1051,12 @@ void Server::handleCommand_Interact(NetworkPacket *pkt) if (pointed.type == POINTEDTHING_NODE) { target_pos = intToFloat(pointed.node_undersurface, BS); } else if (pointed.type == POINTEDTHING_OBJECT) { + if (playersao->getId() == pointed_object->getId()) { + actionstream << "Server: " << player->getName() + << " attempted to interact with themselves" << std::endl; + m_script->on_cheat(playersao, "interacted_with_self"); + return; + } target_pos = pointed_object->getBasePosition(); } float d = playersao->getEyePosition().getDistanceFrom(target_pos); |