diff options
author | Lars Müller <34514239+appgurueu@users.noreply.github.com> | 2021-03-30 21:49:50 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2021-04-05 16:01:27 +0200 |
commit | 847860fc5cf8867deb45646670ce1f11c3f977b0 (patch) | |
tree | 915e56fd4620f29e356d156ec123091e837600c9 /src | |
parent | 77e936445f4e520e5301de03f11698083d9184a9 (diff) | |
download | minetest-847860fc5cf8867deb45646670ce1f11c3f977b0.tar.gz minetest-847860fc5cf8867deb45646670ce1f11c3f977b0.tar.bz2 minetest-847860fc5cf8867deb45646670ce1f11c3f977b0.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 b863e1828..fd5aed9d1 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -1041,6 +1041,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); |