Make client know about reverted disallowed diggings

This commit is contained in:
Perttu Ahola 2012-04-09 21:13:22 +03:00
parent b1f043d010
commit f8c2f1cf54
1 changed files with 15 additions and 2 deletions

View File

@ -2955,8 +2955,13 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
*/ */
if(!checkPriv(player->getName(), "interact")) if(!checkPriv(player->getName(), "interact"))
{ {
infostream<<"Ignoring interaction from player "<<player->getName() actionstream<<player->getName()<<" attempted to interact with "
<<" (no interact privilege)"<<std::endl; <<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; return;
} }
@ -3041,6 +3046,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
} }
if(n.getContent() != CONTENT_IGNORE) if(n.getContent() != CONTENT_IGNORE)
scriptapi_node_on_dig(m_lua, p_under, n, playersao); 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 } // action == 2