1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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
This commit is contained in:
Loic Blot 2016-10-04 18:17:12 +02:00
parent 1079aeaa13
commit d4c76258e3
8 changed files with 125 additions and 11 deletions

View file

@ -487,7 +487,7 @@ private:
std::wstring handleChat(const std::string &name, const std::wstring &wname,
const std::wstring &wmessage,
bool check_shout_priv = false,
u16 peer_id_to_avoid_sending = PEER_ID_INEXISTENT);
RemotePlayer *player = NULL);
void handleAdminChat(const ChatEventChat *evt);
v3f findSpawnPos();
@ -522,6 +522,7 @@ private:
// If true, do not allow multiple players and hide some multiplayer
// functionality
bool m_simple_singleplayer_mode;
u16 m_max_chatmessage_length;
// Thread can set; step() will throw as ServerError
MutexedVariable<std::string> m_async_fatal_error;