aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-04-09 21:13:22 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-04-09 21:13:22 +0300
commitf8c2f1cf54c3328abf994d146858b47029c98b3d (patch)
tree3bceffbff8ccd07881c8a4ca6cb49b068e64d2bd /src
parentb1f043d010b6260422615c82c3af6a3b80fdd3c9 (diff)
downloadminetest-f8c2f1cf54c3328abf994d146858b47029c98b3d.tar.gz
minetest-f8c2f1cf54c3328abf994d146858b47029c98b3d.tar.bz2
minetest-f8c2f1cf54c3328abf994d146858b47029c98b3d.zip
Make client know about reverted disallowed diggings
Diffstat (limited to 'src')
-rw-r--r--src/server.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/server.cpp b/src/server.cpp
index d7b55a468..389f6282f 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -2955,8 +2955,13 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
*/
if(!checkPriv(player->getName(), "interact"))
{
- infostream<<"Ignoring interaction from player "<<player->getName()
- <<" (no interact privilege)"<<std::endl;
+ actionstream<<player->getName()<<" attempted to interact with "
+ <<pointed.dump()<<" without 'interact' privilege"
+ <<std::endl;
+ // Re-send block to revert change on client-side
+ RemoteClient *client = getClient(peer_id);
+ v3s16 blockpos = getNodeBlockPos(floatToInt(pointed_pos_under, BS));
+ client->SetBlockNotSent(blockpos);
return;
}
@@ -3041,6 +3046,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
}
if(n.getContent() != CONTENT_IGNORE)
scriptapi_node_on_dig(m_lua, p_under, n, playersao);
+
+ if (m_env->getMap().getNode(p_under).getContent() != CONTENT_AIR)
+ {
+ // Re-send block to revert change on client-side
+ RemoteClient *client = getClient(peer_id);
+ v3s16 blockpos = getNodeBlockPos(floatToInt(pointed_pos_under, BS));
+ client->SetBlockNotSent(blockpos);
+ }
}
} // action == 2