diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2016-10-04 18:17:12 +0200 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2016-10-05 00:13:37 +0200 |
commit | d4c76258e37337ea585cf24d8e05b50a30fa307d (patch) | |
tree | 6936b8f843171843008743e1341fe431222eec82 /src/network | |
parent | 1079aeaa13a94c67c1e0a0bd1c461e14841a1eec (diff) | |
download | minetest-d4c76258e37337ea585cf24d8e05b50a30fa307d.tar.gz minetest-d4c76258e37337ea585cf24d8e05b50a30fa307d.tar.bz2 minetest-d4c76258e37337ea585cf24d8e05b50a30fa307d.zip |
Chat: new settings to prevent spam
Added the following chat coreside features
* Chat messages length limit
* Message rate limiting
* Message rate kicking
Note:
* handleChat now takes RemotePlayer pointer instead of u16 to remove useless
lookups
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/serverpackethandler.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index 1bcb78a8a..a8bfd9068 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -1065,7 +1065,7 @@ void Server::handleCommand_ChatMessage(NetworkPacket* pkt) std::wstring wname = narrow_to_wide(name); std::wstring answer_to_sender = handleChat(name, wname, message, - true, pkt->getPeerId()); + true, dynamic_cast<RemotePlayer *>(player)); if (!answer_to_sender.empty()) { // Send the answer to sender SendChatMessage(pkt->getPeerId(), answer_to_sender); @@ -1656,16 +1656,16 @@ void Server::handleCommand_Interact(NetworkPacket* pkt) } } // action == 4 - + /* 5: rightclick air */ else if (action == 5) { ItemStack item = playersao->getWieldedItem(); - - actionstream << player->getName() << " activates " + + actionstream << player->getName() << " activates " << item.name << std::endl; - + if (m_script->item_OnSecondaryUse( item, playersao)) { if( playersao->setWieldedItem(item)) { |